Author Topic: NHD-C0220BiZ Sometimes Ignoring "Clear Display" Command  (Read 8548 times)


  • Newbie
  • *
  • Posts: 2
  • Karma: 1
    • View Profile
NHD-C0220BiZ Sometimes Ignoring "Clear Display" Command
« on: March 26, 2014, 02:54:10 PM »

I'm communicating with the C0220BiZ through its I2C interface, and having a problem with the "Clear Display" (chip 0x3C (7-bit), register 0x00, data 0x01) command executing consistently. Subsequent I2C writes to data (0x40) append text to the existing contents of DDRAM, as though the Clear command were never received.

I would greatly appreciate any thoughts on why this is happening. I'm willing to provide more scope captures or run further tests if that helps remove entropy from the discussion.

  • My I2C commands appear well-formed (see attached oscope grabs).
  • My I2C master doesn't sense a NACK or time out (it would set a sticky flag in my debugger, which it has not done).
  • Slowly stepping through my program proves that it is not a matter of wait time between transmissions; I have observed persistent text after oscope confirmation that a Clear Display command was sent and the LCD did ACK all frames.

Program notes:
My test program initializes the display as per the ST7036 datasheet (see code below), and loops through a simple clear-write-wait routine:
  • The clear function waits 2 ms after transmission, before allowing data to be written to the display. In fact, all writes to the command register (0x40) wait 2 ms after transmitting.
  • Writes to the command register are formed as single I2C writes (start/chip/reg/data/stop for each instruction).
  • Writing data to the display is formed as a repeated write (same concept as sample code from the Newhaven datasheet).
  • A wait time of 100 ms is issued after writing data to the display, before looping back to the Clear Display command

Code: [Select]
#define lcdSlave    0x3C
#define lcdCmd      0x00
#define lcdDat      0x40
void lcdInit( void ) {
   lcdWriteCmd(0x38); // Function Set:: 8b; 2Line; SingleHeight; InstrTable 00b
   lcdWriteCmd(0x39); // Function Set:: 8b; 2Line; SingleHeight; InstrTable 01b
   lcdWriteCmd(0x14); // Bias Set:: 1/5 bias
   lcdWriteCmd(0x78); // Contrast Set:: C[3:0] is data[3:0]
   lcdWriteCmd(0x5E); // Pwr/Contrast Set:: ICON.on; Boost.on; C[5:4] = data[1:0]
   lcdWriteCmd(0x6D); // Follower Control:: Follower.on; ratio = data[2:0]
   lcdWriteCmd(0x0C); // Display:: Display on, cursor off
   lcdWriteCmd(0x01); // Clear Display
   lcdWriteCmd(0x06); // Entry Mode Set:: Cursor.incrementDirection; Shift.disabled
void lcdWriteCmd( u8 outCmd ) {
   i2cMasterWrite(lcdSlave, lcdCmd, outCmd);

[attachment deleted by admin]


  • Newbie
  • *
  • Posts: 2
  • Karma: 1
    • View Profile
Re: NHD-C0220BiZ Sometimes Ignoring "Clear Display" Command
« Reply #1 on: March 26, 2014, 07:20:30 PM »
Found a solution. Making a note for those who might run into a similar issue.

My I2C master was running in fast mode (400KHz) which this device only supports at voltages of 4.5 < VDD < 5.5. My device was running at a standard 3.3V.

I fixed my problem by recoding my I2C master to run at 200KHz (max is 300KHz with a 25/75% SCL duty cycle, 200KHz with 50/50), but could have just as easily green-wire'd VDD above 4.5V.



  • Administrator
  • Hero Member
  • *****
  • Posts: 357
  • Karma: 34
    • View Profile
Re: NHD-C0220BiZ Sometimes Ignoring "Clear Display" Command
« Reply #2 on: March 27, 2014, 05:41:27 PM »
Thank you for posting your results!


Display NHD-4.3-480272EF-ASXN#-T and NHD-4.3-480272EF-ASXN#-T revA

Started by rvalorBoard TFTs

Replies: 1
Views: 1892
Last post April 25, 2019, 03:35:10 PM
by Ted_M
NHD‐C12864A1Z‐FSW‐FBW‐HTT display clears after draw

Started by EdAverillBoard Graphic LCDs

Replies: 6
Views: 14352
Last post November 07, 2014, 08:25:20 AM
by Michael_L
NHD‐4.3‐480272EF‐ATXL#‐CTP | FAN5333 | BBB | Nothing on the Display

Started by Alias_AliasBoard TFTs

Replies: 1
Views: 10711
Last post September 25, 2015, 03:09:24 PM
by Paul_B
Arduino LCD library not working with newhaven display NHD‐0420H1Z‐FL‐GWB-3V3

Started by c2hollowBoard Character LCDs

Replies: 9
Views: 21477
Last post July 10, 2014, 08:46:06 AM
by Michael_L
Optical bonding Display to cover glass (dry film bonding)

Started by fourtraxBoard TFTs

Replies: 1
Views: 4908
Last post September 29, 2016, 08:35:00 AM
by Saurabh_B