Question
SPI TXE flag interrupt
Posted on January 31, 2012 at 06:01
I'm using the SPI TXE interrupt. My ISR simply checks to see if there is anything more to transmit in the buffer. If there is, it sends it, moves the buffer pointer, and returns. If there isn't anything left to transmit in the buffer, it simply returns. I'm getting stuck in this ISR I think.
I see that the TXE flag is only cleared by writing to the SPI_DR. Since there is no more data to send (at the moment) I don't write to the DR and I think I'm stuck re-entering the ISR over and over.My question is this, is it standard procedure to disable the SPI peripheral at the end of each transfer? Seems kinda silly but I can't imagine another way of getting the TXE flag cleared.