CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Soft UART Max Speed ?
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Ttelmah



Joined: 11 Mar 2010
Posts: 20061

View user's profile Send private message

PostPosted: Tue Aug 25, 2015 11:14 am     Reply with quote

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

View user's profile Send private message

Thanks
PostPosted: Tue Aug 25, 2015 10:55 pm     Reply with quote

alan wrote:
use microchip tools to locate depending on what you want.

Both the links below gives 4 part numbers for a 8 pin device with UART

http://www.microchip.com/maps/microcontroller.aspx

http://www.microchip.com/ParamChartSearch/chart.aspx?branchID=1005#

Regards

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

View user's profile Send private message

PostPosted: Wed Aug 26, 2015 4:30 am     Reply with quote

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

View user's profile Send private message

Change of plans
PostPosted: Wed Aug 26, 2015 4:57 am     Reply with quote

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

View user's profile Send private message

OK
PostPosted: Wed Aug 26, 2015 5:03 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Aug 26, 2015 5:06 am     Reply with quote

Yes, going I2C, with hardware sounds a very good option. Smile

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.....
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
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