spi_s writting the read data getting problem

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

cross mob
Anonymous
Not applicable

hi team

i read the data from master but i am unable to write the read data,please find the below code.

please help me as soon as possible

/* ========================================

*

* Copyright YOUR COMPANY, THE YEAR

* All Rights Reserved

* UNPUBLISHED, LICENSED SOFTWARE.

*

* CONFIDENTIAL AND PROPRIETARY INFORMATION

* WHICH IS THE PROPERTY OF your company.

*

* ========================================

*/

#include "project.h"

#define BUFFER_SIZE                 (10u)

uint8 rxBuffer [BUFFER_SIZE];

uint8 txBuffer [BUFFER_SIZE];

int main(void)

{

    uint8 i;

    CyGlobalIntEnable; /* Enable global interrupts. */

    SPIS_Start(); 

    SPIS_WriteTxDataZero(0x00);

    while(!(SPIS_ReadStatus() & SPIS_STS_TX_FIFO_EMPTY));

    SPIS_WriteTxData(rxBuffer);

    while(!(SPIS_ReadStatus() & SPIS_STS_TX_FIFO_EMPTY));

   

    LCD_Start();

   

    while(0u == (SPIS_ReadTxStatus() & SPIS_STS_SPI_DONE))

    {

    }

   

  

    for(i=0u; i<BUFFER_SIZE; i++)

    {

    rxBuffer = SPIS_ReadRxData();

    LCD_Position(1u,0u);

    LCD_PrintHexUint8(rxBuffer);   

    }

  

   

    //SPIS_WriteTxData(0x13);

    for(;;)

    {

        /* Place your application code here. */

    }

}

/* [] END OF FILE */

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

can you please provide us with the project

0 Likes