Newhaven Display Forum

Newhaven Products => Character LCDs => Topic started by: dstover on March 26, 2014, 02:54:10 PM

Title: NHD-C0220BiZ Sometimes Ignoring "Clear Display" Command
Post by: dstover on March 26, 2014, 02:54:10 PM
Hello,

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.

Overview:

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:

Code: [Select]
#define lcdSlave    0x3C
#define lcdCmd      0x00
#define lcdDat      0x40
void lcdInit( void ) {
   waitMS(40);
   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]
   waitMS(300);
   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);
}
Title: Re: NHD-C0220BiZ Sometimes Ignoring "Clear Display" Command
Post by: dstover 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.

Cheers
David
Title: Re: NHD-C0220BiZ Sometimes Ignoring "Clear Display" Command
Post by: Michael_L on March 27, 2014, 05:41:27 PM
Thank you for posting your results!