Other Parts Discussed in Thread: CONTROLSUITE
Hi to everyone,
I'm trying to use the F28069 as an I2C slave device, but when I send the F28069 address from the Master device, a NACK is received, and I am not able to send/receive anything. I don't know what to do, here you have my Init function, and the GPIOS are 28 and 29 (as the EEPROM example). Any input will be helpful! Thanks a lot!
void I2CA_Init(void)
{
// Initialize I2C as SLAVE
I2caRegs.I2COAR = 0x007F; // Own address
I2caRegs.I2CPSC.all = 6; // Prescaler - need 7-12 Mhz on module clk
I2caRegs.I2CCLKL = 10; // NOTE: must be non zero
I2caRegs.I2CCLKH = 5; // NOTE: must be non zero
I2caRegs.I2CCNT = 1; // Get 1 byte
I2caRegs.I2CIER.all = 0x18; // Clear interrupts (was 0)
I2caRegs.I2CSTR.bit.RRDY = 1; // Clear flag
I2caRegs.I2CIER.bit.RRDY = 1; // Enable Receive Interrupt
I2caRegs.I2CIER.bit.AAS = 1;
I2caRegs.I2CMDR.all = 0x0020; // Take I2C out of reset
// Stop I2C when suspended
return;