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.

Chip enable line behaviour with fifo interrupts on the 28377D

Dear All,

 I have some problems in the spi configuration and in particular, the /Chip Select line when using the FIFOs interrupts for an interface with a an EEPROM. I want to write several dozens of words on the same spi transmission.

 I have the RXFIFO interrupt configured for 15 bytes. The interrupt is being generated normally, after the reception of  this number of bytes.

 However, the /Chip Select line goes high after the last word is transmitted, and goes down only after the interruption is attended and new data is loaded on the transmission buffer.

 For the EEPROM this is not valid, because the /Chip Select line should go high only after all words were transmitted.

There is some way to configure the /Chip Select line behaviour in order to avoid the status change during the time between the end of words on transmission buffer, and the interrupt processing?

Best regards,

Oscar

  • Hi Oscar,

    It sounds like using a software controlled CS using a GPIO might be your best option. Check out this post: e2e.ti.com/.../490553

    - Whitney
  • Oscar,

    Currently, there is no way to configure the default behavior of the SPISTE signal. You are seeing the proper behavior of the SPISTE signal. When there is no data in the Transmit buffer, SPISTE will return to it's inactive state. because of this, you have a few options:

    1. Configure the SPI transmit interrupt to be some value smaller than the full FIFO depth. Say you configure the interrupt level to be 8 words. On the first interrupt, you will fill the FIFO with 8 words, immediately upon the first word being copied from the FIFO to the shift register, the interrupt will fire again, where you will load the next 8 words. The FIFO will at that point have 15 words. The next time the FIFO drops below 8 words, the interrupt will fire and you will load up the next 8 words, consistently keeping the FIFO running. You can use this strategy with any burst size, as long as the number of words you load into the FIFO does not exceed the maximum depth of the FIFO.

    2. Instead of using the default SPISTE signal, use a software controlled GPIO to as the Chip Select. There are a bunch of threads on the forum describing this strategy. The basic gist is that your software will manually control the Chip Select signal. The Software can drive it active at the beginning of the transmission, and inactive once the full transmission is complete.

    Strategy 1 will generate more interrupts from the SPI, but your Chip Select will be driven by the SPI as required without any other CPU intervention. Strategy 2 will require some checks in Software to determine when/if the active active transmission is complete and additional writes to the GPIO registers to control your custom Chip Select signal.

    Regards,
    Mark
  • Dear Mark,

    the Strategy 1 is not feasible, because there can be other interrupts that may delay the spi fifo handler. So, it will not avoid completely this problem.

    Strategy 2 is the more basic. But it seems that is the only approach that may solve this issue.

    Best regards,
    Oscar
  • I don't know your application, but I would assume that it is not feasible to disable all other interrupts while the SPI is transmitting?

    Seems like #2 is the basic and most straightforward approach. If you are allowing the SPI transmission to be interrupted and broken up but require the CS to stay low, this is probably the best and only option.

    -Mark