Author Topic: NHD-C0220BiZ-FSW-FBW-3V3M NAKs all odd numberd ASCII characters  (Read 3855 times)

majorninth

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
    • View Profile
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.

Michael_L

  • Administrator
  • Hero Member
  • *****
  • Posts: 356
  • Karma: 33
    • View Profile
Re: NHD-C0220BiZ-FSW-FBW-3V3M NAKs all odd numberd ASCII characters
« Reply #1 on: May 28, 2015, 07:31:56 AM »
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?

majorninth

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
    • View Profile
Re: NHD-C0220BiZ-FSW-FBW-3V3M NAKs all odd numberd ASCII characters
« Reply #2 on: May 28, 2015, 01:22:04 PM »
see attached logic analyzer screen dump. The same thing happens for all 255 characters. A scope dump also shows the NAKs/ACKs.

Michael_L

  • Administrator
  • Hero Member
  • *****
  • Posts: 356
  • Karma: 33
    • View Profile
Re: NHD-C0220BiZ-FSW-FBW-3V3M NAKs all odd numberd ASCII characters
« Reply #3 on: May 28, 2015, 02:52:28 PM »
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?

majorninth

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
    • View Profile
Re: NHD-C0220BiZ-FSW-FBW-3V3M NAKs all odd numberd ASCII characters
« Reply #4 on: May 28, 2015, 03:14:02 PM »
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;
}


Michael_L

  • Administrator
  • Hero Member
  • *****
  • Posts: 356
  • Karma: 33
    • View Profile
Re: NHD-C0220BiZ-FSW-FBW-3V3M NAKs all odd numberd ASCII characters
« Reply #5 on: May 28, 2015, 04:10:53 PM »
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.

majorninth

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
    • View Profile
Re: NHD-C0220BiZ-FSW-FBW-3V3M NAKs all odd numberd ASCII characters
« Reply #6 on: May 28, 2015, 04:26:46 PM »
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.

Michael_L

  • Administrator
  • Hero Member
  • *****
  • Posts: 356
  • Karma: 33
    • View Profile
Re: NHD-C0220BiZ-FSW-FBW-3V3M NAKs all odd numberd ASCII characters
« Reply #7 on: May 28, 2015, 04:51:31 PM »
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:

Code: [Select]
#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.

 

NHD‐C0220BiZ‐FS(RGB)‐FBW‐3VM capacitor on pin 7&8

Started by Ticoti0xFFBoard Character LCDs

Replies: 1
Views: 2807
Last post April 09, 2014, 10:17:30 AM
by Michael_L
NHD‐C0220BiZ‐FS(RGB)‐FBW‐3VM Potting

Started by SebKisterBoard Character LCDs

Replies: 1
Views: 1834
Last post June 22, 2016, 04:51:17 PM
by Saurabh_B
Blank Display on NHD‐C0220BiZ‐FS(RGB)‐FBW‐3VM

Started by SteveCBoard Character LCDs

Replies: 7
Views: 4595
Last post Today at 12:52:50 PM
by tolikkk
NHD‐C0220BiZ‐FS(RGB)‐FBW‐3VM - Cable for LED Backlights

Started by wadehBoard Character LCDs

Replies: 2
Views: 868
Last post December 02, 2016, 06:02:27 PM
by wadeh
Sample Code Question for NHD‐C0220BiZ‐FS(RGB)‐FBW‐3VM LCD

Started by SteveCBoard Character LCDs

Replies: 2
Views: 3028
Last post July 31, 2014, 08:44:29 PM
by SteveC