I have a routine that writes to an LCD display using the processor's SPI peripheral. It writes a databyte to the SPI transmit register then loops until a flag in the status register is set.
Sometimes the display stops working and I look at the debugger probe and find that it is still waiting for the status register flag.
I learned software in the days when all data i/o routines were bit-banging routines written in assembler. As my processor isn't doing anything useful while the SPI data gets sent, would I be better off with a bit-banging routine? It seemed to me that arranging a counter to detect if the flag was not set in a timely fashion seemed a lot more complicated to implement. Or is there a better way?
Sometimes the display stops working and I look at the debugger probe and find that it is still waiting for the status register flag.
I learned software in the days when all data i/o routines were bit-banging routines written in assembler. As my processor isn't doing anything useful while the SPI data gets sent, would I be better off with a bit-banging routine? It seemed to me that arranging a counter to detect if the flag was not set in a timely fashion seemed a lot more complicated to implement. Or is there a better way?