1 Reply Latest reply on Nov 6, 2017 12:15 AM by anks

    spi_s writting the read data getting problem

    lavanya.maddukuri_2672281

      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[i]);

          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[i] = SPIS_ReadRxData();

          LCD_Position(1u,0u);

          LCD_PrintHexUint8(rxBuffer[i]);   

          }

        

         

          //SPIS_WriteTxData(0x13);

          for(;;)

          {

              /* Place your application code here. */

          }

      }

       

       

      /* [] END OF FILE */