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.

Where is the FIFO I2C register on 28027 ?

Hi :)

I'm working on the I2C bus on the picolo 28027. I just can't seem to find the FIFO recieving register. In the I2C module reference it states that:

"When in the receive FIFO mode, the I2CDRR register acts as the receive FIFO buffer."

But should the FIFO not be 4 bytes large? The I2CDRR register is only 16bits and 8 are reserved.

Can anyone please tell me how to recieve using the FIFO buffer?

Thanks in advance :)

Best regards,

Jacob Lillie

  •  

    Jacob Lillie said:

    "When in the receive FIFO mode, the I2CDRR register acts as the receive FIFO buffer."

    But should the FIFO not be 4 bytes large? The I2CDRR register is only 16bits and 8 are reserved.

    Can anyone please tell me how to recieve using the FIFO buffer?

    It's a first in first out buffer, so each time you read the I2CDRR register you will get the "first out".

    -Lori

  • I have some questions about following code(I2C-EEPROM):

    // If completed message was reading EEPROM data, reset msg to inactive state
    // and read data from FIFO.
             else if (CurrentMsgPtr->MsgStatus == I2C_MSGSTAT_READ_BUSY)
             {
                CurrentMsgPtr->MsgStatus = I2C_MSGSTAT_INACTIVE;
                for(i=0; i < I2C_NUMBYTES; i++)
                {
                  CurrentMsgPtr->MsgBuffer[i] = I2caRegs.I2CDRR;
                }
             {

    The code says  read data from FIFO.So the data from  EEPROM is memoried in I2CDRR(work in FIFOs mode).So how large is the I2CDRR(FIFO)?

    somewhere says 14 bytes(// thus only setup 14 bytes maximum)???

  • Yang,

    There are two FIFO buffers, one for transmit and one for recieve.  Each of these FIFOs will hold up to 4 bytes of data.  If you need to buffer more data before processing it, you will need to create a larger FIFO in software yourself.

    Trey

  • I found some differences between f28015 and f28027.The former has 16 bytes FIFOs and the latter just has 4 bytes of data.

    thanks a lot for your help!

    But I have no idea how to create a larger FIFO in software myself???

    I am trying to create a larger FIFO in software,but it failed,because when it overrun 4 bytes,it cannot work(in f28027).

    My idea is to send more times(I2cMsgOut1,I2cMsgOut2.......),can it work?Can you offer me some suggestions in software?

  • Yang,

    You ought to be able to find source code that implements a FIFO or Ring Buffer on the internet (hint: use google). 

    It sounds to me like you don't fully understand the big picture of how I2C can fit in with your main program.  I would suggest you find other people who have done something similar to what you want to do (even if its with a different processor than what you want to use).  Then you can tweak and modify their code to make it do what you want to do.  Beyond that I'm afraid I can't be of much help.

    I wish you the best of luck with your project,

    Trey

  • In fact,I  don't fully understand I2C module,most of problems in my project have sloved with your help!thanks......

    But there is a big problem puzzling me,there is a write function( Uint16 I2CA_WriteData(struct I2CMSG *msg) ) in  I2C of TI example(f28027) .

    I am so sorry to make you  read the program again,a part of program in the write function as following:

       I2caRegs.I2CCNT = msg->NumOfBytes+2;

       // Setup data to send
       I2caRegs.I2CDXR = msg->MemoryHighAddr;
       I2caRegs.I2CDXR = msg->MemoryLowAddr;
       // for (i=0; i<msg->NumOfBytes-2; i++)
       for (i=0; i<msg->NumOfBytes; i++)

       {
          I2caRegs.I2CDXR = *(msg->MsgBuffer+i);
       }

       // Send start as master transmitter
       I2caRegs.I2CMDR.all = 0x6E20;

       return I2C_SUCCESS;

    }

    At the end of the function,when configure  I2caRegs.I2CMDR.all = 0x6E20;,the I2C module is working,so the I2CCNT will counts down to 0,it will generate a interrupt,but at the same time,there is a "return I2C_SUCCESS" sentence,so which will do first, the stop interrupt or return ???

    I read the program many times,and it must be doing return first,but why?Why it donot go to interrupt first before return?

    Thanks for your help again!

    I really need your help!

  • Yang,

    You are right, the program will return the I2C_SUCCESS message before the message is actually transmitted.  You have to remember that your program is running much much faster than the I2C bus, so when you tell the I2C module to send out some data it takes some time for it to happen.  The transfer of this data doesn't start until you write to the MDR register near the end of that function, and you won't get an interrupt until the transmission is complete (i.e. well after the function has returned).  That's why communications peripherals like this have interrupts, so you know when a transmission is completed or when new data has been received.

    Does that make sense?


    Trey

  • I greatly appreciate all your help!

    It does make sense to me. The problem puzzled me two days!I still have many work to do about the project!

    I am a student  interested in DSP from China.I am sorry to make you understand my poor english!

    You are a hearted man ,thank you Trey!

  • Yang,

    Good to hear!

    I'm only 24 myself, so I was a student not to long ago.  When you are new to electronics much of it can be confusing and difficult to understand.  Your english is very good.  I had no trouble understanding you.

    I appreciate your thanks :)  Good luck on your project!!!


    Trey

  • I am 24 years too!You are a TIs engineer now,and you are a learned person,I envy you very much!

    TI is a great company,I hope to be friend with you!