This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

i2c without fifo. possible?

Other Parts Discussed in Thread: TMS320F28055

I am using TMS320F28055.

for simple code, I made it without fifo.  

is it possible to run ? 

void write_section(void)
{
Uint16 i2c_i = 0;

i2c_status = I2caRegs.I2CSTR.all;

if(I2caRegs.I2CSTR.bit.BB == 1)
{
return ;
}

I2caRegs.I2CSAR = I2C_SLAVE_ADDR;
I2caRegs.I2CCNT = 130; //Set count to 1 characters plus 1 address bytes
I2caRegs.I2CMDR.bit.IRS = 1; // Reliquish I2C from reset
I2caRegs.I2CMDR.bit.TRX = 1; //Set to Transmit mode
I2caRegs.I2CMDR.bit.MST = 1; //Set to Master mode
I2caRegs.I2CMDR.bit.FREE = 1; //Run in FREE mode
I2caRegs.I2CMDR.bit.STT = 1; //Send the start bit, transmission will follow

I2caRegs.I2CDXR = high_addr; //Send camera high address
I2caRegs.I2CDXR = low_addr;
for(i2c_i = 0 ; i2c_i < 128 ; i2c_i++)
{
I2caRegs.I2CDXR = sand_read_buffer[i2c_i];
}

I2caRegs.I2CMDR.bit.STP = 1; //Stop when internal counter becomes 0


while (I2caRegs.I2CSTR.bit.XRDY != 1) {}// Wait until Tx buffer is empty again

DELAY_US(10);

}

do i have to ues interrupt and fifo to run i2c? or are there any method without fifo and interrupt?

  • Hi,

    ha kilho said:
    do i have to ues interrupt and fifo to run i2c? or are there any method without fifo and interrupt?

    Not necessary! Refer the I2C peripheral datasheet for regular configurattion.

    Regards,

    Gautam