Hi,
I have been trying to properly initialize the I2C port but with no success. Below is my initialization code:
******************************************************************************
void I2C2_init(){ I2C2MDR = 0; // Put I2C1 in Reset I2C2PFNC = 0; // Set SDA and SDL Pins as I2C Function pins I2C2CKH = 34; // Refer to above for SDL_clk timing I2C2CKL = 34; // Refer to above for SDL_clk timing I2C2OAR = 0; // Set address of MCU (Master) I2C2SAR = 0x1; // Set address of DSP (Slave) I2C2PSC = 1; // Module Clock = 7.5MHz [ICLK / I2C1PSC + 1] I2C2MDR = 0x600;//0 | (1<<10) | (1<<9); // Master, TX, I2C1 in Operation I2C2MDR |= 0x20;//(1<<5)}
********************************************************************************
I inserted a breakpoint at the end of the initialization to check the register values. Here is a screenshot:
From what I can tell, the I2C2CKL (addr 0xFFF7D90E) and I2C2MDR (addr 0xFFF7D926) is stuck. I2C2MDR is especially troubling because this indicates that the I2C is stuck at reset.
I've tried re-shuffling the initialization code sequence, tried I2C4, tested the initialization code on 3 different evaluation boards (IAR SM470 Eval board and TI HEAT board) but all to no avail.
What am I doing wrong? Any help would be greatly appreciated!
Best regards,
Roy
Roy,
I wanted to update you on this. I am trying to obtain some example code from the commercial team.
I hope to have it soon and can up date you on config and settings.
Regards,
Wade
Roy, I have emailed you some information on example project for I2C.
Hi Roy,
At which frequency do you run the CPU ? it seems that the I2C module is highly restrictive :
-> Operates with TMS470 core frequency from 6.7 MHz up
-> Operates with module frequency between 6.7 MHz to 13.3 MHz
(extract of SPNU223C)
regards,
JM
Hello Wade,
Could you please share the example project file.
Thank you,
Siddharth Shah