Forum Discussion
Altera_Forum
Honored Contributor
12 years agoThat seems like an avoidance, not a fix.
If your old code was just writing to the uart tx register/fifo then it probably wasn't using any interrupts at all. It might have just relied on the code being slow enough to never fill the uart fifo (does it even have a fifo?). You should check for space in the fifo before writing data bytes. I've not looked at how that uart works, but at a guess you need to enable the 'tx space' interrupt when there isn't enough room for the byte being sent and disable it again (in the ISR) when the ISR has emptied the software transmit fifo. This does all mean that you might just as well allocate the memory to a hardware fifo instead of a software one - after all the code has to allow for any software fifo being full as well, and the code to handle a hardware tx fifo will be simpler.