SPI RX Buffer | Cypress Semiconductor

SPI RX Buffer

Summary: 5 Replies, Latest post by ANKS on 09 Nov 2016 12:02 AM PST
Verified Answers: 1
Last post
Log in to post new comments.
hemnk1234_1611811's picture
User
10 posts

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 

ANKS's picture
Cypress Employee
88 posts

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 .

hemnk1234_1611811's picture
User
10 posts

Thanks ANKS,

I wish to transfer data discretely whenever I want.

Regards

Hem K

hemnk1234_1611811's picture
User
10 posts

Hii ANKS,

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

Thank you

Hem K

ANKS's picture
Cypress Employee
88 posts

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

ANKS's picture
Cypress Employee
88 posts

I am attaching one example project depicting stated above-

 

Log in to post new comments.