Hi team,
Here's an issue from the customer may need your help:
1) The I2C pins are already selected in the pinmux:
2) In I2C configuration, enable the I2C pin as I2C function:
3) There is a external 2.2K pull-up resistor.
4) After sending one byte of data, the start signal is monitored by an oscilloscope, but the end signal is not monitored. After a 1s interval, when a byte is sent again, the program is found to be stuck at
While(i2cIsStopDetected(i2cREG1) = = 0);
The transmit code for the function is as follows:
void i2c_send_test(void) { int32_t delay=0; /* Configure address of Slave to talk to */ i2cSetSlaveAdd(i2cREG1, Slave_Address); /* Set direction to Transmitter */ /* Note: Optional - It is done in Init */ i2cSetDirection(i2cREG1, I2C_TRANSMITTER); /* Configure Data count */ /* Note: Optional - It is done in Init, unless user want to change */ i2cSetCount(i2cREG1, 1); /* Set mode as Master */ i2cSetMode(i2cREG1, I2C_MASTER); /* Set Stop after programmed Count */ i2cSetStop(i2cREG1); /* Transmit Start Condition */ i2cSetStart(i2cREG1); /* Tranmit DATA_COUNT number of data in Polling mode */ i2cSend(i2cREG1, 1, TX_Data_Master); /* Wait until Bus Busy is cleared */ while(i2cIsBusBusy(i2cREG1) == true); /* Wait until Stop is detected */ while(i2cIsStopDetected(i2cREG1) == 0); /* Clear the Stop condition */ i2cClearSCD(i2cREG1); /* Simple Dealya before starting Next Block */ /* Depends on how quick the Slave gets ready */ for(delay=0;delay<1000000;delay++); }
5) The waveform signal captured by the oscilloscope is as follows:
6) The program simulating I2C through GPIO can correctly read the data from the slave DS1339.
Could you help check this case? Thanks.
Best Regards,
Cherry