Shop OBEX P1 Docs P2 Docs Learn Events
4D uLCD connectivity issue — Parallax Forums

4D uLCD connectivity issue

Phillysteak527Phillysteak527 Posts: 5
edited 2012-08-08 14:34 in Propeller 1
Hello everyone. I'm extremely new to Spin programming and i've run into a roadblock. I'm having difficulty in sending commands to a 4D LCD using the "Full Duplex Serial" object. I've tried to use the uOLED object from OBEX, but I believe it isn't the object that is causing the issues it's the way i'm trying to send commands. For instance if I am attempting to send the command "Print" via a serial link how would the syntax look? I noticed that in the 4D uOLED object it sends commands as such:
SERIAL.tx ("C")
SERIAL.tx (X)
SERIAL.tx (Y)
SERIAL.tx (RADIUS)
SERIAL.tx (R.byte[1])
SERIAL.tx (R.byte[0])
WAITACK

The above code should generate a circle, i've tried this syntax but still can't communicate with the LCD. Can anyone direct me to a tutorial or manual on how to properly communicate with peripherals using a serial link? Thank you in advance.

Comments

  • TubularTubular Posts: 4,706
    edited 2012-08-08 05:33
    Hi and welcome to the Propeller forums.

    With the serial variants of the display it's normal to send a 'U' character first so the display knows what baud rate to receive at. I think you also need a CR afterwards, but I'll double check that.

    I have some example code while I'll find and post shortly.

    regards
    tubular
  • TubularTubular Posts: 4,706
    edited 2012-08-08 05:40
    oops the code I was thinking is actually VB code not propeller, but here's the startup sequence. The tdelay are delays in seconds. The CR's don't appear to be required. I remember some strange situation where the screen wouldn't erase 100% of the time, hence the two 'E' commands to erase the screen at the start.
    'Initialise OLED
    OPEN "COM2:19200,n,8,1,cs0,cd0,ds0,rb2999" FOR RANDOM AS #45
    tdelay 2
    OLEDTransmit "U"
    tdelay .1
    OLEDTransmit "E"
    tdelay .1
    OLEDTransmit "E"
    tdelay .1
    
    
    S$ = "p" + CHR$(0)
    OLEDTransmit S$
    S$ = "G" + CHR$(0) + OledY$(0) + CHR$(0) + OledY$(16) + CHR$(109) + OledY$(16) + CHR$(0) + CHR$(31)
    OLEDTransmit S$
    
  • Phillysteak527Phillysteak527 Posts: 5
    edited 2012-08-08 06:58
    After instituting your suggestions and still not making progress I checked the RX/TX lines with my scope and I am not getting any transmission to the uLCD. The program hands as it waits for the ACK signal. Any suggestions?
  • TubularTubular Posts: 4,706
    edited 2012-08-08 14:34
    That's no good. Can you pls show me the lines of your program where you initialise the SERIAL object? As in setting pin numbers etc.
Sign In or Register to comment.