Serial LCD - quick question

westaust55

Moderator
Please have a look at manual 2 page 151 (latest version)

There is a table which gives the predefined "word" to use with the SEROUT command for each PICAXE speed 4/8/16MHz to achieve the required baud rate.

in your case, SEROUT pin, N9600_8, (info you want to sent)
 
Last edited:

Dave E

Senior Member
Now I am a bit confused. I don't mean to highjack this thread, but this is along the same line:

I normally use an LCD that has 3 baud rate choices: 2400, 9600 and 19,200.
I normally run 2400. In my code, I use SEROUT pin, T2400, (data_to_send). I do not include the _4 part in T2400_4. Do I need to? Is the communication more reliable or affected in any way if I do/do not use _4? The example in the manual does not use it; Manual 2 page 152.

Also, I am working with an 18X and decided to try something. I wanted to communicate with the LCD at a higher rate but the 18X does not support 9600 or 19200 baud but I set the LCD to 9600 baud and in my code I used SEROUT pin, T4800, (data) and set the frequency to 8 MHz (setfreq m8). It worked. I am now running the 18X at 8MHz communicating with the LCD at 9600 baud. Should this work? Is this a fluke with my particular LCD or is this OK. I assume that what is happening is that the T4800 command assumes 4MHz and I am just doubling the actual frequency by running at 8MHz.

CORRECTION:
I tried something.
The 18X does support 9600 baud but you must use T9600_8. So I guess I answered my own question. Not using the _4 or _8 does seem to cause a default to 4MHz.

Again, I did not mean to highjack but thought this info was related and may be helpful.

Comments welcome.

Dave E
 

Technical

Technical Support
Staff member
T4800, T4800_4, T9600_8 are actually all the same setting.

However the _4 and _8 suffix are designed to help people remember which baud rate is really occuring at different resonator speeds (4 and 8 MHz) - a 4800 baud rate at double speed becomes 9600. Of course you have to match the suffix to the actual frequency you are using at that point.
 

westaust55

Moderator
As an extension of what Techncial has stated,

the "words" T2400, T4800, T9600_8, etc are effectively pre-defined symbols

its is as if you added lines like these to your program
SYMBOL T2400 = 0
SYMBOL T4800 = 3
SYMBOL T9600_8 = 3
If you run a program like this:
Code:
b0 = T2400
b1 = T4800
b2 = T9600_8
SEROUT 7, N2400, (#b0,",",#b1,",",#b2)
you can see the values.
 
Top