Hello,
I am using a tm4c1294 microcontroller, which is cortex m4 based. I m not very sure if the problem is software or hardware related. My goal is to be able to communicate with the tcs3472 loght sensor.
The problem is both of my lines (sda and sclk) stay low. picture: http://imgur.com/bFlQlY4
I don't think this is clock stretching. I only put two pull up resistors of 10k to 3.3v. But I think that normally I should at least see the address being sent with a NACK or ACK and afterwards my data, no?
this is my code:
#define I2C7Master_Base 0x400C3000
void setupI2c();
void sendTestCmd();
int main(void)
{
setupI2c();
while(1){
sendTestCmd();}
}
void setupI2c()
{
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
SysCtlPeripheralEnable(SYSCTL_PERIPH_I2C7);
GPIOPinTypeI2C(GPIO_PORTA_BASE, GPIO_PIN_4|GPIO_PIN_5);
I2CMasterInitExpClk( I2C7Master_Base, SysCtlClockGet(), false);
I2CMasterSlaveAddrSet(I2C7Master_Base, 0x29, false);
I2CMasterEnable(I2C7Master_Base);
}
void sendTestCmd()
{
I2CMasterDataPut(I2C7Master_Base, 0x55);
I2CMasterControl(I2C7Master_Base, I2C_MASTER_CMD_SINGLE_SEND);
while(I2CMasterBusy(I2C7Master_Base))
{
//WAITS FOREVER
}
}
Thank you