# How to setup slave addressing with a HT16K33 in Proteus?

I have setup the following circuit in Proteus :

A PIC12F1822 is connected to a HT16K33 using an I2C bus. I want to configure the HT16K33 to use the following address :

A0 = 1 A1 = 0 A2 = 0


I have setup the pins as explained in the HT16K33 datasheet:

According to the documentation, the address send by the master should be :

1 1 1 0 A2 A1 A0 R/W

I send 0xE2 (0b11100010). However, it does not work, the HT16K33 does not send a ACK :

Here is my code :

I2C1_Init(100000);
I2C1_Start();
I2C1_Wr(0xE2);


If I send 0xE0 (the default address), it works (a ACK is send).

I came to conclusion that the HT16K33 chip need some time to initialize and setup the addressing. Otherwise, the PIC send the data over the I2C bus too early and the HT16K33 is not ready. Adding a small delay before sending the data solve the problem (a ACK is send) :

void main() {
delay_ms(10);

I2C1_Init(100000);
I2C1_Start();
I2C1_Wr(0xE2);
}


Maybe there is a better way to achieve this.

From tigrous responses, and according to the datasheet (page 8):

Data transfers on the I2C-bus should be avoided for 1 ms following a power-on to allow completion of the reset action.