Shop OBEX P1 Docs P2 Docs Learn Events
Using uOLED-128 with Basic Stamp 2 — Parallax Forums

Using uOLED-128 with Basic Stamp 2

Mr TedMr Ted Posts: 4
edited 2014-02-04 13:45 in BASIC Stamp
Hello there,

Is anybody know how to display a word on the uOLED-128 with a BS2 ?

I already connected the uOLED to the BS2 but I didn't find a .bs2 code on the parallax website.

Here are my connections :

+5V --> VDD
RX --> PIN 2
TX --> PIN 3
GND --> VSS
RESET --> RES

Kind regards

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2012-08-15 18:21
    Have you looked at the datasheet and user's manual for the uOLED-128?
    TX CON 4 ' Transmit to the uOLED-128, connect to uOLED-128 RX
    RX CON 5 ' Receive from the uOLED-128, connect to uOLED-128 TX
    BAUD CON 84 ' 9600 Baud, 8 bits, no parity, 1 stop bit

    HIGH TX ' Make sure transmit line is high (see datasheet page 9)
    PAUSE 500 ' Wait for uOLED-128 to finish initializing
    SEROUT TX,BAUD,["U"] ' Send autobaud command (see datasheet)
    SERIN RX,BAUD,[wait(6)] ' Wait for ACK character
    ' This is an example of the "S" command from the User's Manual.
    ' Draw/Display String ‘Hello’ at x = 20, y = 20 in WHITE (FFFFhex) colour.
    SEROUT TX,BAUD,["S",20,20,1,$FF,$FF,1,1,"Hello",0]
    SERIN RX,BAUD,[wait(6)] ' Wait for ACK character
  • Mr TedMr Ted Posts: 4
    edited 2012-08-16 07:25
    Sorry, I use a uOLED-128-GMD1 not a uOLED-128-G1. I have not been able to run the code.

    Kind regards
  • Mike GreenMike Green Posts: 23,101
    edited 2012-08-16 08:03
    Look at the User's Manual for the uOLED-128-GMD1 and you'll see that the commands are the same.

    The example I gave is based on the examples in the User's Manual. I don't have one of these displays, so I can't test the example. Make sure you have the display connected properly. The above example was written (as it says) to have the uOLED-128 RX pin connected to Stamp I/O pin 4 and the TX pin connected to Stamp I/O pin 5. You can change the constant definitions if you have different connections.
  • Mr TedMr Ted Posts: 4
    edited 2012-08-16 11:12
    Thanks for your answers !!!
  • Mike GreenMike Green Posts: 23,101
    edited 2012-08-16 11:35
    You could leave out the SERIN statements if you substitute a short pause to allow the display to execute the command. I can't say how much time you'd need, but you could try PAUSE 100 for a start. The User's Manual can be found with a Google search here.
  • solder_fumessolder_fumes Posts: 18
    edited 2014-02-04 13:37
    Here is some code that works, as well as a photo of the project and of the debug terminal.

    The 4D documents say that erratic operation can be expected if the device returns anything other than $06 when acknowledging each command. As you can see by the photo of my debug terminal, the display "doesn't like" about half my commands, but it seems to run without any problems (I've not yet let it run for several hours, but plan on doing that tonight). I'd still like to look into why so many of my acks are bad. The bad ones come back with "F0".

    Thanks,

    John
  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2014-02-04 13:45
    If you don't "clean house" after sending some commands, the displays can get confused and either lock, or ignore oncoming commands. Some of the commands expect data after the ACK and some do not... Cleaning house to keep track of the commands can greatly help with display errors.

    The video link below still applies to this display....

    http://www.youtube.com/watch?v=ZIlAoABmQ0w
Sign In or Register to comment.