Other Parts Discussed in Thread: C2000WARE
Dear all,
I have been recently working on i2c and have few doubts which i have tried my best to solve yet I'm not able to. So kindly help me in this:
1)From the example programs form ti i am seeing that after finishing all configuration and putting the data , we are calling start condition function and stop condition function is called. ist this the correct way....
I2C_putData(I2CA_BASE, 1);
//Send start as master transmitter
I2C_setConfig(I2CA_BASE, I2C_MASTER_SEND_MODE);
I2C_sendStartCondition(I2CA_BASE);
I2C_sendStopCondition(I2CA_BASE);
2) please read the following code snippet from ti example from C:\ti\c2000\C2000Ware_3_04_00_00\driverlib\f28004x\examples\i2c\i2c_ex2_eeprom.c
void initI2C()
{
//
// Must put I2C into reset before configuring it
//
I2C_disableModule(I2CA_BASE);
//
// I2C configuration. Use a 400kHz I2CCLK with a 33% duty cycle.
//
I2C_initMaster(I2CA_BASE, DEVICE_SYSCLK_FREQ, 400000, I2C_DUTYCYCLE_33);
I2C_setBitCount(I2CA_BASE, I2C_BITCOUNT_8);
I2C_setSlaveAddress(I2CA_BASE, SLAVE_ADDRESS);
I2C_setEmulationMode(I2CA_BASE, I2C_EMULATION_FREE_RUN);
//
// Enable stop condition and register-access-ready interrupts
//
I2C_enableInterrupt(I2CA_BASE, I2C_INT_STOP_CONDITION |
I2C_INT_REG_ACCESS_RDY);
//
// FIFO configuration
I2C_enableFIFO(I2CA_BASE);
I2C_clearInterruptStatus(I2CA_BASE, I2C_INT_RXFF | I2C_INT_TXFF);
//
// Configuration complete. Enable the module.
//
I2C_enableModule(I2CA_BASE);
}
Here we are not setting FIFO interrupt level or either we are having a FIFO isr in the main code. we are here just enabling the FIFO . how does that work ? Kindly explain . also please try to give a program flow.
when i tried to comment out FIFO enable function , data was not transmitting. i have enabled tx ready interrupt and deal the whole thing without using FIFO. But then all I see is busy bit always set to 1 . How to use i2c without FIFO?
When i use the configuration of i2c same to example everything works but i just want to know what's happening....
Thanks and regards,
Stevin Martin