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

Clock Speed and Serial Output

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



Joined: 16 May 2004
Posts: 16

View user's profile Send private message

Clock Speed and Serial Output
PostPosted: Wed May 26, 2004 7:45 am     Reply with quote

Hi all. I just got a CrystalFontz serial LCD (is this thing big or what!) and have it working at 19200 with the #use Delay(20000000). When I change this to 4000000 I get garbage output. I've seen some examples set to 4Meg and 19200 that I assume is working. Any ideas why 19200 does not work at the 4Meg setting or is there some magic formula for clock speed and serial output. I'm using the CCS ICD and their test board. Thanks.

dave
Neutone



Joined: 08 Sep 2003
Posts: 839
Location: Houston

View user's profile Send private message

Re: Clock Speed and Serial Output
PostPosted: Wed May 26, 2004 8:09 am     Reply with quote

Iloveoakdave wrote:
is there some magic formula for clock speed and serial output


Open the data sheet and search for this string to find the magic formula. Very Happy

BAUD RATES FOR SYNCHRONOUS MODE
SherpaDoug



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

View user's profile Send private message

PostPosted: Wed May 26, 2004 8:19 am     Reply with quote

If you are using a software UART there may be some compensation for the software execution time. At high baud rates this will be significant and might be a little off at 40MHz.
_________________
The search for better is endless. Instead simply find very good and get the job done.
Iloveoakdave



Joined: 16 May 2004
Posts: 16

View user's profile Send private message

PostPosted: Wed May 26, 2004 8:42 am     Reply with quote

thanks for the input. I believe the CCS board uses a Maxim device. I will check it out.
SteveS



Joined: 27 Oct 2003
Posts: 126

View user's profile Send private message

PostPosted: Wed May 26, 2004 8:58 am     Reply with quote

Please take no offense at this dumb question but let me ask:

Did you physically change the oscillator to a 4Mhz version when you changed the delay statement? You don't say anything about the oscillator.

In any case if you did, it may be a bad part or the wrong type (serial vs. parallel). If you didn't, then do.

- SteveS
Iloveoakdave



Joined: 16 May 2004
Posts: 16

View user's profile Send private message

PostPosted: Wed May 26, 2004 9:46 am     Reply with quote

No this is a good question. Since I'm using the CCS demo board I assumed that you could change the delay and it would take care of the rest without physically changing the crystal. I wonder if this thinking is correct.

dave
SteveS



Joined: 27 Oct 2003
Posts: 126

View user's profile Send private message

PostPosted: Wed May 26, 2004 12:40 pm     Reply with quote

The #use delay statement is only a way to let the compiler know what actual crystal you have so it can correctly figure bauds, delays, etc. It does nothing (directly) to the hardware. So you'll need to change out the crystal, oscillator, etc to match the #use delay value to get it to work right.

- SteveS
Guest








PostPosted: Wed May 26, 2004 2:59 pm     Reply with quote

Good info to know Steve. Thanks.

dave
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