SPI communication with SN65HVS882

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

cross mob
RoBe_1502026
Level 4
Level 4
25 replies posted 10 replies posted 5 replies posted

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();
   
    };
 
   
  
}     
 

0 Likes
6 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

There are comments in the line where you access SPIM. Can you please post your complete project, so that we all can have a look at all of your settings. To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.

   

What board are you using?

   

 

   

Bob

0 Likes
lock attach
Attachments are accessible only for community members.
RoBe_1502026
Level 4
Level 4
25 replies posted 10 replies posted 5 replies posted

Here is the file and i am using the Cy8CKIT-050 board for prototyping.

   

-Rob

0 Likes
RoBe_1502026
Level 4
Level 4
25 replies posted 10 replies posted 5 replies posted

Another weird thing is no matter what i seem to do, I can not get the sclk output to show on my logic analyzer. I can see the ld toggle. But no clock.

   

I have even tried a different pin.

   

-Rob

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

I cannot see that the SN65HVS882 has got an SPI interface (apart from Power supply of 10V). You did not connect MOSI. You do not send any information over SPI master.

   

 

   

Bob

0 Likes
RoBe_1502026
Level 4
Level 4
25 replies posted 10 replies posted 5 replies posted

Bob,

   

The datasheet says the chip has a SPI compatable interface. There isnt anything to send to the chip. just trying to de-serialize the data from it. If you need the datasheet I can upload it but its a 8 bit digital input serializer.

   

Is there another way to 'de-serialize' the data from this chip? I only need the numerical value of the serialized data. Not needed to make parallel again.

   

Thanks

   

Rob

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

OK, I saw datasheet and the buffer chip to overcome the supply voltage differences. Still does not look as a (usual) SPIS interface.

   

I am quite sure that the SPIM interface will not fetch any data when you do not send (and wait for completion) any dummy data.

   

 

   

Bob

0 Likes