NHD-C0220Biz and Arduino/Teensy3.1

Comments

8 comments

  • Michael_L

    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: https://newhavendisplay.com/content/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?

    0
  • jpatrick62

    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...

    0
  • jpatrick62
    Actually we presently have 21K ohm pull-ups, but I'll try to swap them out.
    0
  • jpatrick62

    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.

    0
  • jpatrick62

    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.

    0
  • Paul_B

    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:

    #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!

    0
  • jpatrick62

    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.

    0
  • Paul_B

    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!

    0

Please sign in to leave a comment.