Using a Stamp BS2P and GLK12232-25-WBL

LK/ELK/VK/PK/OK/MX/GLK/EGLK/GVK/GLT Series

Moderators: Henry, Mods

Post Reply
cn00728
LCD?
Posts: 2
Joined: Wed Sep 03, 2003 8:50 pm

Using a Stamp BS2P and GLK12232-25-WBL

Post by cn00728 »

Hello,

I am finding the GLK12232-25-WBL to be an awesome screen with great features. However, there is a obstacle I don't know how to get around.

Am I correct that this screen defaults back to 19200 baud when shutdown? I'll set it to 9600 baud in Mogd.exe, then connect it to my BS2P and get funky characters. If the screen defaults back to 19200 baud each time, you need a part of the BS2P code to set it to 9600 Baud. A Basic stamp can't SEROUT at 19200 Baud to send the command to change the rs232 port speed. Can this screen be permenantly set to 9600 baud??

Here is what I'm trying to do.

'{$STAMP BS2p}
PAUSE 1000
SEROUT 1,240,[254,57,$20]
PAUSE 1000
SEROUT 1,240,[254,88]
PAUSE 500
SEROUT 1,240,["YEAH!"]

$20 Is correct for 20 Hex, right?

Thank you in advance for help on this.
Jake S.
Ken J
LCD?
Posts: 6
Joined: Wed Aug 13, 2003 6:31 am

Post by Ken J »

I have used the LK series of displays with a BS2. But if I remember correctly the speed was set with jumpers.

I notice that the documentation for both the BS2P and the GLK mentions I2C. Have you considered the possibility of using I2C instead of serial? I currently have several projects on the go using the Atom micro and LK204s using I2C and it works great. Easy and fast.

Ken
Henry
OMNIPRESENT
OMNIPRESENT
Posts: 3014
Joined: Tue Aug 14, 2001 6:00 pm
Contact:

Post by Henry »

you will need to send the change speed command to the GLK12232-25-WBL... the speed is stored in memory in the unit...

254 57 32

this should set the speed to 9600...
Henry J.
President
Matrix Orbital
Henry
OMNIPRESENT
OMNIPRESENT
Posts: 3014
Joined: Tue Aug 14, 2001 6:00 pm
Contact:

Post by Henry »

Ken J wrote:I have used the LK series of displays with a BS2. But if I remember correctly the speed was set with jumpers.

I notice that the documentation for both the BS2P and the GLK mentions I2C. Have you considered the possibility of using I2C instead of serial? I currently have several projects on the go using the Atom micro and LK204s using I2C and it works great. Easy and fast.

Ken
Some of the units like LCD/VFD2041 and LK/VK204-25 have jumpers, the rest is software controlled.

Also, Miles will be posting some good information about I2C, BS2 and LCDs very soon.

Lastly, what kind of projects are you doing with the units?
Henry J.
President
Matrix Orbital
cn00728
LCD?
Posts: 2
Joined: Wed Sep 03, 2003 8:50 pm

The problem is bigger than that.

Post by cn00728 »

Hello,

The problem I am seeing is that the display does not save the speed I set it at when using Mogd.exe. I'll set it to 9600 baud in Mogd.exe, but when power is removed, it resets to 19200 baud. Is this correct?

The stamp can't set the speed with the code below because it can't send the command at 19200 for the display to read, and then change it to 9600 baud.

How does everyone get this to work??


'{$STAMP BS2p}
PAUSE 1000
SEROUT 1,240,[254,57,32]
PAUSE 1000
SEROUT 1,240,[254,88]
PAUSE 500
SEROUT 1,240,["YEAH!"]

Jake.
Ken J
LCD?
Posts: 6
Joined: Wed Aug 13, 2003 6:31 am

Post by Ken J »

Hi Jake,

I looked through the latest Stamp manual and found some information that you would be interested in.
On page 294 it states that the speed for the Serout command runs anywhere between 608 and 115200. It is not limited to 9600.
Table 5.84 on page 297 gives various baudmode numbers for some generic baud rates, and in that table the highest rate listed is 9600, but that is not the maximum rate for the BS2P. Table 5.81 on page 296 shows how to calculate the baudmode number for the various baud rates. For 119200 8 bit no-parity true (non-inverted) I calculate, INT(2,500,000/19200)-20+0+0+0, a baudmode number of 110.

Try this:
'{$STAMP BS2p}
PAUSE 1000
SEROUT 1,110,[254,88]
PAUSE 500
SEROUT 1,110,["YEAH!"]

This should output at 119200 to the display.

I understand that you are asking about how/why the display speed change is not stored in the memory, and that I can
Miles
Matrix Orbital
Matrix Orbital
Posts: 1105
Joined: Mon Mar 04, 2002 4:00 pm

Post by Miles »

Hello..

Mogd.exe doesn't actually save the baud rate of 9600 to the memory, therefore upon power up the unit will default back to 19200. The reason you are getting funky character is because when you send SEROUT 1,240, you are actually communicating at 9600 baud. You must perform the appropriate calculation on page 296 of your Basic Stamp manual to find the value needed to send...

Try the code below :

'{$STAMP BS2p}
PAUSE 1000
SEROUT 1,110,[254,57,32]
PAUSE 1000
SEROUT 1,240,[254,88]
PAUSE 500
SEROUT 1,240,["YEAH!"]
Miles Y.
Head of Technical Support
Product Manager
Matrix Orbital
Post Reply