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.

Config F28069 to be a slave-transmitter only device

 I am new to F28069 and I2C, and am trying to configure the I2C to be a slave only device. After I set I2caRegs.I2CIER.bit.RRDY = 1, I have no problem getting an interrupt as well as the data from I2CDDR when the master writes one byte data to the slave. However, when I set to use FIFO: I2caRegs.I2CFFRX.all = 0x2040, and set I2caRegs.I2CIER.bit.RRDY = 0,  I am getting NO interrupt at all when the master writes to the slave (interrupt service routing is not executed at all).  However, the status from I2CFFRX indicated that RXFFINT = 1, and RXFFST is counting up if the master does more writes.  Did I do something wrong?  What settings should correctly have in I2caRegs.I2CIER.all and I2caRegs.I2CFFRX.all for a slave-transmitter device using FIFO to get interrupt? I would appreciate it if someone could give the help.

Thanks,

Yinhao

  • Maybe I should set I2caRegs.I2CIER.bit.AAS = 1, in addition to I2caRegs.I2CFFRX.all = 0x2040, and I2caRegs.I2CIER.bit.RRDY = 0?
    Yinhao
  • Hi Yinhao,

    I2caRegs.I2CFFRX.all = 0x2040 doesn't set the RXFFIENA bit--have you set it elsewhere?

    Also, when you switched from using basic interrupts to using FIFO interrupts, did you make the necessary changes in the PIE registers as well? INT8.1 is used for basic interrupts (those enabled by the I2CIER register), but INT8.2 is is used for the FIFO interrupts. Can you make sure it's enabled in the PIEIER8 register?

    Thanks,
    Whitney
  • Hi Whitney.

    Thanks for your reply! It was my mistake, I meant to set I2caRegs.I2CFFRX.all = 0x2060 and I2caRegs.I2CIER.bit.AAS = 1. I did not know that INT8.2 is for FIFO since there is no explanation in the datasheet indicating that. Anyways, I changed from INT8.1 to INT8.2. But the problem now is that when you first run the slave code without even having a master on the bus send a write, the slave's interrupt service routing I2CINT_2A always triggers. This only happens the first time. Then the master sends writes to the slave, the slave never triggers an interrupt again. I notice that the I2CFFRX always has a 0x20A0 where RXFFST = 0 empty. Can you please help further?

    Thanks,
    Yinhao
  • Hi Whitney,
    You're right, the datasheet did say INT8.2 is for FIFO.
    Yinhao
  • Hi Yinhao,

    Have you set the RXFFIL field in I2CFFRX too? The way the RX FIFO interrupt works is that you get an interrupt once RXFFST reaches a value greater than or equal to the value in RXFFIL, so if you leave the value at zero, you're going to get an interrupt as soon as you bring the RX FIFO out of reset as you've observed.

    I'm not sure why you're only getting the interrupt once. Are you acknowledging the interrupt in the ISR (something like PieCtrlRegs.PIEACK.all = PIEACK_GROUP8)?

    Not sure why RXFFST is stuck at 0 either. Is the I2CFFTX.I2CFFEN bit set to enable FIFO operation?

    Whitney

  • Hi Whitney.
    Thanks again for your reply. I set RXFFIL to be a non-zero, and it still triggers the I2CINT_2A the first time. I did set PieCtrlRegs.PIEACK.all = PIEACK_GROUP8 to ack the interrupt. Anyways, I am getting stuck here, will you be able to give a call to help me get this issue resolved? My # is 610-362-1200x258. Thanks a lot!
    Yinhao
  • Yinhao,

    Are you able to send me some of your I2C code? I'd be happy to look over it. You can either attach it to a post or if you would prefer to send it privately you an add me as a friend here on E2E and private message me. If we're still stuck after that, we'll see about a call.

    Thanks,
    Whitney
  • Just noting that we resolved this offline. Going to close the thread.

    Whitney