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.

TMS570LC4357: SPIENAn Pin - Can you hold a transaction midway through?

Part Number: TMS570LC4357
Other Parts Discussed in Thread: TMS570LS2124

Hi,

My situation is as follows:

There is a Hercules processor (currently TMS570LC4357 but we may also use the TMS570LS2124) that is communicating with an FPGA using a MibSPI bus. The transactions to the FPGA consist of a 16 bit header word that identifies a particular channel on the FPGA, the memory address of that channel and the action to take (read / write, reset, etc), along with data read or write to / from the FPGA.

As an example, an FPGA channel may be reading pulse widths from external devices and updating it's internal memory with the most recent info about that pulse width. The CPU will read data from the FPGA regarding that pulse width. However, it will be very easy to run into collisions where the FPGA is updating the pulse width register while the CPU wants to read it. In that case, the CPU must delay the SPI transaction, which can be done using the SPIENAn pin, based on my reading.

However, it won't be possible to delay the CPU until the FPGA has received the header word, which will be in the middle of the transaction. Before the header word is received, the FPGA will not know which channel is being accessed and so it won't be able to assess whether or not it needs to hold the CPU. If there is no need to hold, it can provide the data right away, but if the memory is in use it will need to wait until the next FPGA clock to access the memory, which means it won't get to the SPI bus in time to send out.

So, my question boils down to 'Can the SPI Enable pin be used to hold a transaction midway through the transaction?'

  • The SPInENA pin is sampled in master mode after the fall of the chip select. If the ASIC is OK with CS going high between the 16 bit header word and the data to be read, then SPInENA will be able to hold off the read of the data.
  • Hi Bob,

    We could change the FPGA code so that this was the case, but how does the Hercules know about the chip select going low? Does it rely on us using the dedicated pins associated with each MibSPI? It's possible that we could introduce a latency byte into the packet as well, but that would kill throughput on small transfers (most transfers will likely be 4-10 bytes).
    NIck
  • The timing of sampling the SPInENA pin is related to the CS pin, but I don't think you actually need to use the CS if your ASIC does not require it. The important thing is that the CSHOLD bit (bit 28 of the Transmit Data Register) should not be set.