Shop OBEX P1 Docs P2 Docs Learn Events
Check this code plz...SX28->uOLED 128 — Parallax Forums

Check this code plz...SX28->uOLED 128

SashaSasha Posts: 35
edited 2008-11-07 13:02 in General Discussion
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 !!!

Comments

  • mojorizingmojorizing Posts: 249
    edited 2008-11-06 18:20
    I don't think you need to use brackets around the hex values.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Bad spellers of the world untie!
  • DufferDuffer Posts: 374
    edited 2008-11-06 19:28
    I'm not familiar with SX/B, but I am somewhat familiar with the uOLED displays from 4D Systems.

    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
  • SashaSasha Posts: 35
    edited 2008-11-07 01:00
    Thanks Duffer,

    So string "s",0,0, 1, $FF,$FF, "SX/B Rocks", $00 should be something like this:

    TX_Str "$73,0,0,1,$FF,$FF,SX/B Rocks,$00"
    


    or
    TX_Str "$73,0,0,1,$FF,$FF,$22SX/B Rocks$22,$00"
    

    (just to be clear $22SX/B Rocks$22 = "SX/B Rocks")

    Hmmm...Think that I need JonnyMac or Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

    Think deep......Dive shallow !!!
  • DufferDuffer Posts: 374
    edited 2008-11-07 01:41
    That looks more like it. Not sure which syntax you need, but yeah, you need to send all the serial bytes that make up the command for the display, including the string to be displayed on the screen and the HEX 00 terminator. You should be able to look at any of the Basic Stamp examples that use PBasic to control the 4D Systems serial command displays. Just look at how the SEROUT commands are used to send serial data to the display. Then just convert that to SX/B (Bean says it's easy!). smilewinkgrin.gif

    Duffer
  • JonnyMacJonnyMac Posts: 9,214
    edited 2008-11-07 02:39
    I don't have a uOLED display, otherwise I would chime in.
  • BeanBean Posts: 8,129
    edited 2008-11-07 03:37
    Sasha,
    · 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
  • SashaSasha Posts: 35
    edited 2008-11-07 13:02
    Thanks to all,
    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
    TX_Str Msg
     
    Msg:
      DATA $73, $00, $00, $01, $FF, $FF, "SX/B Rocks!", $00, $3b
    
    


    will work.

    I'll post test result soon as possible

    Once more,Thanks to all.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

    Think deep......Dive shallow !!!
    ·
Sign In or Register to comment.