Skip to content
Discussion options

You must be logged in to vote

Serial (UART) is unfortunately inherently very slow. You are sending data at 57600 baud which means each character takes at least 190µs. You can add that up for the messages you are sending, it should pretty closely match the timer increments you see. You cannot speed this up, the serial protocol is just this slow by design.

ufmt::uwriteln!() uses Usart::write_byte() under the hood which synchronously sends out one byte of data. You could instead enqueue your data to be sent into a ring buffer and then transmit the next byte each time the Usart fires its DataRegisterEmpty interrupt. This would at least not block your program during transmission, but you cannot send any more data this way …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by burumdev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants