DSPRelated.com
Forums

I2C-Module on TMS320C6713

Started by thomas05281 September 16, 2005
Hi!
I want to connect an external EEPROM to the I2C0 - Module on the
TMS320C6713.
The following Code works on the loopback mode fine, but when I
changed the mode to the Port (SDA0, SCL0) there is no signal detected
on the port pins. According your datasheet the SDA0 and SCL0 has an
external Pull-up resistor of 10kOhm to VCC.
Can you give me an idea ? Is it a configuration or Hardware problem.
I noticed this behaviour also on the I2C1-Module.

Uint8 senddata = 0x32;
Uint8 recdata = 0;

I2C_Config I2CConfig = {
I2C_FMKS(I2COAR, A, OF(0x05)), //Own Address = 5
I2C_I2CIMR_DEFAULT, //Interrupt mask
register / Interrupt enable register
I2C_FMKS(I2CCLKL, ICCL, OF(0x0113)), //Low-Time Divider
(TLow = 2.5s)
I2C_FMKS(I2CCLKH, ICCH, OF(0x0113)), //High-Time Divider
THigh = 2.5s)
I2C_FMKS(I2CCNT, ICDC, OF(0x0001)), //Start Value of
DataCounter = 1
I2C_FMKS(I2CSAR, A, OF(0x05)), //Slave Address = 5

I2C_FMKS(I2CMDR, NACKMOD, ACK) |
I2C_FMKS(I2CMDR, FREE, RFREE) |
I2C_FMKS(I2CMDR, STT, NONE) |
I2C_FMKS(I2CMDR, STP, NONE) |
I2C_FMKS(I2CMDR, MST, MASTER) |
I2C_FMKS(I2CMDR, TRX, XMT) |
I2C_FMKS(I2CMDR, XA, 7BIT) |
I2C_FMKS(I2CMDR, RM, REPEAD) |
I2C_FMKS(I2CMDR, DLB, NONE) |
I2C_FMKS(I2CMDR, IRS, NRST) |
I2C_FMKS(I2CMDR, STB, NONE) |
I2C_FMKS(I2CMDR, FDF, NONE) |
I2C_FMKS(I2CMDR, BC, BIT8FDF),
I2C_FMKS(I2CPSC, IPSC, OF(0x00)) //Prescaler Divider = 1
};

//Open the I2C0 Module for EEPROM Access
hI2C0 = I2C_open(I2C_DEV0, I2C_OPEN_RESET);

//Configure I2C0 Module
I2C_config(hI2C0, &I2CConfig);

I2C_start(hI2C0);
I2C_writeByte(hI2C0, senddata);
recdata = I2C_readByte(hI2C0);
I2C_sendStop(hI2C0);

//Close I2C0 Module
I2C_close(hI2C0);

My Controller CPU-frequency is 225MHz and the module frequency
SYSCLOCK2 is 112,5MHz

best regards
Thomas