View Full Version : stamp BSX avec Matrix orbital LK 204-25-wb-c74

James le Francais
11-22-2009, 10:39 PM
i am french, sorry for my bad english, i have need information for connect the matrix orbital LK 204-25-WB whis keyboard in serial whis BASIC STAMP BSX or BS2
Thank you verry mutch
"Merci beaucoup"
Denis France

Mike Green
11-22-2009, 11:19 PM
Have you read the documentation for the display? (www.matrixorbital.ca/manuals/LK_series/LK204-25/LK204-25.pdf (http://www.matrixorbital.ca/manuals/LK_series/LK204-25/LK204-25.pdf)).

Obviously, you must have a source of power and ground for the display. Page 10 of the documentation shows where to connect power and ground.

You can connect the Tx and Rx signals to the Stamp using either the connections on page 10 or the DB-9 connector shown on page 9. The BASIC Stamp Syntax and Reference Manual (www.parallax.com/Portals/0/Downloads/docs/prod/stamps/web-BSM-v2.2.pdf (http://www.parallax.com/Portals/0/Downloads/docs/prod/stamps/web-BSM-v2.2.pdf)) shows how to connect a DB-9 connector to Stamp I/O pins (pages 395 and 417).

There's nothing special about using the keyboard with the LK204-25. The documentation explains how the keyboard works and describes the commands to the LK204-25 to change how the keyboard and LK204-25 behaves.

I believe the default is for the LK204-25 to send the code for each keypress to the Stamp.

James le Francais
11-23-2009, 12:41 AM
Thank you, for your help, i find a exemple serial demo programme, i have testing·the ic2 programme·but this programme·no running with the stamp·bsx only whith stamp bs2 ???, for my it is beter using the programme by serial y have·a little experience whith serial command, the ic2 is more complex, my objectif is use the bsx + lk 204 whith keyboard


Mike Green
11-23-2009, 01:05 AM
It is possible to program the BS2 or BS2sx Stamp to do I2C using subroutines. Nuts and Volts Column #85 shows how to do this:
www.parallax.com/Portals/0/Downloads/docs/cols/nv/vol3/col/nv85.pdf (http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/vol3/col/nv85.pdf)

The BS2 and BS2sx operate at different speeds and some statements (like SERIN and SEROUT) use numbers to specify timing (like Baud) that are different from one Stamp model to another. The Stamp Manual and the Stamp Editor's help files give the different values needed for the different Stamp models. Look at the sections on the SERIN and SEROUT statements.

James le Francais
11-23-2009, 01:47 AM
thank you for your help·Mike, i have a job now for begin my new project, if you find a demo programme for my, please send my leater, i have find lot off demo programme for the serial lcd but not for the matrix orbital.


Mike Green
11-23-2009, 02:07 AM
The Matrix Orbital display is really just a serial LCD with its own set of control codes. Connect it up to a Stamp and start experimenting with the control codes in the documentation. With a BS2sx, a typical output statement for I/O pin <pin> would look like:

SEROUT <pin>,16504,["Hello there",CR]

The "16504" specifies 19,200 Baud and inverted mode which is used with the connections shown on page 417 of the Stamp Manual.

Ron Czapala
11-23-2009, 02:30 AM
The Matrix Orbital LK204-25 can be used with RS232 serial, IC2 or TTL communications (depending on·the soldered jumper settings). Page 11 of manual (see below).
To use the DB-9 connector (RS232) you need to use a line driver chip such as·a Maxim Max233a or Max232 to handle the 12v vs 5v serial signal.
From page 17 of the manual:· http://www.matrixorbital.ca/manuals/LK_series/LK204-25/LK204-25.pdf

The display module communicates at standard voltage levels of ±12V to ±12V or at TTL levels of 0 to +5V by setting the Protocol Select Jumpers to TTL."
There is more information at:· http://www.matrixorbital.ca/appnotes/basic_stamp/

' {$STAMP BS2}
' {$PBASIC 2.5}
'TrueBaud mode for non-inverted 9600-N81 (MAX233a line driver)
'InvBaud mode for inverted, 9600-N81 (direct connect e.g. w/22k ohm)
TrueBaud CON 84
InvBaud CON 16468
TrueBaud CON 240
InvBaud CON 16624
TrueBaud CON 396
InvBaud CON 16780
'LCD constants & variables
I2C_addr CON 51 '[addr] 0x00-0xFF default 0x50
BaudRate CON 57 '[speed] 53(1200) 29(2400) CF(4800) 67(9600) 33(19200) 22(28800) 19(38400) 10(57600) default 19200
nonstdBaudRate CON 164 '[speed]
displayOn CON 66 '[min] delay on for 0-100 minutes 0-stays on
displayOff CON 70
brightness CON 153 '[brightness] 0-255
SaveBrightness CON 152 '['brightness]
Contrast CON 80 '[contrast] 0-255
SaveContrast CON 145 '[contrast]
remember CON 147 'switch 0=no 1=yes remembers Scroll, LineWrap, cursor type & state, etc
version CON 54 'return version number e.g. 0x10 (ver 1.0) 0x42 (version 4.2)
model CON 55 '0x09 LK204-25
clearSCR CON 88
goHome CON 72
ScrollOn CON 81
ScrollOff CON 82
curPos CON 71 '[col] [row]
LineWrapOn CON 67
LineWrapOff CON 68
ChgStartUpScr CON 64 '[chars] note: will autowrap
curBack CON 76
curFwd CON 77
ulCursOn CON 74
ulCursOff CON 75
blkCursOn CON 83
blkCursOff CON 84
'Once you have defined a custom character you may display it by sending the display module the [refID]. For example if a custom character was
'saved in position one, the command to display the custom character, at the current cursor position, would be simply to send the number one to
'the display module without quotes.
CustChar CON 78 '[refid] [data] refid=0-7 data is 8 bytes (bits patterns)
SaveCustChar CON 193 '[bank] [refid] [data] bank=0-4 refid=0-7 data is 8 bytes (bits patterns)
LoadCustChars CON 192 '[bank] bank=0-4
SaveStartScr CON 194 '[refid] [DATa]
InitMedNum CON 109
placeMedNum CON 111 '[row] [col] [digit]
InitLgNum CON 110
placeLgNum CON 35 '[col] [digit]
InitHorzBar CON 104
placeHorzBar CON 124 '[col] [row] [dir] [length] direction=0(right) or 1(left) length in pixels
InitNarVertBar CON 115
InitWidVertBar CON 118
placeVertBar CON 61 '[col] [length] length in pixels
gpoOff CON 86 'General Purpose Output off [num] (ground)
gpoOn CON 87 'General Purpose Output on [num] (5v 20mA)
gpoStartState CON 195 '[num] [state] 0=0ff 1=on
Prefix CON 254 'LCD command prefix
i VAR Byte
DEBUG DEC truebaud
SEROUT LCD,truebaud,[254,"X"]
'SEROUT LCD, 16416,[254,"G",$03,$02] 'Set cursor position to column 3, row 2
SEROUT LCD, truebaud,["Test message"]


James le Francais
11-23-2009, 02:43 AM
thank you very much all of you, is it not easy for me to explain but, i am very happy for our help see you leter,

en francais: Merci a tous pour votre aide vous etes très sympathique j'ai toutes les informations pour faire mon projet à bientôt,

60120 Plainville