This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hello,
I am using I2c on core 1 which are GPIO 104 and GPIO 105.
If I get a Nack from slave my clock goes low.
1)Is there a register to look for Nack?
2) Is there a way I can reset my I2C module once I see this Nack register and how can it be donr to restart the i2c communication?
Thanks,
So I figured out if I receive nack from slave my dual core master i2c will have I2caRegs.I2CSTR.bit.NACK = 1;
So now I reset i2c module by I2caRegs.I2CMDR.bit.IRS = 0000; and then set again the same registers as follows:
I2caRegs.I2CMDR.bit.IRS = 1; // Take I2C out of reset
I2caRegs.I2CPSC.all = 16; // Prescaler - need 7-12 Mhz on module clk
I2caRegs.I2CCLKL = 482; // NOTE: must be non zero
I2caRegs.I2CCLKH = 482; // NOTE: must be non zero
I2caRegs.I2CIER.all = 0x2C;
I2caRegs.I2CFFTX.all = 0x6000;
I2caRegs.I2CFFRX.all = 0x6000;
Whenever I do reset my i2c module then my clock frequency reduces from 100 khz to 6 khz. Why is that happening? When I first compile and execute the code the same clock registers make the clock running at 100 Khz but after reset or reset(in CCS) it goes low to 6 Khz.
Thanks