Do I need to Set the clock registers and I2CPSC for I2C configured as Slave Device? Can I put it to 0?
Thanks,
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.
Do I need to Set the clock registers and I2CPSC for I2C configured as Slave Device? Can I put it to 0?
Thanks,
Hi Sagar,
Yes, you will still need to configure I2CPSC when configured as a slave. The register functions to divide down SYSCLK to produce the I2C module clock, which is needed for the I2C peripheral to function. It's not only used to generate the clock at the SCL pin, shown below. ICCL and ICCH can be ignored when configured as a slave I believe.
Please note, "To meet all of the I2C protocol timing specifications, the I2C module clock must be between 7 - 12 MHz."
Best,
Kevin
So Should i2c clock module be the same for both master and slave? Since one of them is at 200 MHz and the other is at 60MHz. Currently, mine i2cpsc for 200Mhz is 18.
Hi Sagar,
No, they don't have to be the same. They just needs to meet the "7-12 MHz" requirement for the I2C module to work properly.
Best,
Kevin