Hallo,
I have a problem to configure the Kinetis K70 as a I2C-Slave.
My Master send the Slave-address but I get always a NACK from my K70.
I have a short example to check the Slave-address.
Here my configuration:
SIM_SCGC4 |= 0x40; //Turn on clock to I2C0 module
PORTE_PCR19 = PORT_PCR_MUX(4); // SCL
PORTE_PCR18 = PORT_PCR_MUX(4); //SDA
| I2C0_A1 = 0x6; | // Slave-address |
| I2C0_C1 |= I2C_C1_IICEN_MASK; | /* enable IIC */ |
| I2C0_C1 |= I2C_C1_IICIE_MASK; | | | // interrupt enable |
I2C0_C1 &= ~0x10;
I2C0_C1 &= ~I2C_C1_MST_MASK;
At the moment i have only an ISR, which toggels LED's if the Slave address is correct.
void i2c0_isr (void)
{
GPIOA_PDOR &= ~GPIO_PDOR_PDO(GPIO_PIN(11));
GPIOA_PDOR &= ~GPIO_PDOR_PDO(GPIO_PIN(10));
I2C0_S |= 0x2;
}
I dont know where my mistake is. Have anyone an idea??
Could it be a timing problem?