Author Topic: NHD-C0220BiZ-FSW-FBW-3V3M I2C not working.  (Read 2339 times)

fraryb

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
    • View Profile
NHD-C0220BiZ-FSW-FBW-3V3M I2C not working.
« on: May 06, 2015, 08:53:00 AM »
Having problem getting display to respond to I2C commands.  Changed pullups over range from 27k down to 4.7k ohms and over 400kHz down to 10kHz without success. Can get response to enumeration query only when 3.3 volt supply is removed (open circuit).  Using generic I2C arduino code as well as that from datasheet.  Any help will be greatly appreciated.

Paul_B

  • Administrator
  • Sr. Member
  • *****
  • Posts: 247
  • Karma: 16
    • View Profile
Re: NHD-C0220BiZ-FSW-FBW-3V3M I2C not working.
« Reply #1 on: May 06, 2015, 10:32:35 AM »
Hello Fraryb,

Below is some example code for that display written for the Arduino  ;)

Code: [Select]
#include <Wire.h>

int RES = 22;
int ASDA = 20;
int ASCL = 21;

unsigned char text1[]={"  Newhaven Display  "};
unsigned char text2[]={" Clear Display Test "};
unsigned char text3[]={"   March 27, 2014   "};
unsigned char text4[]={"   Michael LaVine   "};

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;
  }
  Wire.endTransmission();
}

void nextline(void)
{
  Wire.beginTransmission(slave2w);
  Wire.write(comsend);
  Wire.write(line2);
  Wire.endTransmission();
}

void cleardisplay(void)
{
  Wire.beginTransmission(slave2w);
  Wire.write(comsend);
  Wire.write(0x01);
  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);
  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(text1);
  nextline();
  show(text2);
  delay(1500);
  cleardisplay();
  delay(2);

  show(text3);
  nextline();
  show(text4);
  delay(1500);
  cleardisplay();
  delay(2);
}

Finally double check that your connections are correct, see page 4 in the displays datasheet.

http://www.newhavendisplay.com/specs/NHD-C0220BiZ-FSW-FBW-3V3M.pdf

Please keep us posted on your progress!
« Last Edit: May 06, 2015, 10:36:20 AM by Paul_B »

 

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

Started by Ticoti0xFFBoard Character LCDs

Replies: 1
Views: 2676
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: 1710
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: 3
Views: 4363
Last post May 13, 2014, 12:04:36 AM
by SteveC
NHD‐C0220BiZ‐FS(RGB)‐FBW‐3VM - Cable for LED Backlights

Started by wadehBoard Character LCDs

Replies: 2
Views: 755
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: 2893
Last post July 31, 2014, 08:44:29 PM
by SteveC