Sample Code Question for NHD‐C0220BiZ‐FS(RGB)‐FBW‐3VM LCD
Hello,
I have a question about the sample code for the NHD‐C0220BiZ‐FS(RGB)‐FBW‐3VM LCD:
/****************************************************
* 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();
}
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
-
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:
https://newhavendisplay.com/content/app_notes/ST7036.pdf
Pages 26 & 27 will show the table of commands, and pages 28 - 35 will explain each one in detail.0 -
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.0
Please sign in to leave a comment.
Comments
2 comments