UDOO Neo + 4D Systems gen4-28PT Touch display (over UART / Serial0) : Not working.

Discussion in 'UDOO NEO' started by DenisZ, Oct 1, 2020.

  1. DenisZ

    DenisZ New Member

    Joined:
    Oct 1, 2020
    Messages:
    2
    Likes Received:
    0
    Hi everyone,

    I am a new user of UDOO Neo.

    I am using a 4D Systems Touch display gen4-28PT and here tool Workshop 4 option Visi-Genie, for drawing my Forms. The screen communicates in UART on Pin 0 and 1.

    The test project is simple. 2 Forms, some buttons, LED digits and a text area. Nothing particular on screen.


    The Arduino code I'm using is as follows:

    #include <genieArduino.h>

    Genie genie;

    #define LED_BUILTIN 13

    unsigned long waitPeriod = 200L;


    void setup() {
    pinMode(LED_BUILTIN, OUTPUT);

    Serial0.begin(115200); // For UDOO Neo Serial0 = UART on pin 0 and 1 // For UNO I change it to "Serial".
    Serial0.available();
    genie.Begin(Serial0);
    genie.AttachEventHandler(myGenieEventHandler);

    }


    void loop() {
    genie.DoEvents();

    if (millis() >= waitPeriod)
    {
    // Ensure that this code block only runs after ~100ms
    waitPeriod = millis() + 100;
    }
    }


    // 4D Systems Event Handler.
    void myGenieEventHandler(void) {
    genieFrame Event;
    genie.DequeueEvent(&Event);


    if (Event.reportObject.cmd == GENIE_REPORT_EVENT)
    {
    if (Event.reportObject.object == GENIE_OBJ_WINBUTTON)
    {

    // "WinButton0".
    if (Event.reportObject.index == 0) // Index 0 du bouton.
    {
    digitalWrite(LED_BUILTIN, HIGH); // turn the LED on.
    genie.WriteObject(GENIE_OBJ_USER_LED, 0, 50);
    genie.WriteObject(GENIE_OBJ_FORM, 1, 0);
    }

    // "WinButton1".
    if (Event.reportObject.index == 1) // Index 0 du bouton.
    {
    digitalWrite(LED_BUILTIN, LOW); // turn the LED off.
    genie.WriteObject(GENIE_OBJ_USER_LED, 0, 30);
    genie.WriteObject(GENIE_OBJ_FORM, 1, 0);
    }

    }
    }
    }

    The observation is that the project works fine on an Arduino UNO, but not on a UDOO Neo and I don't see where the problem is.

    I see that there is an exchange, because by pressing the buttons on the screen I manage to turn LED 13 on and off. But, when I send the instruction to change FORM or to display a DIGIT LED another value ... then nothing happens.

    I tested the UART of the UDOO Neo, it's sending data. I checked the speed, the rate, etc ... everything seems fine.


    Does anyone in the community have any experience with 4D Systems Touch Screens, any idea where the problem can be?

    Best regards.
     
  2. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,312
    Likes Received:
    580
    You will have to check to genieArduino library you are using. Something will be wrong there.
    Are you not getting any errors?
     
  3. DenisZ

    DenisZ New Member

    Joined:
    Oct 1, 2020
    Messages:
    2
    Likes Received:
    0
    Hi Waltervl,

    After a lot of research on various forums, I discovered that the serial port (Serial0 on Pin 0 and 1) of the UDOO card does not support the sequence "0x00". It causes a kind of "crash" of the communication at the level of the buffer of the serial port.
    However, this character is widely used in the 4D protocol.
    There is therefore an incompatibility between the two products. I will certainly have to fall back on a touch screen from another manufacturer. Except, if there is a way to get around this while using the Visi-Genie libraries.

    Best regards.
     
  4. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,312
    Likes Received:
    580

Share This Page