Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years, 10 months ago.
Checking if Serial transmit FIFO empty
Hi.
I'm writing a 9 bit serial class, but I'm having troubles aroung the transmit FIFO.
The way I'm transmitting bytes, is by forcing parity bit high or low, distinguishing between addresses or data. This works as it should. But: When transmitting an address, with the pairty set high, and immediately after, transmitting a data byte, after forcing the parity to 0, will cause the data to look like an address.
I can come around this by waiting a calculated time, for the transmitter to transmit the data, but this is not good programming. I've tried a lot with different registers, reading the LSR register, checking for empty THRE, and so on.
Are there any chance this can be done by reading a register?
I've gone through the user manual of the LPC1768 several times now, now indication of empty transmit buffer anywhere. Help?
Thanks, Lerche
1 Answer
10 years, 10 months ago.
Isn't it bit 6 of the UARTn Line Status Register? I think that should tell it when both the fifo is empty and nothing is being shifted out anymore.