2023-05-01 07:03 AM
Unless I'm missing something, I don't see a HT flag documented in the STM32L0X0 reference manual in the USART_ISR register. I see the TC, idle, etc. flags. So how is that interrupt getting triggered (because I have verified it does get triggered)?
EDIT: Also don't see it if I examine the UART SFR in the CubeIDE.
Solved! Go to Solution.
2023-05-01 07:11 AM
You're confusing peripheral level functionality. The DMA controller has a HT (Half-Transfer) and TC (Transfer Complete) indication allowing for a buffer to be split in a ping-pong fashion, and defining an active and inactive portion the IRQ Handler or Callback can manage without interfering with the transfer.
In the U(S)ART context TC means Transmit Complete, that all the bits in the word have crossed the wire. TXE signals when the "buffer" is empty usually as the first bit hits the wire as the buffer is moved into the shift register to move the bits across the wire.
To keep the U(S)ART busy it's usually best to fill based on TXE to insure continuity, and provide about a byte time to service the request
2023-05-01 07:11 AM
You're confusing peripheral level functionality. The DMA controller has a HT (Half-Transfer) and TC (Transfer Complete) indication allowing for a buffer to be split in a ping-pong fashion, and defining an active and inactive portion the IRQ Handler or Callback can manage without interfering with the transfer.
In the U(S)ART context TC means Transmit Complete, that all the bits in the word have crossed the wire. TXE signals when the "buffer" is empty usually as the first bit hits the wire as the buffer is moved into the shift register to move the bits across the wire.
To keep the U(S)ART busy it's usually best to fill based on TXE to insure continuity, and provide about a byte time to service the request
2023-05-01 07:41 AM
Ah, of course, my mistake.