2 Replies Latest reply on Aug 29, 2019 7:51 AM by GaRo_3769926

    PSoC 4: SPI SCB not working properly at high data transfer rates. Continuous mode fails.

    GaRo_3769926

      Good morning everyone and thanks for reading this post

       

      I'm trying to communicate a PSoC 4 (CY8CKIT-049-42XX, with the chip CY8C4245AXI-483) with an ADC (ADS7280) through SPI. I'll later use a CYBL10162-56LQXI chip.

       

      I want to perform two types of writes to the ADS7280: a 4-bit write, and a 16-bit one. This has led me to use the 4-bit data size when configuring the SCB SPI component. I want the 16-bit write to be continuous, that is, without any changes in the Slave Select pin. This is the reason why I've used the "Transfer separation: continuous" mode, because according to the datasheet, this is exactly what it does.

       

      When using the code that I've included in this post, I've had no luck making it work. Troubleshooting it, I've found that the Slave Select pin DOES change states when it should be down all time, and I've narrowed it down to a problem of high-frequency data transfers, since it only happens at 4mbps and not at 2mbps or the other lower frequencies that I've tried, as you can see in the pictures:

       

      SPI_Low_Data_Rate.jpg

            Slave Select pin while sending four 4-bit packets at 2mbps data rate, transfer continuous mode

       

      SPI_High_Data_Rate.jpg

            Slave Select pin while sending four 4-bit packets at 4mbps data rate, transfer continuous mode

       

      I'm guessing the MCU can't put data into the TX FIFO fast enough, and the SPI component guesses that the transfer is over when in reality it shouldn't be.

       

      Any other ideas why this happens? Any idea how to fix it? I'd rather not use DMA since the final chip I'll use doesn't have DMA.

       

      Thank you a lot in advance.