Author Topic: Sample Code Question for NHD‐C0220BiZ‐FS(RGB)‐FBW‐3VM LCD  (Read 3116 times)

SteveC

  • Newbie
  • *
  • Posts: 7
  • Karma: 1
    • View Profile
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();
}

Michael_L

  • Administrator
  • Hero Member
  • *****
  • Posts: 356
  • Karma: 33
    • View Profile
Re: Sample Code Question for NHD‐C0220BiZ‐FS(RGB)‐FBW‐3VM LCD
« Reply #1 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
Pages 26 & 27 will show the table of commands, and pages 28 - 35 will explain each one in detail.

SteveC

  • Newbie
  • *
  • Posts: 7
  • Karma: 1
    • View Profile
Re: Sample Code Question for NHD‐C0220BiZ‐FS(RGB)‐FBW‐3VM LCD
« Reply #2 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.

 

NHD-C0220BiZ Sometimes Ignoring "Clear Display" Command

Started by dstoverBoard Character LCDs

Replies: 2
Views: 3866
Last post March 27, 2014, 05:41:27 PM
by Michael_L
NHD-C0220BiZ-FSW-FBW-3V3M NAKs all odd numberd ASCII characters

Started by majorninthBoard Character LCDs

Replies: 7
Views: 3991
Last post May 28, 2015, 04:51:31 PM
by Michael_L
NHD-C0220Biz-FSW adds character 0x11 at begining of line

Started by whAtlGaBoard Character LCDs

Replies: 3
Views: 1553
Last post July 11, 2016, 08:20:40 AM
by Saurabh_B
NHD-C0220BiZ- Series 2x20 Display mounting on PCB

Started by m.sankarBoard Character LCDs

Replies: 3
Views: 4461
Last post March 24, 2014, 08:08:00 AM
by Michael_L
NHD-C0220BiZ-FSW-FBW-3V3M Problem -- Doesn't power on

Started by seilcompBoard Character LCDs

Replies: 6
Views: 3188
Last post December 10, 2015, 08:07:52 AM
by Paul_B