Ground Embedded KO Subscribe

Notes

182 short notes, one per roadmap topic. 179 are available in English so far; the rest open in Korean.

Notes marked KR open in Korean. Your browser's built-in translation works well on those pages.

01 Foundations

C Language

12
  1. 01Variables and types: why we use uint8_tWhy we use fixed-width types such as uint8_t and int16_t instead of int, plus signedness and overflow.
  2. 02Operators and conversions: where bugs hideInteger division, implicit conversions and operator precedence: where bugs like to hide.
  3. 03Control flow: why firmware is an infinite loopBuilding flow with if, switch, for and while, and why firmware is an endless loop.
  4. 04Functions and scope: copies, lifetime, recursionPass-by-value, the lifetime of local and global variables, and why recursion is risky on an MCU.
  5. 05Arrays and strings: how buffer overflow happensContiguous data in memory, null-terminated strings, and how buffer overflows happen.
  6. 06Pointers: handle addresses and the registers appearA variable that holds an address. Reading and writing a specific address is all register control is.
  7. 07Advanced pointers and function pointersPointer arithmetic, double pointers, and function pointers for callbacks and state machines.
  8. 08Structs, unions and bit-fieldsDescribing register blocks and packets with structs, and checking alignment and padding.
  9. 09Bit operations: set, clear, toggleClear with AND, set with OR, toggle with XOR, move with shifts.
  10. 10volatile, const, staticvolatile blocks optimization, const fixes a value, static changes scope and lifetime.
  11. 11The preprocessor and macros#define, conditional compilation, header guards, and the traps macros set.
  12. 12The build process: from source to firmwarePreprocess, compile, assemble, link: how source becomes an executable, and how to read linker errors.

Data Structures & Algorithms

8
  1. 01Time and memory complexity: what to work out first on a small MCUWhy computation and memory use come first on a small MCU.
  2. 02Ring buffer: the bridge between an interrupt and the main loopA circular queue that keeps incoming UART data safe: the bridge between an interrupt and the main loop.
  3. 03Queue and stack: first come and last comeWhat a work queue and a call stack really are, implemented with arrays.
  4. 04Linked lists and memory poolsUsing lists with a pre-allocated pool instead of dynamic allocation.
  5. 05State machine: the basic tool of firmware designOrganising complex sequences as states and transitions. The basic tool of firmware design.
  6. 06Searching and lookup tablesBinary search, and precomputed tables for functions such as sine.
  7. 07CRC and checksums: detecting corrupted dataWriting the calculation that tells you whether data was corrupted in transit.
  8. 08Fixed-point arithmetic: fractions with integersQ formats: handling fractions with integers on an MCU without an FPU.

Digital Logic

8
  1. 01Binary, hexadecimal and two's complementReading register values in hex and how negative numbers are represented.
  2. 02Logic gates and Boolean algebraAND, OR, NOT, XOR, and simplifying expressions with De Morgan's laws.
  3. 03Combinational circuits: decoder, multiplexer, adderDecoders, multiplexers, adders: outputs decided by inputs alone.
  4. 04Flip-flops and registersFlip-flops remember a value on each clock edge; a group of them is a register.
  5. 05Counters and shift registersThe circuits behind MCU timers and SPI.
  6. 06Clocks and timing: setup, hold and metastabilitySetup and hold time, propagation delay, and metastability from asynchronous signals.
  7. 07Logic levels and interfacing: connecting 3.3 V and 5 V3.3 V and 5 V, push-pull and open-drain, and level shifting.
  8. 08A taste of FPGAs: designing hardware in codeDesigning hardware in code, and how that differs from an MCU.

Computer Architecture

10
  1. 01Von Neumann and Harvard architecturesWhether code and data travel the same path or separate ones.
  2. 02Inside the CPU: fetch, decode, executeRegisters, the ALU, the program counter, and the fetch-execute loop.
  3. 03Pipeline: overlapping the handling of instructionsOverlapping several instructions, and why branches are slow.
  4. 04Memory hierarchy: the faster, the smaller and more expensiveRegisters, cache, SRAM, Flash: the faster, the smaller and costlier.
  5. 05Memory map: everything in an MCU has an addressCode in Flash, variables in SRAM. Everything in an MCU has an address.
  6. 06Buses and peripherals: AHB, APB and memory-mapped I/OPeripheral registers live at memory addresses too. AHB, APB and memory-mapped I/O.
  7. 07Stack and heap: where function calls pile upThe stack that grows with every call, and why embedded code is wary of the heap.
  8. 08Interrupts and exceptions: stopping what you are doing and coming backStop, save state, jump to a handler, and return.
  9. 09DMA: the worker that moves data without the CPUHardware that moves data between memory and peripherals without the CPU.
  10. 10ARM Cortex-M overview: from M0 to M7M0, M3, M4, M7, and how MCU families such as STM32 are organised.

02 Hardware

Circuit Theory

10
  1. 01Voltage, current, resistance: start with groundVoltage is a difference between two points. Start with ground and potential.
  2. 02Ohm's law and power: how hot will the part get?V = IR, P = VI. Work out how hot a part will get.
  3. 03Kirchhoff's laws: current is conserved and voltage sums to zero round a loopCurrent into a node equals current out; voltages around a loop sum to zero.
  4. 04Series, parallel and the voltage dividerTwo resistors dividing a voltage. You meet it at every ADC input and sensor.
  5. 05Thevenin and Norton equivalent circuitsReducing a circuit to one source and one resistor to see output impedance.
  6. 06Superposition: solving one source at a timeSolving a multi-source circuit one source at a time and adding the results.
  7. 07Capacitors and the RC time constantA capacitor resists sudden voltage change. τ = RC is the time to reach 63%.
  8. 08Inductors and RL circuits: the voltage spike at turn-offAn inductor resists sudden current change, and why the kick on turn-off is dangerous.
  9. 09AC and impedance: resistance that depends on frequencyResistance that depends on frequency. Calculating AC circuits with phasors.
  10. 10Filters and resonance: keeping only the frequencies you wantThe RC low-pass cutoff 1/(2πRC), and LC resonance.

Electronic Circuits

12
  1. 01Semiconductors and the PN junction: why current flows one wayWhy current flows one way only: the principle shared by diodes and transistors.
  2. 02Diode types: rectifier, Schottky, Zener, LED, TVSRectifier, Schottky, Zener, LED, TVS, and where each is used.
  3. 03BJT switch: a small current switching a large oneA small base current switches a large one. Calculating the base resistor.
  4. 04MOSFET switch: the standard way to switch a large load from an MCUGate voltage, on-resistance, logic-level MOSFETs: the standard way to switch a big load from an MCU.
  5. 05Gate drivers and the half-bridgeTwo MOSFETs stacked, and why the upper one needs a driver.
  6. 06Op-amp basics: calculating with the virtual shortCalculating inverting and non-inverting amplifiers with the virtual short.
  7. 07Op-amp applications: comparator, integrator, filter, differential amplifierComparators, integrators, active filters, differential amplifiers.
  8. 08Current-sensing circuit: reading a few mV with an ADCAmplifying a few millivolts across a shunt for the ADC.
  9. 09Linear regulator: simple, but it gets hotAn LDO is simple but runs hot. Dropout voltage and heat.
  10. 10Switching converter: trading noise for efficiencyBuck and boost: efficient, but noisy, and why.
  11. 11ADC and DAC circuits: analog to numbers, numbers to analogResolution, reference voltage, sampling time, and the RC filter at the input.
  12. 12Protection circuits: ESD, reverse voltage, overcurrentTVS diodes, fuses and reverse-polarity protection against ESD, reverse voltage and overcurrent.

Practical Components

8
  1. 01Choosing resistors: four things that matter more than the valuePower rating, tolerance, temperature coefficient, and packages such as 0402 and 0603.
  2. 02Capacitor types: MLCC, electrolytic, tantalumMLCC, electrolytic, tantalum, and the DC-bias trap that shrinks MLCC capacitance.
  3. 03Inductors and ferrite beadsSaturation current, DCR, and beads that absorb noise.
  4. 04Crystals and oscillators: the source of the MCU clockThe source of the MCU clock. Load capacitors and placement.
  5. 05Connectors and terminals: the number one field failureCurrent rating, pitch, locking: the most common point of failure in the field.
  6. 06Choosing fuses and protection devicesHow to choose polyfuses, TVS diodes and varistors.
  7. 07Pull-ups, pull-downs, decoupling KRResistors that hold a floating pin, and capacitors that steady the supply next to a chip.
  8. 08How to read a datasheetAbsolute maximum ratings, recommended conditions, electrical tables, timing diagrams.

PCB Design

8
  1. 01Drawing schematics: what makes a schematic readableKiCad symbols, net labels and hierarchical sheets for a readable schematic.
  2. 02Placement strategy: connectors firstSeparate power, high-speed and analog areas, and fix connector positions first.
  3. 03Trace width and currentChoosing width from copper thickness and allowed temperature rise.
  4. 04Ground and power planes: follow the return currentDesign ground by thinking about where return current flows.
  5. 05Decoupling placement: close and shortCapacitors close to pins, vias short. Placement alone changes the noise.
  6. 06High-speed signals and impedanceDifferential routing and impedance matching for USB and Ethernet.
  7. 07EMC basics: neither emit nor receiveHabits that keep a board from emitting or picking up noise.
  8. 08Gerber output and ordering: a checklist before sending for fabricationDRC, Gerber and drill files, BOM and placement files for manufacturing.

Test & Debug Instruments

6
  1. 01Multimeter: the first instrument you reach forVoltage, current, resistance and continuity, and common mistakes when measuring current.
  2. 02Oscilloscope: reading a circuit from its waveformsTrigger, timebase, probe compensation. Reading a circuit from its waveform.
  3. 03Logic analyzer: seeing the communication as it isDecoding UART, SPI and I2C to see the traffic itself.
  4. 04Power supply and electronic loadCurrent limit to protect a board, and a load to test the power stage.
  5. 05Debugger: stopping firmware line by lineFlashing and single-stepping firmware with ST-LINK or J-Link.
  6. 06Soldering and reworkSMD soldering, flux, and hot air for removing and fitting parts.

03 Firmware

Machine Code & Assembly

8
  1. 01What one instruction really isMachine code is the numbers the CPU reads; assembly is the names for those numbers.
  2. 02Reading Thumb instructionsMOV, LDR, STR, B and BL on ARM Cortex-M.
  3. 03Registers and the calling conventionArguments in r0 to r3, return address in lr, stack position in sp.
  4. 04C against assembly: what optimisation options changeDisassembling a small C function line by line and comparing optimization levels.
  5. 05Startup code: what happens before main.data is copied to RAM and .bss zeroed before main is called.
  6. 06Linker scripts and sectionsThe file that decides where .text, .data and .bss sit in Flash and RAM.
  7. 07Vector table: the address book of interruptsThe table holding the initial stack value and the handler addresses.
  8. 08HardFault analysis: which line did it die on?Finding the failing line from the registers left on the stack.

MCU Firmware

12
  1. 01Development environment: up to the first blinking LEDSet up STM32CubeIDE, a compiler and a debugger, and light one LED.
  2. 02Registers and HAL: when to use whichDriving registers directly or through a HAL, and when to use which.
  3. 03GPIO: every setting on a single pinInput and output, push-pull and open-drain, internal pull-ups, at register level.
  4. 04Clock tree: where clocks come from and how they are dividedHSE, PLL, prescalers: where the clock comes from and how it is divided.
  5. 05Timers: exact periods and measuring timePeriodic interrupts and measuring time with input capture.
  6. 06PWM KRGenerating PWM with a timer and calculating PSC, ARR and CCR.
  7. 07Interrupts and the NVIC: priorities and short handlersPriorities, why handlers stay short, and shared variables.
  8. 08ADC: single, continuous and timer-synchronised samplingSingle conversion, continuous conversion, and timer-triggered sampling.
  9. 09Using DMA: ADC and UART without the CPUMoving ADC values and UART data to memory without the CPU.
  10. 10Watchdog and low-power modesA watchdog that resets a hung program, and sleep modes for battery devices.
  11. 11Storing settings in Flash and EEPROMKeeping settings across power cycles, and write-cycle limits.
  12. 12Bootloader: how firmware updates itselfHow firmware updates itself, and how memory is partitioned.

Communication Protocols

12
  1. 01Serial communication basics: synchronous, asynchronous, duplex, differentialSynchronous and asynchronous, full and half duplex, single-ended and differential.
  2. 02UART KRCommunication at an agreed speed without a clock. Frame structure and baud-rate error.
  3. 03RS-232, RS-422, RS-485: sending UART furtherVoltage levels and differential signalling that carry UART over distance.
  4. 04SPI: exchanging data on every clockExchanging data on a shared clock. Four modes and multiple slaves.
  5. 05I2C: many chips on two wiresMany chips on two wires. Addresses, ACK and choosing pull-up resistors.
  6. 06CAN: how the vehicle bus worksThe automotive bus where the lowest ID wins on two differential wires.
  7. 07CAN FD: 64 bytes and a faster data phaseUp to 64 data bytes, with a faster data phase.
  8. 08LIN: the low-cost network where the master asks in turnA low-cost vehicle network where one master polls in turn.
  9. 09USB basics: talking to a PC over a virtual serial portDescriptors, endpoints, and a virtual serial port with CDC.
  10. 10Ethernet and TCP/IP: networking on an MCUMAC, PHY, IP, TCP: networking from an MCU.
  11. 11Wireless: choosing BLE, Wi-Fi or LoRaRange, speed and power of BLE, Wi-Fi and LoRa.
  12. 12Protocol design: making your own communication rulesHeader, length, CRC, retransmission: writing your own rules.

RTOS

8
  1. 01Limits of the super loop: when you need an RTOSThe delay and complexity of doing everything in one loop.
  2. 02Tasks and the schedulerSplitting work into tasks, and how the scheduler shares time.
  3. 03Priority and preemption: urgent work firstUrgent tasks pushing less urgent ones aside.
  4. 04Semaphores and mutexes: protecting shared resourcesKeeping two tasks from touching a shared resource at once.
  5. 05Queues and event groups: tasks talking to each otherPassing data and signals between tasks safely.
  6. 06Priority inversion: when a low task blocks a high oneA low task blocking a high one, and priority inheritance.
  7. 07Memory and stack managementSizing each task's stack and detecting overflow.
  8. 08FreeRTOS practice: splitting sensors, communication and control into tasksSensor reading, communication and control as tasks on an STM32.

Firmware Design & Quality

8
  1. 01Layered architecture: upper layers call only downwardsHAL, drivers, services, application, and the direction of dependencies.
  2. 02Modules and interfaces: drawing boundaries with headersDrawing boundaries with headers and hiding the internals.
  3. 03Coding rules: what MISRA C preventsWhat MISRA C forbids, and why.
  4. 04Unit testing: verifying firmware without hardwareTesting firmware logic on a PC without hardware.
  5. 05Static analysis: finding bugs before runningCompiler warnings and tools such as cppcheck that find bugs before running.
  6. 06Version control: keeping firmware history with GitGit branches, commit granularity and release tags for firmware history.
  7. 07Logging and debug outputprintf debugging, ring-buffer logs, real-time trace.
  8. 08Firmware update: changing devices in the field safelyOTA structures that update devices in the field safely.

04 Applications

Control Engineering

10
  1. 01Open loop and closed loop: what feedback doesFeedback means measuring the result and feeding it back into the input.
  2. 02System modelling: first- and second-order systemsDescribing motors, RC circuits and temperature as first- and second-order systems.
  3. 03Laplace transform and transfer functionsTurning differential equations into multiplication and division.
  4. 04Block diagrams: connecting and reducing systems as blocksConnecting systems as blocks and reducing them.
  5. 05Time response: overshoot, settling time, steady-state errorOvershoot, settling time, steady-state error: the common language of performance.
  6. 06PID control: present, past and future errorP reacts to present error, I to accumulated error, D to its rate of change.
  7. 07Stability: why raising the gain makes it divergeWhy raising the gain leads to oscillation and divergence, seen through pole positions.
  8. 08Frequency response and the Bode plotJudging stability with phase margin and gain margin.
  9. 09Digital control: sampling, discretisation and anti-windupSampling period, discretization, and anti-windup against integrator saturation.
  10. 10A taste of state space: several states at onceThe starting point of modern control: handling several states at once.

Sensors & Signal Processing

8
  1. 01Sensor basics: the numbers to look at in a datasheetHow a physical quantity becomes a voltage or data, and reading sensor specs.
  2. 02Sampling and aliasingThe Nyquist frequency, and why you filter before sampling.
  3. 03Digital filters: moving average, IIR, FIRMoving average, IIR and FIR filters computed on an MCU.
  4. 04Kalman filter basics: blending prediction and measurementBlending prediction and measurement for a better estimate.
  5. 05IMU and sensor fusion: tilt from a complementary filterA complementary filter that combines accelerometer and gyro into tilt.
  6. 06Encoders and Hall sensors: measuring rotational position and speedSensing rotor position and speed, and the timer's encoder mode.
  7. 07Distance sensors: ultrasonic, infrared, ToF, lidarUltrasonic, infrared, ToF and lidar: principles and limits.
  8. 08Seeing frequencies with the FFTFinding where vibration and noise are concentrated.

Power Electronics

8
  1. 01The principle of switching: changing voltage without lossHow fast on-off switching changes voltage with almost no loss.
  2. 02Buck converter design: duty, inductor, capacitorCalculating duty cycle, inductor ripple and output capacitance.
  3. 03Boost and buck-boost: raising voltageTopologies that step voltage up, or both up and down.
  4. 04Loss and heat: calculating as far as the heat sinkConduction and switching losses, and choosing a heat sink.
  5. 05Inverter: DC to ACTurning DC into AC. Half bridge and full bridge.
  6. 06Batteries and the BMSLithium cell voltage range, balancing and protection.
  7. 07Isolation and safety: when handling high voltageCreepage and clearance at high voltage, and isolated gate drivers.
  8. 08Measuring power circuits: viewing switching waveforms safelyViewing switching waveforms safely with differential and current probes.

Motor Control

10
  1. 01Electromagnetic basics: force, back-EMF and the torque constantCurrent makes force, motion makes voltage. What back-EMF really is.
  2. 02DC motor and H-bridge: direction and speed controlFour switches set direction; PWM sets speed.
  3. 03Stepper motor: moving by fixed anglesMotors that move in fixed steps, and microstepping.
  4. 04Servo motor: a motor with position feedback built inMotors with built-in position feedback, controlled by pulse width.
  5. 05BLDC structure: electronic switches instead of brushesA motor where electronic switches replace brushes.
  6. 06Six-step drive: pulling the rotor with six combinationsSix switch combinations, chosen by the Hall sensors, pull the rotor around.
  7. 07Three-phase inverter: three half-bridgesThree half bridges, dead time and the bootstrap circuit.
  8. 08Phase current sensing: measuring in step with PWMSampling phase current in sync with the PWM period.
  9. 09FOC: three phase currents into two DC valuesTurning three phase currents into two DC values, d and q, to control torque directly.
  10. 10Current, speed and position loops: fastest on the insideNested from the inside out: where control theory meets firmware.

Embedded Linux

8
  1. 01Linux and shell basicsFile system, permissions, processes, shell scripts.
  2. 02Cross-compiling: building for an ARM board on a PCThe toolchain that builds ARM programs on a PC.
  3. 03Boot process: from power-on to loginBoot ROM, U-Boot, kernel, root file system, in that order.
  4. 04Device tree: telling the kernel how the board is put togetherThe file that tells the kernel which devices sit where on the board.
  5. 05Device drivers: writing a kernel moduleWriting kernel modules that drive GPIO and I2C devices.
  6. 06User-space I/O: handling hardware from an applicationReaching hardware from an application through sysfs, /dev and ioctl.
  7. 07Yocto and Buildroot: building the whole Linux for your boardTools that build a complete Linux image for your board.
  8. 08Real-time Linux: PREEMPT_RT and dividing the rolesPREEMPT_RT, measuring latency, and sharing work with an MCU.

Automotive Software

8
  1. 01Vehicle E/E architecture: from ECUs to the zonal architectureFrom ECUs to domain controllers to zonal architecture.
  2. 02Vehicle networks: where CAN, LIN and Ethernet belongWhere and how CAN, LIN and automotive Ethernet are used.
  3. 03AUTOSAR overview: BSW, RTE, SWCThe standard software structure of BSW, RTE and SWCs.
  4. 04Diagnostic communication: reading fault codes and updating with UDSReading fault codes and updating firmware with UDS services.
  5. 05Functional safety: ISO 26262 and ASILISO 26262, ASIL levels and safety mechanisms.
  6. 06V-model development: a matching verification for every stageA process where every stage from requirements to verification has a matching pair.
  7. 07MIL, SIL and HIL testingWidening verification from model to software to real hardware.
  8. 08Vehicle cybersecurity: ISO 21434 and secure bootISO 21434, secure boot and message authentication.