LCD2041 Splash Screen

LK/ELK/VK/PK/OK/MX/GLK/EGLK/GVK/GLT Series

Moderators: Henry, Mods

Post Reply
kvqvx
LCD?
Posts: 6
Joined: Sun Mar 03, 2013 7:07 pm

LCD2041 Splash Screen

Post by kvqvx »

Hello,

I received my LCD2041 earlier this week, and when I plugged it into a 5V power source, I got the following splash screen.

Image

Are the characters located in the first 8 positions in the first row part of the splash screen? If not, is my part faulty? They appear one after another. This problem goes away when I unplug the unit and plug it back into the power source, yet can be replicated on occasion.

kvqvx
LCD?
Posts: 6
Joined: Sun Mar 03, 2013 7:07 pm

Re: LCD2041 Splash Screen

Post by kvqvx »

After spending some time getting acquainted with my new LCD, I found that the character shown on the first row is the cursor. How do I hide the cursor by default?

Clark
Matrix Orbital
Matrix Orbital
Posts: 881
Joined: Fri Aug 17, 2007 10:58 am
Location: Matrix Orbital
Contact:

Re: LCD2041 Splash Screen

Post by Clark »

Hi kvqvx,

The repeated character at the top left of your display is the first custom character used in our logo. If it only appears intermittently, it is likely not saved as part of the start screen, but the result of the value 0 being sent to the display. Please check your code and cable to determine the cause of this value occasionally being sent.

As for turning the cursor on and off, you can check out your manual for the raw commands or use our uProject GUI to make the desired changes.

Thanks,
Troy
Troy Clark
Design & Development
Matrix Orbital

kvqvx
LCD?
Posts: 6
Joined: Sun Mar 03, 2013 7:07 pm

Re: LCD2041 Splash Screen

Post by kvqvx »

Thank you for your answer Clark,

The character shows up wherever I place my cursor and don't write anything to that space. If I were to write a string of letters, this special character would show up at the end of my letter string uninvited.

I have a completely unrelated issue now, inbetween power cycles, my code did not change, but the text on the screen has completely changed. Here is a copy of my code:

Code: Select all

#include "mbed.h"

char splash[] = //splash screen string
{
    254, 88, //clear screen
    254, 82, //auto scroll off
    254, 71, 4, 2, //set cursor column 4, row 2
    70, 111, 114, 109, 117, 108, 97, 32, 72, 121, 98, 114, 105, 100, //print "Formula Hybrid"
};

char data[] = //data screen initialization string
{
    254, 88, //clear screen
    254, 72, //set cursor home
    83, 112, 101, 101, 100, 32, 32, 32, 32, 32, 32, 58, //print "Speed: "
    254, 71, 1, 2, //set curser to column 1, row 2
    73, 67, 69, 32, 84, 101, 109, 112, 32, 32, 32, 58, 32, 32, 32, 32, 32, 32,//print "ICE Temp: "
    254, 71, 1, 3, //set curser to column 1, row 3
    72, 86, 32, 66, 97, 116, 116, 101, 114, 121, 32, 32, 32, 32, 32, 58, //print "HV Bat: "
    254, 71, 1, 4, //set curser to column 1, row 4
    70, 117, 101, 108, 32, 76, 101, 118, 101, 108, 32, 58 //print "Fuel Level: "
};
 
int main() 
{
    Serial lcd(p9, p10); // tx, rx
    lcd.baud(19200);
    
    for(int i = 0; i <= sizeof(splash); ++i)
    {
        lcd.putc(splash[i]);
        wait(0.05);
    }
    
    wait(5);
    
    for(int j = 0; j <= sizeof(data); ++j)
    {
        lcd.putc(data[j]);
        wait(0.001);
    }
}
Here is what I see on the LCD:

Image

After the 5 second delay:

Image

Thanks

Clark
Matrix Orbital
Matrix Orbital
Posts: 881
Joined: Fri Aug 17, 2007 10:58 am
Location: Matrix Orbital
Contact:

Re: LCD2041 Splash Screen

Post by Clark »

Not a problem kvqvx,

I appreciate the code provided, and from the images attached it looks like you're having trouble with your write function.

It is possible that the baud rate of the unit may have been changed inadvertently, please try the override procedure in your manual to temporarily reset the unit to 19200 baud. Then look into implementing the Change Baud Rate command to permanently reset the unit.

Other things you might consider are using the unsigned char type due to the high byte values of our commands and investigating those for loops to ensure the last iteration does not address an index outside the bounds of your array. Overall, your implementation looks good, but you might consider checking out our C++ application note for additional ideas.

Thanks,
Troy
Troy Clark
Design & Development
Matrix Orbital

kvqvx
LCD?
Posts: 6
Joined: Sun Mar 03, 2013 7:07 pm

Re: LCD2041 Splash Screen

Post by kvqvx »

Thanks again,

Once I get communication up, is it good practice to manually write the baud rate in my code initialization?

Clark
Matrix Orbital
Matrix Orbital
Posts: 881
Joined: Fri Aug 17, 2007 10:58 am
Location: Matrix Orbital
Contact:

Re: LCD2041 Splash Screen

Post by Clark »

No worries kvqvx,

The baud rate will be saved in your unit, you will not need to set it in your initialization code.

Change Baud Rate, along with any other command that is remembered always or when remember is turned on, preforms a write to a non-volatile EERPROM location. The EEPROM has a 100,000 write limit, so it is recommended that you only save settings when necessary.

If you are worried about inadvertent changes to your unit and are unable to find the cause in your code, you might investigate the Set and Save Data Lock command in your manual to prevent any changes to specific settings.

Thanks,
Troy
Troy Clark
Design & Development
Matrix Orbital

kvqvx
LCD?
Posts: 6
Joined: Sun Mar 03, 2013 7:07 pm

Re: LCD2041 Splash Screen

Post by kvqvx »

I have resolved the communication problem. I have having another problem now. When I run my code, no matter what I put on the screen, the cursor randomly puts characters that look like the ones in the first post in this thread. What are they and how do I get rid of them?

Clark
Matrix Orbital
Matrix Orbital
Posts: 881
Joined: Fri Aug 17, 2007 10:58 am
Location: Matrix Orbital
Contact:

Re: LCD2041 Splash Screen

Post by Clark »

Hi kvqvx,

If you are seeing the first custom character used in the default start screen, as shown in the very first image in this post, the display is receiving a value of 0. I would recommend stepping through your code to determine where a value of 0 is being sent.

Check data types to make sure you are not sending an integer when the display expects a byte and that your strings are not sent with an automatic null terminator. Finally, make sure array bounds are not being overrun. Unfortunately, I can only give you ideas of where to look, you'll have to step through your code to determine the root cause of this behaviour.

Thanks,
Troy
Troy Clark
Design & Development
Matrix Orbital

Post Reply