View previous topic :: View next topic |
Author |
Message |
Iloveoakdave
Joined: 16 May 2004 Posts: 16
|
Clock Speed and Serial Output |
Posted: Wed May 26, 2004 7:45 am |
|
|
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
|
Re: Clock Speed and Serial Output |
Posted: Wed May 26, 2004 8:09 am |
|
|
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.
BAUD RATES FOR SYNCHRONOUS MODE |
|
|
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Wed May 26, 2004 8:19 am |
|
|
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
|
|
Posted: Wed May 26, 2004 8:42 am |
|
|
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
|
|
Posted: Wed May 26, 2004 8:58 am |
|
|
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
|
|
Posted: Wed May 26, 2004 9:46 am |
|
|
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
|
|
Posted: Wed May 26, 2004 12:40 pm |
|
|
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
|
|
Posted: Wed May 26, 2004 2:59 pm |
|
|
Good info to know Steve. Thanks.
dave |
|
|
|