NHD-C0216CIZ Not Acknowledging
I have 2 identical boards with the same hardware and same firmware I received back from PCB assembly house. They both pass electrical testing, yet the LCD display wont work on one and it will work on the other. I've tried playing around with the pull-ups, the timing, etc. but the one refuses to ACK. Please let me know what I can try to debug this.
10kOhm pull ups
20kHz I2C speed
I've attached a capture of the waveform and two scope captures.
Bad Part NACKing address:
http://i.imgur.com/CmqhVA3.jpg
Good Part ACKing random command:
http://i.imgur.com/jjQJOza.jpg
-
You mention you are using 10kΩ pull-ups, but your schematic shows different. Can you confirm if you have 10kΩ pull-ups? Please also ensure all soldering is good and you have connectivity to all signals.
0 -
Yes, the resistors have been changed to 10k after reading this forum. All the other pins and connections are good (measure the same as the other board).
0 -
Since you have one board that works with the display and software used, and another board that doesn't, it seems to be some issue with the second board. Perhaps the solder flow isn't perfect on the non-working board. If you are looking to debug this issue, that is where I would start.
0 -
After more debugging, I have noticed the LCD does occasionally initialize, but very rarely. I've also jumper-wired a second display in parallel with the failing board and that display initializes consistently so it is not a board issue.
http://i.imgur.com/Fc4MR53.jpg0 -
Have you checked your timing? Sometimes if you are near the timing threshold on a display, you will get inconsistent results. Please make sure you are allowing enough execution time for each command in the initialization. You can see the execution times listed on page 7 of the display's datasheet. You will notice the clear display and return home commands have longer execution times than the other commands (1.08ms). Please verify this, and if you are unsure you can try adding delays after each command send.
0 -
Hi, the timing is bang on, and I don' t think it's a delay issue since the very first command I send is NACKing. That being said I've added more delays and still see the same issue.
0 -
Try looking at the working code for that display below, and check for any discrepancies within your program:
#include <Wire.h>
int RES = 22;
int ASDA = 20;
int ASCL = 21;
int test = 55;
unsigned char text1[]={"Newhaven Display"};
unsigned char text2[]={" I2C TEST "};
unsigned char text3[]={" Feb. 3 2015 "};
unsigned char text4[]={" Michael LaVine "};
const char slave2w = 0x3E; //3E for CiZ (0x7C shifted over 1 bit) //3C for BiZ (0x78 shifted over 1 bit)
const char comsend = 0x00;
const char datasend = 0x40;
const char line2 = 0xC0;
void show(unsigned char *text)
{
int n, d;
d=0x00;
Wire.beginTransmission(slave2w);
Wire.write(datasend);
for(n=0;n<16;n++)
{
Wire.write(*text);
++text;
}
Wire.endTransmission();
}
void nextline(void)
{
Wire.beginTransmission(slave2w);
Wire.write(comsend);
Wire.write(line2);
Wire.endTransmission();
}
void CGRAM(void)
{
Wire.beginTransmission(slave2w);
Wire.write(comsend);
Wire.write(0x38);
Wire.write(0x40);
Wire.endTransmission();
delay(10);
Wire.beginTransmission(slave2w);
Wire.write(datasend);
Wire.write(0x00);
Wire.write(0x1E);
Wire.write(0x18);
Wire.write(0x14);
Wire.write(0x12);
Wire.write(0x01);
Wire.write(0x00);
Wire.write(0x00);
Wire.endTransmission();
}
void CiZ_init()
{
Wire.beginTransmission(slave2w);
Wire.write(comsend);
Wire.write(0x38);
delay(10);
Wire.write(0x39);
delay(10);
Wire.write(0x14);
Wire.write(0x70);
Wire.write(0x5E);
Wire.write(0x6D);
Wire.write(0x0C);
Wire.write(0x01);
Wire.write(0x06);
Wire.endTransmission();
CGRAM();
Wire.beginTransmission(slave2w);
Wire.write(comsend);
Wire.write(0x39);
Wire.write(0x01);
test = Wire.endTransmission();
Wire.endTransmission();
if(test!=0)
{
while(1)
{
delay(100);
}
}
delay(10);
}
void setup()
{
pinMode(RES, OUTPUT);
pinMode(ASCL, OUTPUT);
pinMode(ASDA, OUTPUT);
digitalWrite(RES, HIGH);
delay(10);
digitalWrite(ASCL, LOW);
digitalWrite(ASDA, LOW);
delay(10);
delay(10);
//CiZ_init();
//delay(5);
}
void loop()
{
Wire.begin();
//TWBR = 12;
//TWSR |= _BV(TWPS0);
while(1)
{
CiZ_init();
show(text1);
nextline();
show(text2);
delay(1000);
CiZ_init();
show(text3);
nextline();
show(text4);
delay(1000);
}
}0
Please sign in to leave a comment.
Comments
7 comments