NHD-C0220BiZ-FSW-FBW-3V3M NAKs all odd numberd ASCII characters
I'm trying to understand why only the odd numbered ASCII characters are NAKed (even numbered are ACKed).
10K pull ups on clock and data. Custom board, I2C communications.
Characters are all displayed correctly if I remove the ACK/NAK check completely from the comm layer.
-
I've not heard of this before. Are you sure you are reading the bits correctly? Do you have another one of these displays to test?
0 -
The same thing happens for all 255 characters. A scope dump also shows the NAKs/ACKs.
0 -
How fast are you running your I2C communcation? Can you try slowing it down and testing it again just for troubleshooting? Do you have any other displays to test?
0 -
I'm bit banging (a port of the given example). From the capture it is running about 150K. I did try adding another CLK_LO at every CLK_LO and a CLK_HI at every CLK_HI to run at 50% of my nominal speed. No difference.
static void I2C_out(unsigned char j) //I2C Output
{
// int t=0;
int n;
unsigned char d;
d=j;
for(n=0;n<8;n++){
if((d&0x80)==0x80)
SDA_HI;
else
SDA_LO;
d=(d<<1);
SCL_LO;
SCL_HI;
SCL_LO;
}
SCL_LO;
SCL_HI;
//ignore the ack info for now
//while(SDA_READ==1)
//{
//SCL_LO;
//SCL_HI;
//if (++t>100)
//break;
//}
SCL_LO;
}0 -
Thanks for the information. Do you have any other displays to try? Are the any other devices present on the I2C bus? If so, can you isolate the display? With your current I2C setup, can you communicate with any other devices and receive all ACKs correctly? As I've said I haven't heard of this previously, so it is a new, and fairly odd issue.
Please confirm the above, and if all else fails please either contact quality@newhavendisplay.com to setup an RMA to return the display back to us for analysis. If you prefer a quicker alternative, you may purchase another display from our website or our distributors such as DigiKey or Mouser and run your test again.0 -
I have 3 boards they all exhibit the same problem. The display is the only device on the I2C bus. It is interesting to note that the display seems perfectly happy if I ignore the NAK and if I try to keep reading (waiting for an ACK) it will never supply one. It appears that it thinks things are ok even tho I got a NAK. And all the characters NAKed display fine.
0 -
It seems there is some issue with your software or board. I have just tested this display with an Arduino with the following code, and coded it to not allow for the program to continue if there is no ACK. All characters are displayed properly. See code below:
#include <Wire.h>
int RES = 22;
int ASDA = 20;
int ASCL = 21;
unsigned char text1[]={" Newhaven Display "};
unsigned char text2[]={"____NHD-C0220BiZ____"};
unsigned char text3[]={" May 28, 2015 "};
unsigned char text4[]={" Michael LaVine "};
unsigned char text5[]={"ACK TEST -- 11111111"};
const char slave2w = 0x3C; //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<20;n++)
{
Wire.write(*text);
++text;
}
while(Wire.endTransmission());
}
void nextline(void)
{
Wire.beginTransmission(slave2w);
Wire.write(comsend);
Wire.write(line2);
while(Wire.endTransmission());
}
void cleardisplay(void)
{
Wire.beginTransmission(slave2w);
Wire.write(comsend);
Wire.write(0x01);
while(Wire.endTransmission());
}
void CiZ_init()
{
Wire.beginTransmission(slave2w);
Wire.write(comsend);
Wire.write(0x39);
delay(1);
Wire.write(0x14);
Wire.write(0x70);
Wire.write(0x5E);
Wire.write(0x6D);
Wire.write(0x0C);
Wire.write(0x01);
Wire.write(0x06);
while(Wire.endTransmission());
}
void setup()
{
pinMode(RES, OUTPUT);
pinMode(ASCL, OUTPUT);
pinMode(ASDA, OUTPUT);
digitalWrite(RES, HIGH);
//delay(10);
//digitalWrite(ASCL, LOW);
//digitalWrite(ASDA, LOW);
//delay(10);
Wire.begin();
delay(10);
CiZ_init();
delay(5);
}
void loop()
{
show(text5);
nextline();
show(text2);
delay(1500);
cleardisplay();
delay(2);
show(text3);
nextline();
show(text4);
delay(1500);
cleardisplay();
delay(2);
}Note - the Wire.endTransmission() function will only return a 0 if it receives an ACK.
0
Please sign in to leave a comment.
Comments
7 comments