I am having troubles with I2C stability, and want to slow the I2C clock to 1/10 it's normal speed so I can use my PC sound card to capture the I2C signals. The sound card is limited to 20KHz. I thought a 10KHz I2C clock might work.
See below for the numbers I used for the prescaler and clocks.
It seems to work OK (sort of) at 100KHz, (I2CCLKL and I2CCLKH both set at 45d or 0x2d.)
But when I use 450d (0x1c2) for both hi and lo clocks the communication break down
I have a FTDI FT201x USB to I2C chip, A PurePath CC8030 wireless chip, and also an Analog Devices ADAU1701 on the I2C port.
Any ideas?
Thanks, Mark.
Here is my attempt:
The Piccolo is running at 50MHz.
// setup the prescaler for the I2C module. must be between 7-12 Mhz on module clk I2caRegs.I2CPSC.all = 4; // 50MHz / 5 (PSC + 1) = 10.0MHz // setting PSC to 4 makes d = 5 // here is the math: for 100KHz where d is 5 (based on the prescale, above) // 10,000,000 / (45 + 5) + (45 + 5) // 10,000,000 / 50 + 50 // 10,000,000 / 100 = 100.0 KHz // if we want 100k clk freq, use 45 and 45 respectively // 100KHz is 10uS pulse cycle. 9 bits per byte is 90uS per byte I2caRegs.I2CCLKL = 45; // NOTE: must be non zero I2caRegs.I2CCLKH = 45; // NOTE: must be non zero // lets try to slow it down to a 10Khz rate I2caRegs.I2CCLKL = 450; // NOTE: must be non zero I2caRegs.I2CCLKH = 450; // NOTE: must be non zero