C12 Embedded systems in MicroPython and C · Practice
Embedded lab: a data logger
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
A sampling ISR of 400 cycles runs 100 times a second. What share of the processor does it use?
Check
A logger keeps 10 s of readings at 10 Hz, 4 bytes each. How much RAM does its buffer need?
Check
A report line is 32 characters at 9600 baud. How long does it take to send?
Write units the way you normally would: 1.5 ms, 1500 µs and 0.0015 s are the same answer.
Check
N = 4 readings in tenths sum to 1007. What does (sum + N/2) / N give, in integer arithmetic?
Check
The logger averages 0.55 mA from a 220 mAh battery. How many days does it run?
Check
Part 2: the readings are below, each plus OFFSET (0). Print their minimum, their maximum and their average rounded to the nearest whole tenth, in integer arithmetic.
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
Part 3: send T= and the value W * 10 + D tenths of a degree (7.0) as a decimal number with one decimal place, then a newline.
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
Load of a 300-cycle ISR at 20 Hz?
Check
RAM for 30 s at 5 Hz, 2 bytes each?
Check
Rounded average of 8 readings summing to 512?
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