Newhaven Display Forum

Newhaven Products => OLEDs => Topic started by: sweit on October 18, 2017, 07:26:24 AM

Title: NHD-0216AW-IB3 I2C help
Post by: sweit on October 18, 2017, 07:26:24 AM
Hello,

I'm trying to interface an NHD-0216AW-IB3 to a dsPIC30F4013. This is the first time I've ever used the I2C interface and I have a question. In the initialization, do I need to send a start and stop condition before every command and data byte? Also, do I need to send the device address before every command and data byte?

Thank you,
Steve
Title: Re: NHD-0216AW-IB3 I2C help
Post by: Saurabh_B on October 18, 2017, 09:40:28 AM
Hello,

You would only need to send the start condition once, and you would only need to send the address once after this start condition.

You will however need to send a "command byte" between each data byte sent. I would recommend looking at Figure 5-7 of the Controller datasheet.
This can be found on page 11 here: http://www.newhavendisplay.com/app_notes/US2066.pdf

This command byte would need to be sent between any instruction/data byte sent to the display, and it allows you to change the D/C# bit which determines whether the following byte that follows will be used as data or an instruction.