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

rs232/xbee baud rate problem
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
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Feb 10, 2012 2:56 pm     Reply with quote

Quote:
I'm facing a strange issue of the s/w RS232 implementation.
I run PIC16F1939 @ 4MHz, and I'm trying to use s/w serial running @ 38400.

The bit period for 38400 is 26.04 usec, so that should easily be possible
for the compiler to do. What's your CCS compiler version ? It's given
at the top of the .LST file (look in your project directory for that file).
Version numbers look like this:
http://www.ccsinfo.com/devices.php?page=versioninfo
slavka012



Joined: 10 Feb 2012
Posts: 28

View user's profile Send private message

PostPosted: Fri Feb 10, 2012 4:04 pm     Reply with quote

temtronic wrote:
Internal oscillators aren't all that stable(1%) which can account for the frequency being off.

Thanks for stating the obvious. Like I said, I confirmed correct frequency of the chip. Actual frequency is within 1% of the 4MHz.

You can also notice that resulting baud rate differs by 7%.

As another poster noted, 38400 is easy for compiler to achieve with better than 1% accuracy with the given CPU speed. In fact it worked on different projects/chips.

I believe I have the latest compiler:

CCS PCM C Compiler, Version 4.129, 59140
temtronic



Joined: 01 Jul 2010
Posts: 9658
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sat Feb 11, 2012 7:16 am     Reply with quote

If you have previous compilers, maybe try the same code and look at the listings where the software UART is created. Perhaps CCS made a change to code for some reason and the UART code has been altered. 7% is a 'huge' difference but heck 1 or 2 instructions in a loop....... !
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