Newhaven Display Forum

Newhaven Products => Character LCDs => Topic started by: SteveC on July 14, 2014, 09:24:24 PM

Title: Sample Code Question for NHD‐C0220BiZ‐FS(RGB)‐FBW‐3VM LCD
Post by: SteveC on July 14, 2014, 09:24:24 PM
Hello,

I have a question about the sample code for the  NHD‐C0220BiZ‐FS(RGB)‐FBW‐3VM LCD which follows this text.

My question is why the Function Set with 0x38 and then 0x39?

Also it would be most helpful to have comments on each line of the sample code to better understand how the ST7036 controller actually works.

Thanks for any help with my understanding.

Best Regards,

SteveC

/****************************************************
*           Initialization For ST7036i              *
*****************************************************/
void init_LCD()
{
I2C_Start();
I2C_out(Slave);
I2C_out(Comsend);
I2C_out(0x38);
delay(10);
I2C_out(0x39);
delay(10);
I2C_out(0x14);
I2C_out(0x78);
I2C_out(0x5E);
I2C_out(0x6D);
I2C_out(0x0C);
I2C_out(0x01);
I2C_out(0x06);
delay(10);
I2C_Stop();
}
Title: Re: Sample Code Question for NHD‐C0220BiZ‐FS(RGB)‐FBW‐3VM LCD
Post by: Michael_L on July 15, 2014, 08:58:43 AM
Sorry for any confusion!  Sometimes the function set command is issued twice to "wake up" the controller, but there is no real significance why it is 0x38 first, and 0x39 after, since the 0x39 overwrites the 0x38.  In any case, the code is meant to be used as an example of how to get the display up and running, and is not meant to serve as the only, or even optimal, way of initializing the display for every application.  Do you have the display working?  Also, I agree, comments are always helpful.  Much of our example code is commented, but unfortunately not all.  If you are curious about these particular commands, you may refer to the ST7036 datasheet, here:
http://www.newhavendisplay.com/app_notes/ST7036.pdf (http://www.newhavendisplay.com/app_notes/ST7036.pdf)
Pages 26 & 27 will show the table of commands, and pages 28 - 35 will explain each one in detail.
Title: Re: Sample Code Question for NHD‐C0220BiZ‐FS(RGB)‐FBW‐3VM LCD
Post by: SteveC on July 31, 2014, 08:44:29 PM
Hello,

Thank you for the post explaining the function set command. I have the LCD basically working but I'm now trying to blink a particular character. I believe I have a solution but it will take me a few days to implement. Thank you for your suggestions.