This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28379S: converting TI t-format code to slave

Part Number: TMS320F28379S

Hello, I am trying to use the extant CLB used in the t-format master code to help make a slave version.

Initially, a value (say 0xAE) is sent to the processor on the spisimo pin. This value also has a start and stop bit, so the length is 10 bits.

I set tformat_configureCLBLen( 0, sendClks, receiveClks + 2); 

expecting that this will allow the CLB to skip the mast transmit state and go to the WAIT state to capture the falling edge of start bit which is part of the value I send to the spi over the spisimo pin. This pin is connected to the CLB through an XBARINPUT to pin 1 of the CLB which is supposed to detect a falling edge and start the receive clock for the encoder.

OK. I can send the value and start the clock but it does not seem as though anything is shifted into the spi shift register- at least I can't find any evidence of it.

The spiste\ is connected to ground as recommended, the interface is in read mode, txen does not flicker, still nothing seems to get into the spi.

Can anyone help me?

Thank you, Don Morgan

  • I will let our encoder expert answer this.

     can you comment?

  • Some more data.

    I found the spi receive interrupt is apparently firing on its own. From the moment I start the program, it seems to run continuously about 20,000,000 ( used a counter) before it stalls. After that, the clb interrupt that detects the falling edge on the sipsimo pin still works and triggers the clock but the fifospi interrupt does not work.

    I though maybe data was being overwritten but it does not appear to be the case, all the data is just 0xffff.

    Don

  • A bit more data.

    Except for the way I have configured the CLB (above) I prepared code that was the same as the example, except that it calls DATAID5 which is my own. It this routine only the CLB is set, I don't read or write anything.

    Once started the receive interrupt fires repeatedly  even with nothing on the input (spisimo is dormant). If I do send data nothing happens, no spi clocks are started, nothing.

    After a huge number of interrupts which vector through interrupt void spiRxFIFOISR, the interrupts stop being triggered and I can manually indicate dataReady = 1 and I will get spi clocks if I send a character to spisimo.

    Don

  • Don,

    The t-format encoder interface (I'll call it the "primary") we provide generates the SPI clock using the CLB.  This shifts the data through the SPI to send the data, but the clock itself is not sent out to the encoder over t-format.  The interface is equivalent to an RS 485 differential line driver/receiver.  

    I'm not quite sure how your encoder setup is connected.  The encoder side would wait for the incoming data and interpret the 1's and 0's being sent by the primary. 

    Regards

    Lori

  • Yes, this sounds like what I am doing but after the primary sends its command doesn't wait for the encoder to respond?

    Anyway, if I set it up this way, I can send a word to the encoder and when the encoder responds, I see the CLB unit issuing clocks but nothing recognizable as the data I sent appears in the fifos or buffers or any of the registers I sent up to capture it.

  • OK, I think I have this under control.

    I can now receive and see the data I send. It looks like a combination of things, miswiring and software.

    Thanks everyone for your help.

    Don

  • Good to hear! Thank you for letting me know.

    Regards

    Lori