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.
Solved! Go to Solution.
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 .
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)"