How to transmit 32bit long data using SPI block

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi all,

   

I need to program a Frequency synthesizer device (HMC833) using SPI interface of PSOC3 device (P.NO.  CY8C3866).

   

Device HMC833 requires a 32 bit long data (per SPI write cycle) for each of its internal registers.

   

To program HMC833, overall 16 registers are need to be programmed using SPI interface.

   

This 32-bit data includes the read/write bit+Register address bits+data bits.

   

But SPI block of PSOC3 device shows maximum 16bits can be transmitted at a time.

   

How to solve this data width issue?

   

Plz help

   

 

   

Regards,

   

Rajan

0 Likes
4 Replies
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

The configuration defines how many bits are in one FIFO entry. If you fill up the FIFO with more than one word, they are transmitted in one transaction. (As long as the FIFO gets filled up faster than the transmission moves them out to the slave).

   

So set the SPI for 8 bits, and write 4 bytes into the FIFO, and they will be transferred in a single SPI transaction.

0 Likes
GrRa_284656
Level 2
Level 2
5 sign-ins 10 replies posted 5 replies posted

Hi Rajan,

   

in http://www.cypress.com/?app=forum&id=2233&rID=89475 there is something about 32 bit SPI component.

   

In this post , GORE posted the  SPI_32_bit.zip file, in which there is a SPIM_32bit library that contains a component: SPI_Master32_v2_40.

   

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

   

I answered GORE about this component: is this component fully functional?

   

But GORE never answered me.

   

 

   

Graziano G. Ravizza

0 Likes
Anonymous
Not applicable

Hi all,

   

Thanks for your valuable replies.

   

I have downloaded the zip folder and vl check it.

   

In further discussion, my requirement is to program a freq synthesizer (HMC833) (pdf link : www.hittite.com/content/documents/data_sheet/hmc833lp6g.pdf)  using PSOC3 device , SPI block.

   

If you can check the HMC833 datasheet (SPI interface, P.NO.43), to implement SPI interface with 32 bit data,

   

IS the "SS" pin of PSOC3 SPI block required to be connected to the slave (HMC833, SEN pin )SPI interface ?

   

I think that I need to make SEN pin high first then SPI WRITE cmd.

   

Also , to transmit 32bit data which PSOC3 SPI API (or command) will be used?

   

 

   

Regards,

   

Rajan

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

You can connect the SEN pin to SS, but you don't need to - you can handle SEN with a dedicated GPIO that you user code controls (that allows better transaction control).

   

You just use the norma SPI write functions - just give it an array of 4 bytes and the will be transmitted as 32 bits.

0 Likes