Newhaven Display Forum

Newhaven Products => Character LCDs => Topic started by: alk on January 09, 2015, 02:48:15 PM

Title: Changing the Slave Address with NHD-0420D3Z
Post by: alk on January 09, 2015, 02:48:15 PM
Hello, I am working on a project in which I run two of the specified character LCD displays on a single I2C bus as slaves. The master/controller in this scenario is a KL25z Freedom Platform. I've been able to successfully write text to the LCD, move the cursor around, and execute several of the commands specified in the data sheet. However, in order for my project to work, I need to be able to talk to one LCD and not the other. Obviously, I should just change the I2C slave address of one of the two LCDs. However, when I execute the command specified in the data sheet, nothing happens and the display still responds to the default address. Has anyone had this issue or know what might be wrong?

Title: Re: Changing the Slave Address with NHD-0420D3Z
Post by: Michael_L on January 09, 2015, 04:30:08 PM
The execution time for the command to change the I2C address is longer than the other commands (3ms). See the table on page 7 of the datasheet.  Please make sure you are allowing for this :)
Title: Re: Changing the Slave Address with NHD-0420D3Z
Post by: alk on January 13, 2015, 01:53:20 PM
Haha oh wow I feel silly. I did initially note that this command needed a longer delay. When I went back to check my code it turns out I was only delaying for about 2 ms given the clock rate of my controller. Increasing the delay has done the trick and everything works great, thanks Michael!