SPI RX Buffer

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

cross mob
Anonymous
Not applicable

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 

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
AnkitaS_51
Employee
Employee
100 likes received 50 likes received 25 likes received

I am attaching one example project depicting stated above-

View solution in original post

0 Likes
5 Replies
AnkitaS_51
Employee
Employee
100 likes received 50 likes received 25 likes received

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 .

0 Likes
Anonymous
Not applicable

Thanks ANKS,

   

I wish to transfer data discretely whenever I want.

   

Regards

   

Hem K

0 Likes
Anonymous
Not applicable

Hii ANKS,

   

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

   

Thank you

   

Hem K

0 Likes
AnkitaS_51
Employee
Employee
100 likes received 50 likes received 25 likes received

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)"

0 Likes
lock attach
Attachments are accessible only for community members.
AnkitaS_51
Employee
Employee
100 likes received 50 likes received 25 likes received

I am attaching one example project depicting stated above-

0 Likes