32 bit SPI | Cypress Semiconductor

32 bit SPI

Summary: 4 Replies, Latest post by Graz on 28 Jan 2015 11:57 AM PST
Verified Answers: 3
Last post
Log in to post new comments.
HiZ's picture
27 posts


I need to transfer 32 bit over SPI. How can I do that?


user_78878863's picture
2553 posts

Just configure the SPI master to 8 bit data width, and send 4 bytes. Nothe that, when the clock is fast enough, you need to control the slave select line manually (otherwise it might go high inbetween consecutive bytes).

GORE's picture
Cypress Employee
18 posts

 Hi Hi-Z,

We can send 32-bit data via SPI with the available 8/16bit SPI component by controlling the slave select pin in firmware. To achieve this, place a GPIO pin in the top-design of your project and control the slave select pin of SPI slave component by writing to this pin. Write zero to the pin before tranfering the data and write one when 32 bit data is transfered. I am attaching a code example which will describe the same.



HIMA's picture
Cypress Employee
169 posts


Adding to the above mentioned points the SS pin will be active until SPIM_STS_SPI_DONE flag is set. This flag will be set only when the TX FIFO is empty. If you are transferring data continuously to the Tx FIFO at a very fast rate, such that before completing the tranfer of the  btye which was written first , if the next byte is written to the FIFO, then SS pin will not get deactivated in between. You can use, DMA for transferring data to SPI TX FIFO.


user_57926609's picture
19 posts

Hi to all!

Inside the SPI_32_bit.zip file, there is also a SPIM_32bit library that contains a component: SPI_Master32_v2_40.

This is a SPI Master component that works up to 32 bit.

Dear GORE, is this component fully functional?

If this components works (I will test it in the next days), it is possible to include it into new versions of PSoC Creator?

Thank you very much.

Graziano G. Ravizza

Log in to post new comments.