5 Replies Latest reply on Nov 9, 2016 12:02 AM by anks

    SPI RX Buffer

    hemnk1234_1611811

      Hii,

         

      I am Using PSOC 5LP as my SPI slave. I am using SPIS Example by using that I can able to transfer data and receive one time. But I want to transfer and receive the data continuously. i.e when ever I transmit the data to PSOC I should able to receive in buffer. please help me regarding this.

         

       

         

      Thank you

         

      Regards

         

      Hem k 

        • 1. Re: SPI RX Buffer
          anks

          Hello, You have to choose the TD's in Loop option in DMA Configuration (instead of CY_DMA_DISABLE_TD )in this way by using DMA Wizard tool-

             

          CyDmaTdSetConfiguration(rxTD, BUFFER_SIZE, rxTD, TD_INC_SRC_ADR |TD_INC_DST_ADR);

             

          For both Rx /TX DMA's.

             

          Then data will be transferred continuously. Please clarify whether you wish data to be transferred continuously or discretely whenever you want .

          • 2. Re: SPI RX Buffer
            hemnk1234_1611811

            Thanks ANKS,

               

            I wish to transfer data discretely whenever I want.

               

            Regards

               

            Hem K

            • 3. Re: SPI RX Buffer
              hemnk1234_1611811

              Hii ANKS,

                 

              I tried the way mentioned now data is not communicated even one time. Please help me regarding this.

                 

              Thank you

                 

              Hem K

              • 4. Re: SPI RX Buffer
                anks

                You should not use TD's in Loop option in DMA Configuration (instead of CY_DMA_DISABLE_TD )in this way by using DMA Wizard tool because you do not wish to send data continuously but discretely acc to your requirement.

                   

                You dont even need to use that SPIS Example project involving DMA.You can configure a hardware pin (as a switch) which can trigger an ISR.

                   

                Then in the firmware,inside ISR body,you can set a Flag(variable).

                   

                And you will have to continuously check the flag(variable) value in main inside for(;;) loop,that is if flag is set,then you will send the value in txBuffer Ram Array into SPIS component's Transmit buffer by using API "void SPIS_WriteTxData(uint8/uint16 txData)"

                   

                Also,if you will put any data from Receive buffer of SPIS component to rxBuffer RAM array by using API "uint8/uint16 SPIS_ReadRxData(void)"

                • 5. Re: SPI RX Buffer
                  anks

                  I am attaching one example project depicting stated above-