Announcement

Collapse
No announcement yet.

Unable to read serial from display.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Unable to read serial from display.

    Hello!

    I'm a developer at a small company, working on a prototype for one of our projects.

    I have the the GOLDELOX 1.5" uOLED-128-G2 module set up on a Raspberry Pi, using the Goldelox Linux library.
    I'm trying to run the library's "BigDemo" code, and there's an issue getting an acknowledgement from the display.

    My setup is as follows:
    • I have a PL2303 USB to UART bridge to connect the display to a USB port on the Raspberry Pi.
    • I've changed the BigDemo code from using "/dev/ttyAMA0" to "/dev/ttyUSB0" to reflect the serial port that's actually being used.
    When I try to run the demo code:
    • The code loops during the ReadSerPort() call in the initial OpenComm() (goldeloxdemo.c line 413), but eventually times out and proceeds.
    • When it reaches the first gfx_cls() (in goldeloxdemo.c line 420) the screen clears, but loops/times out right afterwards when calling GetAck().
    • I've also replaced this line with a gfx_Circle() to test - the screen is able to draw a circle, but loops/times out right afterwards too.
    The above results are very inconsistent, and most of the time nothing happens at all.

    This is what I see happening: when the code reaches (from goldeloxSerial.c line 107)
    iIn = read(cPort, &psData[iIdx], iLeft)
    a value of -1 is returned (observed using console to print value of iIn), which causes the program to go into a loop, and cannot proceed.


    My conclusion is that writing bytes to the display is possible, but there's something which prevents the Raspberry Pi reading from or the display, or the display itself is not transmitting bytes.

    Some things which may be affecting this (but I'm not sure):
    • I have left the RES pin on the display disconnected, since I'm not sure where it would go.
    • I have attempted to turn off using the serial port as the console terminal port, but maybe I've done this incorrectly?
    • I'm pretty sure my wiring is set up correctly otherwise. RX is going to TX, TX is going to RX, etc.

    Help would be greatly appreciated!
    Cheers.

  • #2
    Hello a_isolate,

    Welcome to the forum! I have tried your setup but nothing seems to be wrong and the "BigDemo" code is running just fine.
    Have you tried to send something on your display(uOLED-128-G2) using the Serial Commander?
    You can do this by creating a new file on the Workshop4 IDE then:

    ->Choose your display
    ->Select Serial
    ->In the Tools Tab, choose Serial Commander

    But before that, be sure that the baud rate you are working is the same with your current selection.
    Click image for larger version  Name:	1.png Views:	1 Size:	84.6 KB ID:	63802
    then to apply settings, load the program
    Click image for larger version  Name:	2.png Views:	1 Size:	18.0 KB ID:	63803
    You can see the current baudrate on your display.

    If you can successfully communicate with the display, there must be no other problems with communicating via Raspberry Pi(baud rate must also be the same on Raspberry Pi).
    You can also try to update the PmmC on the display. Please refer to the instructions on this appnote https://www.4dsystems.com.au/appnote/4D-AN-00041/

    I have attached a working video of "BigDemo" running on SSH terminal

    If the problem still persists, you can post here further information on how you are setting things up on your end.


    Best regards,
    Kevin
    Last edited by John Kevin; 1st June 2018, 07:07 PM.

    Comment


    • #3
      Hi John Kevin,

      Thanks for your reply.

      I swapped out my PL2303 connector for the 4D systems USB-UART connector, and now everything works great.

      Much appreciated!

      Comment


      • #4
        Hello a_isolate,

        It's good to know that you are able to make your program running.
        If you still have any concerns please dont hesitate to contact us.

        Best regards,
        Kevin

        Comment

        Working...
        X