Author Topic: NHD-C0220Biz and Arduino/Teensy3.1  (Read 51621 times)

jpatrick62

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
    • View Profile
NHD-C0220Biz and Arduino/Teensy3.1
« on: April 24, 2015, 11:24:07 AM »
Hello, the I2C connection between the C0220Biz and my Teensy3.1 locks up when it is first initialized. Other I2c devices work fine, so I'll assume i am doing something wrong at initialization. Is there a library that will work for a teensy3.1 and a C0220Biz? It looks as if the address is 0x78. I have all the hardware connections as peer the Pin description and wiring diagram, and my supply volage to vdd is 3.3 regulated.  :-\

Michael_L

  • Administrator
  • Hero Member
  • *****
  • Posts: 356
  • Karma: 33
    • View Profile
Re: NHD-C0220Biz and Arduino/Teensy3.1
« Reply #1 on: April 25, 2015, 08:19:42 PM »
I'm sorry but unfortunately we do not have a library for the display with the teensy mcu.  What we do have is the example code provided on our website, here: http://www.newhavendisplay.com/app_notes/NHD-C0220BiZ.txt.
If you come across any libraries for the teensy that are designed to drive an ST7036 display controller, they should work for our display.
As for your other question, is the display the only device present on the i2c bus when it is locking up?  Have you tried using 10kOhm pull-ups?
« Last Edit: April 25, 2015, 08:24:24 PM by Michael_L »

jpatrick62

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
    • View Profile
Re: NHD-C0220Biz and Arduino/Teensy3.1
« Reply #2 on: April 27, 2015, 03:41:40 PM »
As for your other question, is the display the only device present on the i2c bus when it is locking up? 
Yes, it is the only I2C device on the bus

Have you tried using 10kOhm pull-ups?
No, but I'll do that - presently we have 47K ohm pull-ups  believe...

jpatrick62

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
    • View Profile
Re: NHD-C0220Biz and Arduino/Teensy3.1
« Reply #3 on: April 27, 2015, 03:47:16 PM »
Actually we presently have 21K ohm pull-ups, but I'll try to swap them out.

jpatrick62

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
    • View Profile
Re: NHD-C0220Biz and Arduino/Teensy3.1
« Reply #4 on: May 06, 2015, 09:43:06 PM »
I have swapped the pullups to 10K and then 2K, still no luck - I2C does not enumerate. I used another LCD I2C Backpack and it did work on I2C as well as other I2C
devices so I know it's not the mp itself. I just want to ensure I have the proper connections - so as I look down on the LCD display, the mechanical drawing seems to
indicate the connections from left to right are 8(c1-), 7(c1+), 6(Vout), 5(VDD), 4(VSS), 3(SDA), 2(SCL), 1(RST). However page 4 would seem to indicate the opposite.

jpatrick62

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
    • View Profile
Re: NHD-C0220Biz and Arduino/Teensy3.1
« Reply #5 on: May 07, 2015, 10:17:38 PM »
One more thing - a bit odd I should think...I can get the I2C bus to enumerate only when 3.3 volt supply is removed.  :(

Paul_B

  • Administrator
  • Sr. Member
  • *****
  • Posts: 249
  • Karma: 16
    • View Profile
Re: NHD-C0220Biz and Arduino/Teensy3.1
« Reply #6 on: May 08, 2015, 08:19:17 AM »
Hello,

There are no discrepancies between the mechanical drawing pin connection (page 3) and pin description / wiring diagram (page 4).

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[]={"    COG  Display    "};
unsigned char text4[]={"  2x20  Characters  "};

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);
}

Please triple check your wiring and follow along with the code listed above.

Thanks!

jpatrick62

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
    • View Profile
Re: NHD-C0220Biz and Arduino/Teensy3.1
« Reply #7 on: May 12, 2015, 09:14:46 PM »
OK, I tried our 2nd  NHD-C0220Biz unit and it worked fine. So the issue with the first unit was that it was defective, it would not enumerate on the I2C bus at all.  :-\
Used a 9K pull up on the working unit, that seems fine.

Paul_B

  • Administrator
  • Sr. Member
  • *****
  • Posts: 249
  • Karma: 16
    • View Profile
Re: NHD-C0220Biz and Arduino/Teensy3.1
« Reply #8 on: May 13, 2015, 07:52:28 AM »
Hello,

I'm sorry to hear about the issue you encountered. We have a set quality control process that is followed for every part so I'm not sure how this one got through, but we will make a note to double-check this type of issue during our QC inspections. I apologize for the inconvenience.

Please contact:

quality@newhavendisplay.com

Thanks!

 

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

Started by Ticoti0xFFBoard Character LCDs

Replies: 1
Views: 2859
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: 1875
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: 4685
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: 915
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: 3092
Last post July 31, 2014, 08:44:29 PM
by SteveC