Author Topic: NHD-C0216CIZ Not Acknowledging  (Read 3464 times)

danbujak

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
    • View Profile
NHD-C0216CIZ Not Acknowledging
« on: January 22, 2015, 02:33:14 PM »
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
« Last Edit: January 22, 2015, 02:45:22 PM by danbujak »

Michael_L

  • Administrator
  • Hero Member
  • *****
  • Posts: 356
  • Karma: 33
    • View Profile
Re: NHD-C0216CIZ Not Acknowledging
« Reply #1 on: January 23, 2015, 09:33:30 AM »
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.

danbujak

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
    • View Profile
Re: NHD-C0216CIZ Not Acknowledging
« Reply #2 on: January 26, 2015, 09:36:36 AM »
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).

Michael_L

  • Administrator
  • Hero Member
  • *****
  • Posts: 356
  • Karma: 33
    • View Profile
Re: NHD-C0216CIZ Not Acknowledging
« Reply #3 on: January 26, 2015, 03:48:46 PM »
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.

danbujak

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
    • View Profile
Re: NHD-C0216CIZ Not Acknowledging
« Reply #4 on: January 26, 2015, 04:37:31 PM »
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.jpg

Michael_L

  • Administrator
  • Hero Member
  • *****
  • Posts: 356
  • Karma: 33
    • View Profile
Re: NHD-C0216CIZ Not Acknowledging
« Reply #5 on: January 29, 2015, 08:06:53 AM »
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.

danbujak

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
    • View Profile
Re: NHD-C0216CIZ Not Acknowledging
« Reply #6 on: February 09, 2015, 11:31:46 AM »
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.

« Last Edit: February 17, 2015, 01:59:27 PM by danbujak »

Michael_L

  • Administrator
  • Hero Member
  • *****
  • Posts: 356
  • Karma: 33
    • View Profile
Re: NHD-C0216CIZ Not Acknowledging
« Reply #7 on: February 23, 2015, 08:16:16 AM »
Try looking at the working code for that display below, and check for any discrepancies within your program:

Code: [Select]
#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);
  }
}

 

NHD-C0216CIZ-FSW-FBW-3V3 unexpected I2C levels

Started by kentavvBoard Character LCDs

Replies: 3
Views: 2486
Last post April 30, 2016, 06:13:19 PM
by perky
NHD-C0216CiZ-FSW-FBW-3V3 with arduino nano

Started by litunBoard Character LCDs

Replies: 4
Views: 332
Last post Today at 08:46:27 AM
by tolikkk
NHD-C0216CiZ-FSW-FBW-3V3 not working

Started by gab_electroBoard Character LCDs

Replies: 1
Views: 874
Last post October 21, 2016, 03:09:51 PM
by Saurabh_B
Using NHD-C0216CiZ-FSW-FBW-3V3 on I2C on Linux

Started by ABSysacomBoard Character LCDs

Replies: 0
Views: 810
Last post November 08, 2016, 03:56:00 PM
by ABSysacom
I2C on NHD-C0216CiZ-FSW-FBW-3V3

Started by SteveSBoard Character LCDs

Replies: 2
Views: 3687
Last post August 19, 2014, 05:37:31 AM
by SteveS