6 Replies Latest reply on Apr 7, 2017 1:40 AM by user_1377889

    SPI communication with SN65HVS882

    rjberry_1502026

      Hi,

         

      Trying to get a 5LP communicating with a TI SN65HVS882 Serializer.

         

      I am basiclly using the sample SPI code to test but not seeing any data on the lcd. Any suggestions?

         

      CODE:

         


      int main()
      {
          uint8 i = 0u;
         
          /* Software buffers use internal interrupt functionality to interact with
          * hardware buffers. Thus global interrupt enable command should be called
          */
          CyGlobalIntEnable;
         
          /* We need to start Character LCD, SPI Master and Slave components */
          LCD_Start();
         SPIM_Start();
         
          /* SPI communication is provided in Mode 0. So, the first byte
          * should be written directly to the SPI Slave
          */
      ///    SPIS_WriteTxDataZero(0x11u);
         
          /* We need to know the moment when SPI communication is complete
          * to display received data. SPIS_SPI_DONE status should be polled.
          */
       //   while(!(SPIS_ReadTxStatus() & SPIS_STS_SPI_DONE));
         
          /* SPI communication is complete so we can display received data */
          while(1u) {
          LCD_Position(0u,0u);
          LCD_PrintString("SPIM Rx data:");
         
          LCD_Position(1u,0u);
           ld_Write(1);
          for(i=0u; i<8u; i++)
          {
              /* Read from SPIM Rx software buffer */
              LCD_PrintHexUint8(SPIM_ReadRxData()); 
          
          }
            // ld_Write(0);
          CyDelay(400u);
          ld_Write(0);
          LCD_ClearDisplay();
         
          };
       
         
        
      }