1 2 Previous Next 16 Replies Latest reply on Aug 7, 2019 10:52 PM by AlakanandaB_86 Go to original post
      • 15. Re: Communication between two psocs with SPI
        BUTA_1301626

        MASTER CODE "PSOC MASTER "==>"50 53 4f 43 20 4d 41 53 54 45 52"

        SPIM_WriteTxData(0x50);

            SPIM_WriteTxData(0x53);

            SPIM_WriteTxData(0x4f);

            SPIM_WriteTxData(0x43); 

             SPIM_WriteTxData(0x4D); 

             SPIM_WriteTxData(0x41); 

             SPIM_WriteTxData(0x53); 

             SPIM_WriteTxData(0x54); 

             SPIM_WriteTxData(0x45); 

            SPIM_WriteTxData(0x52); "

         

        When I write this code, I write the code below to the slave device.The slave device is not loading the first two data into the rfbuffer.if I change the code to "if (RFBuffer [0u] == (0x4f)").  lcd write "OSCMASTER" so the first character "p" is lost.

         

        Slave code:

        for(count=0; count < 10 ; count++)

        {

        RFBuffer[count] =SPIS_ReadRxData();

        }

            /* SPI communication is complete so we can display received data */

             //LCD_ClearDisplay();

            LCD_Position(0u,0u);

            LCD_PrintString("SPI Slave:");

        if(RFBuffer[0u]==(0x50) ){

        LCD_Position(1u,0u);

        LCD_PrintString(RFBuffer);

        LED_Write(1u);

        sendDataToMaster();}

        else {

            LCD_ClearDisplay();

           // CyDelay(100);

            LCD_Position(1u,0u);

        LCD_PrintString("BILGI YOK");

        LED_Write(0u);}   

        }

        • 16. Re: Communication between two psocs with SPI
          AlakanandaB_86

          Hi Burak,

           

          Can you please refer to the below thread and let us know if it would help to solve your issue

           

          Strange behavior of SPIS_PutArray()

           

          Regards

          Alakananda

          1 2 Previous Next