Announcement

Collapse
No announcement yet.

uOLED_160-G2 baud rate issues

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

  • uOLED_160-G2 baud rate issues

    Hi,

    I'm using a UOLED-160-G2 module on an arduino UNO with the arduino shield adapter.

    I have everything working and can talk to the display at 9600 baud and using the setBaudWait() function I can set the baud rate to 19200 successfully. However, any other higher rates I get NAK failures.

    I have tried on both the hardware serial ports and soft serial but have no luck getting higher than 19200. Any help appreciated.

    Matt.

  • #2
    Hello Matt,

    Welcome to the forum

    Could you please let me know which baud rates you used above 19200 that are shown in th table on page 79 of the datasheet https://www.4dsystems.com.au/product...nual_R_2_0.pdf

    The next baud rate up from 19200 would be 31250 which I am sure you can set the UNO to after the setBaudWait() command has been issued.

    Best regards

    Paul

    Comment


    • #3
      Hi Paul,

      I tried 38400, 57600, 115200 etc. I didn't try 31250.

      I have subsequently changed my hardware setup to an Arduino M0, and now all the higher baud rates work up to 128000 baud.

      However, I did find an issue with the library when compiling for M0. Maybe this should be a separate thread, but here it is anyway. The following line upon the object creation kills the M0 operation:

      Code:
      _virtualPort->flush();
      Contained in the constructor as follows:

      Code:
      //Goldelox_Serial_4DLib::Goldelox_Serial_4DLib(Stream * virtualPort) { 
      Goldelox_Serial_4DLib::Goldelox_Serial_4DLib(Stream* virtualPort) { 
      
          _virtualPort = virtualPort; 
      
      #ifndef _SAM3XA_
          // Only done on non Arduino Due Boards
          _virtualPort->flush(); 
      #endif
      }
      I have removed the _virtualPort->flush(); code and now the library works on the M0. Maybe the #ifndef needs more definition for the SAMD21 devices? Or removed altogether as I don't see why you would need to flush a port that has not been opened yet?

      Matt.

      Comment


      • #4
        Hello Matt,

        Thanks for the feedback, glad you got it working. Thank you also for the info on _virtualPort->flush()

        Best regards

        Paul

        Comment

        Working...
        X