Announcement

Collapse
No announcement yet.

No Communication between Arduino and gen4-uLCD-28DT-AR

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

  • No Communication between Arduino and gen4-uLCD-28DT-AR

    Hello,
    I am new to 4D systems, I have a gen4-uLCD-28DT-AR and corrected it to an UNO Rev 3 via the ribbon cable, the Arduino is connected to the PC on com 3. I have then tried to upload the 'Hello world' sample sketch. However, the screen remains blank.

    To problem solve this I have added a few lines to the code to blink the built-in LED on the Uno, but this only happens when I comment out the line 'Display.gfx_ScreenMode(LANDSCAPE) ;'

    I'm sure that I am doing something wrong or have the wrong setting somewhere and would appreciate any advice.

    regards,
    Rob


    Click image for larger version

Name:	PXL_20210623_161222657.jpg
Views:	232
Size:	3.45 MB
ID:	76181 Click image for larger version

Name:	PXL_20210623_161235366.jpg
Views:	81
Size:	3.17 MB
ID:	76182


    Code:
    [IMG2=JSON]{"data-align":"none","data-size":"full","src":"https:\/\/forum.4dsystems.com.au\/core\/image\/gif;base64,R0lGODlhAQABAPABAP\/\/\/wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw=="}[/IMG2]​​// Define LOG_MESSAGES to a serial port to send SPE errors messages to. Do not use the same Serial port as SPE
    //#define LOG_MESSAGES Serial
    
    %%Display%%.DefineResetLine ; // *Replaced* at compile time with define for reset line connected to the display
    %%Display%%.DefineDisplaySerialx ; // *Replaced* at compile time with define the Serial Port connected to the display
    
    %%Display%%.IncludeSerial_4DLib ; // *Replaced* at compile time with an Include the Serial Library relevant to the display
    %%Display%%.IncludeSerial_Const4D ; // *Replaced* at compile time with an Include the Constants file relevant to the display
    
    %%Display%%.AssignDisplaySerialtoLibrary ; // *Replaced* at compile time with an Assign of the correct Serial port to the correct library
    
    
    // routine to handle Serial errors
    void mycallback(int ErrCode, unsigned char Errorbyte)
    {
    #ifdef LOG_MESSAGES
    const char *Error4DText[] = {"OK\0", "Timeout\0", "NAK\0", "Length\0", "Invalid\0"} ;
    LOG_MESSAGES.print(F("Serial 4D Library reports error ")) ;
    LOG_MESSAGES.print(Error4DText[ErrCode]) ;
    if (ErrCode == Err4D_NAK)
    {
    LOG_MESSAGES.print(F(" returned data= ")) ;
    LOG_MESSAGES.println(Errorbyte) ;
    }
    else
    LOG_MESSAGES.println(F("")) ;
    while (1) ; // you can return here, or you can loop
    #else
    // Pin 13 has an LED connected on most Arduino boards. Just give it a name
    #define led 13
    while (1)
    {
    digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
    delay(200); // wait for a second
    digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
    delay(200); // wait for a second
    }
    #endif
    }
    // end of routine to handle Serial errors
    
    void setup()
    {
    // Ucomment to use the Serial link to the PC for debugging
    // Serial.begin(115200) ; // serial to USB port
    // Note! The next statement will stop the sketch from running until the serial monitor is started
    // If it is not present the monitor will be missing the initial writes
    // while (!Serial) ; // wait for serial to be established
    
    pinMode(RESETLINE, OUTPUT); // Display reset pin
    %%Display%%.Toggle_Reset_On ; // *Replaced* at compile time with correct rest on logic for the attached display
    delay(100); // wait for it to be recognised
    %%Display%%.Toggle_Reset_Off ; // *Replaced* at compile time with correct rest off logic for the attached display
    delay(3000) ; // give display time to startup
    
    // now start display as Serial lines should have 'stabilised'
    %%Display%%.DisplaySerial.Begin_Speed ; // *Replaced* at compile time with command to start the serial port at the correct speed
    Display.TimeLimit4D = 5000 ; // 5 second timeout on all commands
    Display.Callback4D = mycallback ;
    
    Display.gfx_ScreenMode(LANDSCAPE) ; // change manually if orientation change
    // put your setup code here, to run once:
    
    pinMode(LED_BUILTIN, OUTPUT);
    } // end Setup **do not alter, remove or duplicate this line**
    
    void loop()
    {
    // put your main code here, to run repeatedly:
    Display.txt_FGcolour(random());
    Display.putstr("Hello World\r") ;
    
    digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
    delay(200); // wait for a second
    digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
    delay(200); // wait for a second
    }

  • #2
    Hi,

    Based on the photo you shared, the connection between the display and the 4D Arduino shield is incorrect. The header pins that you are using are for the programmer or alternative power source for larger displays. You can refer to the datasheet to connect your display to Arduino properly: 4D Arduino Adaptor Shield II Datasheet

    Best Regards
    Last edited by Juniel Cruz; 26 June 2021, 11:21 AM.

    Comment

    Working...
    X