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 support@ccsinfo.com

maximum baud rate with internal RC oscillator

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
kender



Joined: 09 Aug 2004
Posts: 768
Location: Silicon Valley

View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger

maximum baud rate with internal RC oscillator
PostPosted: Mon May 07, 2007 3:07 pm     Reply with quote

Quick question. I’m running an 18LF4320 from an internal RC oscillator. I’ve never used internal RC before. From what I know, RC is less accurate than Crystal. What’s the highest reliable baud rate that can be used for serial communication with PC (true RS-232 with a MAX3221 driver) Question

When PIC is transmitting 9600 baud, the PC receiving about 30% garbage. Either 9600 is too fast, or I’m doing something wrong. I’m going to scan through the standard baud rates until I find something acceptable, but I’d like to tap into the tribal knowledge too.

The PIC will be working well within the consumer range of temperatures.
_________________
Read the label, before opening a can of worms.
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Mon May 07, 2007 4:26 pm     Reply with quote

It is not just a matter of speed. It is a matter of timing uncertainty. If your clock is 5% off then by the end of a Start bit, 8 data bits, and a Stop bit you are half a bit off regardless of what baud rate you are using.
If this is a home project you can try fudging the baud rate. If 9600 almost works then try 9600 + 2% = 9792 baud or 9600 - 2% = 9408 baud and see which works better. Beware this may change with voltage, temperature, or a different chip.
_________________
The search for better is endless. Instead simply find very good and get the job done.
kender



Joined: 09 Aug 2004
Posts: 768
Location: Silicon Valley

View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger

PostPosted: Tue May 08, 2007 1:14 am     Reply with quote

The error in baud rate is only 0.6%. Dithering the baud rate by +/- 2% didn't have any positive effect. There should be something else wrong. For example, the XMIT pin stays high, when the data is not being transmitted. I think it should stay low. The output isn't inverted:
Code:
#use rs232(baud=38400,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=9,stream=pcrs232)

_________________
Read the label, before opening a can of worms.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue May 08, 2007 1:28 am     Reply with quote

Why is bits set = 9 ?
grasspuddle



Joined: 15 Jun 2006
Posts: 66

View user's profile Send private message

PostPosted: Tue May 08, 2007 9:21 am     Reply with quote

doesn't MAX 232 chips set tx/rx high when not in use?
kender



Joined: 09 Aug 2004
Posts: 768
Location: Silicon Valley

View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger

PostPosted: Tue May 08, 2007 10:40 am     Reply with quote

PCM wrote:
Why is bits set = 9 ?

9 comes from the wizzard. I assumed that it's data_bits+stop_bits Changed to 8 - it works now.

grasspuddle wrote:
doesn't MAX 232 chips set tx/rx high when not in use?

I have disconnected MAX3221 - the line remained high. There's no pull-up resistor either.
_________________
Read the label, before opening a can of worms.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
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