 |
 |
| View previous topic :: View next topic |
| Author |
Message |
Ttelmah
Joined: 11 Mar 2010 Posts: 20061
|
|
Posted: Tue Aug 25, 2015 11:14 am |
|
|
I'd suggest the 12F1572.
Cheap (0.43). Assuming you are running at 5v?. If not the LF variant. Loads of peripherals (3*CCP, 1*UART, loads of timers, DAC, Comparator etc.), and draws less power than your current chip!...
The 12F1822/40, is more expensive. |
|
 |
soonc
Joined: 03 Dec 2013 Posts: 215
|
| Thanks |
Posted: Tue Aug 25, 2015 10:55 pm |
|
|
I should visit that site more often.
CCS compiler allows me to build a project for PIC12F1572 but it does not compile at all. ! |
|
 |
Ttelmah
Joined: 11 Mar 2010 Posts: 20061
|
|
Posted: Wed Aug 26, 2015 4:30 am |
|
|
There are some setup problems on early compilers for this chip, but most are easy to fix.
Try something really basic like:
| Code: |
#include <12F1572.h>
#device ADC=10
#FUSES NOMCLR, INTRC_IO, STVREN, NOLVP, NODEBUG, WDT_SW, BROWNOUT_SW
#use delay(internal=2MHz)
#use rs232(baud=9600,parity=N,UART1,bits=8,stream=PORT1,ERRORS)
void main()
{
while(TRUE)
{
output_toggle(PIN_A0); //Test to prove chip is running
delay_ms(100);
}
}
|
and tell us what happens. |
|
 |
soonc
Joined: 03 Dec 2013 Posts: 215
|
| Change of plans |
Posted: Wed Aug 26, 2015 4:57 am |
|
|
| Ttelmah wrote: | I'd suggest the 12F1572.
Cheap (0.43). Assuming you are running at 5v?. If not the LF variant. Loads of peripherals (3*CCP, 1*UART, loads of timers, DAC, Comparator etc.), and draws less power than your current chip!...
The 12F1822/40, is more expensive. |
If I change plans and use the PIC16LF1823 it allows me to make this a slave I2C and connect it to the existing I2C bus and free up two pins on Chip 2 which means I may yet get rid of a port expander chip !
It also has built in hardware debugging capability which may be needed to get the I2C working.
Price is only a few cents more. Current draw should be a little less also.
Thanks everyone for all the help. |
|
 |
soonc
Joined: 03 Dec 2013 Posts: 215
|
| OK |
Posted: Wed Aug 26, 2015 5:03 am |
|
|
| Ttelmah wrote: | There are some setup problems on early compilers for this chip, but most are easy to fix.
Try something really basic like:
| Code: |
#include <12F1572.h>
#device ADC=10
#FUSES NOMCLR, INTRC_IO, STVREN, NOLVP, NODEBUG, WDT_SW, BROWNOUT_SW
#use delay(internal=2MHz)
#use rs232(baud=9600,parity=N,UART1,bits=8,stream=PORT1,ERRORS)
void main()
{
while(TRUE)
{
output_toggle(PIN_A0); //Test to prove chip is running
delay_ms(100);
}
}
|
and tell us what happens. |
Thanks that compiles.
I used the PIC Wizard in the IDE to setup a project and it could not find the include, and it did not generate any #FUSES statements.
I'm still waiting for CCS tech support to fix the Break Point issue on the PIC24. They acknowledged that they could reproduce the issue. |
|
 |
Ttelmah
Joined: 11 Mar 2010 Posts: 20061
|
|
Posted: Wed Aug 26, 2015 5:06 am |
|
|
Yes, going I2C, with hardware sounds a very good option.
Looks like you have a good idea now of a neat way of doing this. Long term a much better approach.
My opinion of the Wizard unfortunately is not suitable for public release..... |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|