4 Replies Latest reply on Mar 9, 2015 5:07 AM by user_78878863

    How to transmit 32bit long data using SPI block

    rajan.kumar

      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

        • 1. Re: How to transmit 32bit long data using SPI block
          user_78878863

          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.

          • 2. Re: How to transmit 32bit long data using SPI block
            user_57926609

            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

            • 3. Re: How to transmit 32bit long data using SPI block
              rajan.kumar

              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

              • 4. Re: How to transmit 32bit long data using SPI block
                user_78878863

                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.