Author Topic: NHD‐0420CW‐AB3 I2C Interface  (Read 2715 times)

andersonpd

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
    • View Profile
NHD‐0420CW‐AB3 I2C Interface
« on: January 22, 2015, 04:13:55 PM »
I don't understand exactly how to send data and/or control bytes to the NHD‐0420CW‐AB3 display (US2066 driver).

Please verify if this is correct. In each case the start condition and slave address have been sent to the display.

1. To send data only: Send a control byte with both Co and D/C# set to zero (0x00). Any subsequent bytes will be interpreted as data.

2. To send a command: Send a control byte with Co set to one and D/C# set to zero (0x80). The following byte will be interpreted as a command. Repeat for each command (i.e. always send both a control and a command byte).

3. Alternatively, data can also be sent by sending a control byte with Co set to one and D/C# set to one (0xC0). The following byte will be interpreted as data. Repeat for each data byte (i.e. always send both a control and a data byte).
 

Michael_L

  • Administrator
  • Hero Member
  • *****
  • Posts: 356
  • Karma: 33
    • View Profile
Re: NHD‐0420CW‐AB3 I2C Interface
« Reply #1 on: January 23, 2015, 10:00:06 AM »
Perhaps the below code snippets will better assist you:

Code: [Select]
const char slave2w = 0x3C;

void send_packet(unsigned char x)
{
  unsigned char ix;
 
  Wire.beginTransmission(slave2w);
  for(ix=0;ix<x;ix++)
  {
    Wire.write(tx_packet[ix]);
  }
  Wire.endTransmission();
}

void command(unsigned char c)
{
      tx_packet[0] = 0x00;
      tx_packet[1] = c;
      send_packet(2);
}

void data(unsigned char d)
{
      tx_packet[0] = 0x40;
      tx_packet[1] = d;
      send_packet(2);
}

 

MOVED: NHD-0420CW-AY3 display, text is mirror image

Started by Saurabh_BBoard Character LCDs

Replies: 0
Views: 2133
Last post March 11, 2016, 07:51:03 AM
by Saurabh_B
0420CW-AB3 I2C Talking, Display is off and low current drawn

Started by AreswayBoard OLEDs

Replies: 3
Views: 2867
Last post February 10, 2015, 07:39:49 AM
by Paul_B
NHD-0420DZW-AY5 vs 763-NHD-0420CW-AY3 for brightness and power consumption

Started by timmwalkBoard OLEDs

Replies: 1
Views: 1822
Last post December 07, 2015, 08:37:17 AM
by Saurabh_B
NHD-0420CW-AY3 display, text is mirror image

Started by zleozBoard OLEDs

Replies: 1
Views: 1995
Last post March 11, 2016, 07:59:53 AM
by Paul_B
Light Streaking on NHD-0420CW-AB3 Display w/ I2C rewrites

Started by BobGBoard OLEDs

Replies: 2
Views: 838
Last post March 02, 2017, 10:43:50 AM
by BobG