Ohmwork
0 XP
C12Core EE

Embedded systems in MicroPython and C

Builds programs for a microcontroller in both MicroPython and C, and knows when each fits; reads a datasheet's register map and drives the hardware through it; budgets flash, RAM and stack; handles inputs, timers, interrupts, input capture and encoders; reads sensors through a correctly driven ADC, filters them in integer arithmetic, and drives outputs and loads through PWM, transistor switches and the DAC with fixed-point arithmetic; talks to devices over UART, I²C and SPI; structures programs as state machines, superloops and preemptive tasks whose response times are proven; closes control loops in firmware; budgets power with sleep and keeps data safely in flash; debugs with breakpoints and tests code off the target. Five labs and a project combine Python tools with code on the course's own board: a 10 MHz RISC-V microcontroller whose C is compiled by the course's own compiler and whose MicroPython is the real interpreter. Midterm and final exams.

0%0 of 55 pages

Test out of C12Already know this? Answer a few questions from its final exam, pass, and the whole course counts as finished.

130 h · 55 pages · After C8, C1

Unit 1The board, blinking, bits and memory6
  1. The board, its pins and its datasheet1.5 h
  2. Blinking an LED in MicroPython2 h
  3. Blinking an LED in C2 h
  4. C for small machines2 h
  5. Memory on small machines1.5 h
  6. Problem set 1Problem set · 4 h
Unit 2Inputs, debouncing and debugging4
  1. Digital inputs and pull-up resistors2 h
  2. Debouncing buttons2 h
  3. Debugging with breakpoints and stepping2 h
  4. Problem set 2Problem set · 4 h
Unit 3Inputs, timers and interrupts4
  1. Hardware timers2 h
  2. Interrupts2 h
  3. Capturing time and counting motion2 h
  4. Problem set 3Problem set · 4 h
Unit 4Sensors, the ADC's input, fixed point and filters6
  1. Embedded lab: registers and timingLab · 3 h
  2. Reading sensors with the ADC2 h
  3. The ADC's input2 h
  4. Fixed-point arithmetic2 h
  5. Filtering in firmware2 h
  6. Problem set 4Problem set · 4 h
Unit 5Analog in and out5
  1. PWM for LEDs and motors2 h
  2. Driving loads2 h
  3. Making sound with PWM1.5 h
  4. The DAC and waveform generation2 h
  5. Problem set 5Problem set · 4 h
Unit 6The UART, ring buffers and I²C5
  1. Embedded lab: signals in and outLab · 2.5 h
  2. Serial communication and the UART2 h
  3. Ring buffers and interrupt-driven serial2 h
  4. I²C and a temperature sensor2 h
  5. Problem set 6Problem set · 4 h
  1. Midterm examMidterm · 4 h
Unit 7Communication3
  1. SPI, shift registers and displays2 h
  2. Commands over serial2 h
  3. Problem set 7Problem set · 4 h
Unit 8State machines, scheduling and real time6
  1. Embedded lab: talking to the outsideLab · 2.5 h
  2. State machines2 h
  3. Superloops and cooperative scheduling2 h
  4. Preemptive scheduling2 h
  5. Latency, jitter and deadlines2 h
  6. Problem set 8Problem set · 4 h
Unit 9Structure, timing, power and storage5
  1. Watchdogs and robust firmware2 h
  2. Power budgets and sleep2 h
  3. Keeping data through power-off2 h
  4. Bootloaders and firmware updates85 min
  5. Problem set 9Problem set · 4 h
Unit 10Watchdogs, power, flash and control3
  1. Control loops in firmware2 h
  2. Embedded lab: systems that lastLab · 2.5 h
  3. Problem set 10Problem set · 4 h
Unit 11Languages, testing and whole-system design3
  1. Comparing MicroPython and C2 h
  2. Testing embedded code2 h
  3. Problem set 11Problem set · 4 h
Unit 12Embedded systems across the course3
  1. Embedded lab: a data loggerLab · 2 h
  2. Project: a thermostat in both languagesProject · 1.5 h
  3. Problem set 12Problem set · 4 h
  1. Final examFinal exam · 4 h