Announcement

Collapse
No announcement yet.

uLCD-43D UART Communication with Arduino Due

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

  • uLCD-43D UART Communication with Arduino Due

    Hello,

    I am working on a project that uses the uLCD-43D as a simple display for an Arduino Due program. Unfortunately this display cannot act as an I2C slave and my project will not allow for the Due to behave as a slave. Because of this, I have chosen simple UART communication to send packets of data to the display. At first, I did this without sending an acknowledgement byte back to the Arduino. This did not work because the rate at which the Due was sending the data was too fast and overflowed the input buffer of the display. I cannot afford to add any delays on the arduino side... so I now need to send an acknowledgment byte back to tell the Arduino if it can send the next packet or not. I thought about maybe using a time delayed send (if time since last send is x milliseconds or something) on the Arduino side.. but speed is of the upmost importance here so I would like to send data as fast as possible to the screen.

    When I modified my program, the Arduino was acting as if it was not receiving any data from the screen. So to debug this issue I wrote two very simple programs to test the communication between the two. I know the communication from the Arduino to the screen works, now I need to test the comms from the screen to the Arduino. TX>RX, RX>TX is wired correctly. Below are my two programs.

    Arduino code:

    void setup() {
    Serial1.begin(115200);
    delay(10);
    Serial.begin(9600);
    delay(10);
    }
    void loop() {
    char x;
    if(Serial1.available())
    {
    x = Serial1.read();
    delay(10);
    Serial.println(x);
    delay(10);
    }
    delay(200);
    }


    uLCD-43D Code (setup stuff ignored):

    var buffer1[100];
    COM1_RX_pin(PA3);
    COM1_TX_pin(PA2);
    //PA3 = GPIO1
    //PA2 = GPIO2
    com_Mode(8,'N',1,COM1);
    com_SetBaud(COM1,11520);
    com1_Init(buffer1,200,';');

    repeat
    serout1("$");
    pause(1000);
    forever

    The Arduino is still acting as if its not receiving any data.

    The voltage on the PA2 pin in this case read only 2.1V. I tried pulling this voltage up to 3.3V for the Arduino but this didn't work. I then tried using COM0, because I read on here that the TX pin is automatically pulled up to 3.3V. I updated my code accordingly and then hooked the TX pin up to the Arduino. This also did not work. What am I doing wrong here?

    Everything from a hardware perspective is hooked up correctly and I am using the correct pins on both the display adapter and the Arduino.

    Thank you in advance!
    Last edited by ZBrown; 5 March 2021, 11:00 PM.

  • #2
    Good day,

    The PA2 pin of the Diablo16 display cannot be used as the TX pin for serial communication. You can refer to this link Diablo16 Internal Functions: Serial UART Communication Functions to see all the appropriate pins you can use.

    I also attached the sample project for your reference.

    I hope this helps.

    Best regards.
    Attached Files

    Comment


    • #3
      Such a simple fix! Thank you so much for your help, I've got it going now and it works like a charm.

      Comment

      Working...
      X