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.

Using AM3359 SPI as a slave

Other Parts Discussed in Thread: AM3359

?retsam eht ot de'cnys evals eht teg I litnu sgnittes ezis tib tnereffid htiw yalp neht dna htiw detrats ti stib egabrag ynam woh tuo erugif ot deen yllaer I oD  .drow tib-23 a fo tib tsrif eht eviecer ot ydaer ti steg eseht fo rehtien dna ,elbane dna elbasid ,teser tfos deirt evah I  .od I tahw rettam on sdrow detfihs gniviecer no speek dna ,retnuoc tib eht ni rebmun modnar emos htiw stib gniviecer strats tI  ?evals a sa gninnur si ti nehw tnuoc tib s'retsam eht ot cnyser ot IPS 9533MA eht teg I od woH

  • Your post is backwards and upside down. If this is a joke, then it's a bad one. Nobody is going to waste time trying to read this. Please post normally.
  • That was NOT my choice:  I typed my question in the normal manner, and the TI website displayed it as if I was writing in some language that runs that way.  I found nothing on the web page to make it run left-to-right.  So I typed in the entire (serious) question in case it was just a glitch that the website would correct later.  Here's the question, now that it is working right:

    How do I get the AM3359 SPI to resync to the master's bit count when it is running as a slave?  It starts receiving bits with some random number in the bit counter, and keeps on receiving shifted words no matter what I do.  I have tried soft reset, disable and enable, and neither of these gets it ready to receive the first bit of a 32-bit word.  Do I really need to figure out how many garbage bits it started with and play with different bit size settings until I get the slave sync'ed to the master? 

    I could deal with bit-shifted incoming data (by using an HDLC-like sync header) but this bit offset also messes up data in the MISO direction by transferring TxFIFO words into the shift register before the whole word is transmitted.

    I have my master setup to remove SPI_CSN in between each 32-bit word it sends, and I can see this is done perfectly on my logic analyzer.  The same master also reads perfectly from a serial flash chip, so there is nothing wrong with the master.

  • Never mind:  I figured it out myself in the lab.

    The answer is to disable the channel, rewrite the channel configuration register (that contains the word length), and then reenable the channel.  Apparently, setting the word length resets the internal bit counter even if the word length does not change.

  • Hi Guy,
     
    Sorry for my first post - we have never seen this issue before on the forum. I will report it to be investigated. And thanks for sharing how you solved your problem - this is helpful for other people.