Check this code plz...SX28->uOLED 128
Can somebody check this code for me? I 'm not able to test it (Not at home for several days). Source for this project are BS2 & uOLED 128 display, "Serout" Jon Williams tutorial and some Bean (Hitt Consulting) instructions.
Since I'm in the Hotel and have some free time and weather don't allow to get out, decide to study SX/B (very interested for uOLED display).
I'm curios is this approach good and how many mistakes I made.
Thank you
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think deep......Dive shallow !!!
Since I'm in the Hotel and have some free time and weather don't allow to get out, decide to study SX/B (very interested for uOLED display).
I'm curios is this approach good and how many mistakes I made.
Thank you
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think deep......Dive shallow !!!
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Bad spellers of the world untie!
Sending the 'PowerOn" command "$59, $03, $01"·before the AutoBaud command "$55" WILL NOT WORK. The AutoBaud command MUST be the first command sent to the display and you should verify that the display responds with an ACK ($06), before proceeding.
Sending just a "string"·as you do in your code: TX_Str "SX/B Rocks" will not work. You will need to·send a complete·serial·command that includes your text string and a "zero" terminator, i.e.·
Place string of Ascii Text (formatted) (s)
Syntax : cmd, column, row, font, colour(msb:lsb), “string”, terminator
cmd : 73 hex, s ascii
(see the uOLED-128-GMD1 (or -G1) documentation for details and examples of the complete serial command symtax)
Example: "s",0,0, 1, $FF,$FF, "SX/B Rocks", $00
Prints the string "SX/B Rocks" at col 0, row 0, font size 1(8x8), text color WHITE
As far as the hook-up goes, I would also add a 10K pullup resistor on the display's Rx line to improve·AutoBaud imunity to noise and·false lock-ons.
Good luck,
Duffer
Post Edited (Duffer) : 11/6/2008 7:33:41 PM GMT
So string "s",0,0, 1, $FF,$FF, "SX/B Rocks", $00 should be something like this:
or
(just to be clear $22SX/B Rocks$22 = "SX/B Rocks")
Hmmm...Think that I need JonnyMac or Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think deep......Dive shallow !!!
Duffer
· Use TX_Byte to send the values and TX_Str to send the text.
· Try this:
· TX_Byte $73
· TX_Byte $00
· TX_Byte $00
· TX_Byte $01
· TX_Byte $FF
· TX_Byte $FF
· TX_Byte $22
· TX_Str "SX/B Rocks!"
· TX_Byte $22
· TX_Byte $00
Normally you could put the whole thing into a DATA line and call TX_Str with the label, but since the info uses value zero, that won't work. TX_Str would stop when it hit the first $00.
For example if you could·use $02 instead of $00 you could do this:
TX_Str Msg
Msg:
· DATA $73, $02, $02, $01, $FF, $FF, $22, "SX/B Rocks!", $22, $00
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"The welfare of the people in particular has always been the alibi of tyrants." ~ Camus
www.iElectronicDesigns.com
Post Edited (Bean (Hitt Consulting)) : 11/7/2008 3:43:51 AM GMT
uOLED string cmd expect $00 as terminator but Tx_Str method too, so as Bean says TX_Str would stop when it hit the first $00, in this case cmd is uncompleted . To prevent that I change Terminator for Tx_Str method from 0 to $3b=([noparse];)[/noparse] . So I'm sure that this
will work.
I'll post test result soon as possible
Once more,Thanks to all.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think deep......Dive shallow !!!
·