C12 Embedded systems in MicroPython and C · Practice
Serial communication and the UART
Problems dealt one at a time, with new numbers every time. The kinds you miss come back more often, and you can keep going as long as you like.
Check
How long is one bit at 57600 baud?
Write units the way you normally would: 1.5 µs, 1500 ns and 0.0015 ms are the same answer.
Check
How long does it take to send 1 bytes at 9600 baud, back to back?
Write units the way you normally would: 1.5 ms, 1500 µs and 0.0015 s are the same answer.
Check
What BAUDDIV comes closest to 38400 baud on the 10 MHz board?
Check
With BAUDDIV rounded, how far off 230400 baud is the board, in percent (negative if slow)?
Check
The byte 4B is sent. Write its eight data bits in the order they appear on the wire, first bit on the left, as a binary number.
Check
What's the most bytes per second a UART can send at 4800 baud, with 8 data bits and one stop bit?
Check
Send the text N= followed by the number N (307) in decimal and a newline, at 115,200 baud. (Convert the number to digits yourself.)
C on the course's RISC-V board (10 MHz, no floating point). #include "board.h" for the registers; print(x) shows a number. Tab indents; press Esc and then Tab to move on.
Check
The UART runs at baud; 57600 baud is wanted.
(a)
What BAUDDIV?
(b)
How far off is the actual rate?
Check
A UART at 115200 baud uses 8 data bits, no parity and 1 stop bit(s).
(a)
How long does one byte take?
Write units the way you normally would: 1.5 µs, 1500 ns and 0.0015 ms are the same answer.
(b)
How many bytes per second?
Check
Bit time at 38400 baud?
Write units the way you normally would: 1.5 µs, 1500 ns and 0.0015 ms are the same answer.
Check
Time for 10 bytes at 57600 baud?
Write units the way you normally would: 1.5 ms, 1500 µs and 0.0015 s are the same answer.
Check
BAUDDIV for 31250 baud?
A kind of problem counts as solid once you've got it right on the first try twice in a row. Back to the lesson · Practice every topic in C12