Richard Serge

S908GT32A: No SPRF flag on 1st SPI Tx Byte

Discussion created by Richard Serge on Mar 5, 2007
Latest reply on Mar 10, 2007 by bigmac
On power up I init the SPI (SPE and MSTR set). I store a byte in SPID to send it, and wait until SPRF becomes set. It never does.

When using the Cyclone debugger I can run this same code after a reset and it works fine.

Then I changed the code so that after init I store a byte to the SPID register, then after a short delay (while I do other things) I come back and read the status reg (SPIS) and then the data register (SPID), for the purpose of clearing any SPRF that MAY have become set. After this, SPRF works just fine.

Any clues?

Outcomes