No announcement yet.

Issue with Leonardo and uLCD-35DCT-CLB connectivity

  • Filter
  • Time
  • Show
Clear All
new posts

  • Issue with Leonardo and uLCD-35DCT-CLB connectivity

    Having an issue with hard wiring a custom Leonardo board that has integrated can bus. All my testing has been with a UNO stacked with a can bus shield and the 4D shield. With this stacked setup all works well. When I switch over to the Leo and hard wire to LCD I just cannot get it to talk to the display. Without writing an essay I will try and articulate what has been tested with just some basic test code.
    • UNO with stacked Can Bus and 4D shield - Works
    • UNO with stacked Can Bus and wired 4D shield ie: loose 5 wires - Works
    • Leo with 4D shield wired +ve, gnd, tx, rx, reset to D4 - Doesn't Work
    • Leo direct to LCD wired +ve, gnd, tx, rx, reset to D4 (1k 0.5w resister in path and digitalWrite(RESETLINE, X) flipped - Doesn't work
    • Flip TX, RX just in case - Doesn't Work
    • No serial print statements
    • Using the gen4-IB board
    • Tested different baud rates 9600, 115,200 (set both in code and 4D)
    • When checking serial monitor with no serial prints I get the random ascii txt as expected
    • If I run my Can Bus code without 4D and send data to Serial instead - Works
    Link to Leo board being used:

    I'm at a total loss and hoping I just over looking something simple. Thanks in advance.

    Sample Code:

    #include <Arduino.h>                        // Arduino Library
    #include <genieArduino.h>                   // 4D Systems Screen Library
    void myGenieEventHandler(void);
    Genie genie;
    #define RESETLINE 4                         // Sets the 4D Reset PIN
    void setup() {
        genie.AttachEventHandler(myGenieEventHandler);  // Attach the user function Event Handler for processing events
        pinMode(RESETLINE, OUTPUT);                     // Set D4 on Arduino to Output (4D Arduino Adaptor V2 - Display Reset)
        digitalWrite(RESETLINE, 1);                     // Reset the Display via D4
        digitalWrite(RESETLINE, 0);                     // unReset the Display via D4
        delay (5000);                                   // Let the display start up after the reset (This is important as it syncs the screen)
        genie.WriteContrast(12);                        // For uLCD-35DT, use 0-15 for Brightness Control, where 0 = Display OFF, though to 15 = Max Brightness ON.  
        genie.WriteObject(GENIE_OBJ_FORM, 0, 0);        // Set form to form 0 ie: first form
    void loop() {
        genie.DoEvents();                               // This calls the 4D library each loop to process the queued responses from the display
        for (int i = 0; i < 1000; i++) {
              genie.WriteObject(GENIE_OBJ_LED_DIGITS, 0, i);
              // Serial.print("What is i ");
              // Serial.println(i);  
    Last edited by MR RIZK; 1 February 2019, 07:46 AM.

  • #2

    Just to be Clear, this should be your wiring connections when hardwiring your MCU to your Display.

    Display 5v ---------------------------> Leonardo 5v
    Display Tx --------------------------> Leonardo Rx
    Display Rx --------------------------> Leonardo Tx
    Display Gnd ------------------------> Loenardo Gnd
    Display Reset --10K resistor--> Leonardo D4

    Also, you've mentioned that you were able to use a 4D shield with your MCU.

    Leo with 4D shield wired +ve, gnd, tx, rx, reset to D4 - Doesn't Work
    Looking at the link you sent, it appears that it has a different form factor to the Arduino UNO, this means that the 4D-Arduino-Adaptor Shield is incompatible with this.

    Would you be able to provide a photo of this hard-wired setup?

    Best Regards,



    • #3
      Hey Michael, will get some photos tonight but to confirm what you have provided.

      Display 5v ---------------------------> Leonardo 5v - YES
      Display Tx --------------------------> Leonardo Rx - YES (ie TX > RX)
      Display Rx --------------------------> Leonardo Tx - YES (ie RX > TX)
      Display Gnd ------------------------> Loenardo Gnd - YES
      Display Reset --10K resistor--> Leonardo D4 - YES however with 1k not 10k resistor as per app note 4D-AN-00017_R_1_01

      Can you confirm if i need a 1k or 10k

      Leo with 4D shield wired +ve, gnd, tx, rx, reset to D4 - Doesn't Work
      Yes you are correct about the form factor however I used fly cables to connect the shield to the LEO. I was wiring the shield with fly leads to see if the shield was doing something funky to get the display to work instead of direct from LEO to 4D
      Last edited by MR RIZK; 1 February 2019, 03:58 PM.


      • #4

        From my perspective, it looks like you are not using the correct code for the serial port on a Leonardo.

        The Arduino Leonardo board uses Serial1 to communicate via TTL (5V) serial on pins 0 (RX) and 1 (TX). Serial is reserved for USB CDC communication. For more information, refer to the Leonardo getting started page and hardware page.
        Have you tried using Serial1 instead of Serial in both your begin statements?



        • #5
          James, thanks for that. Pretty much at the same time I found your post from 2015 at

          Anyway, tested my demo code and subsequently my real code and work as expected.

          So just to clarify do I use a 1k or 10k resistor?


          • #6
            1K, although it shouldn't really matter too much

            Page 23 and 34