embedded-engineering
Differences
This shows you the differences between two versions of the page.
| embedded-engineering [June 10, 2026 at 21:12] – created Ivan Janevski | embedded-engineering [June 10, 2026 at 22:31] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| # Embedded engineering | # Embedded engineering | ||
| + | **Embedded engineering** is the discipline of writing software for microcontrollers (MCUs) and other resource-constrained hardware that is dedicated to a single task or a fixed set of tasks. Unlike general-purpose computing, an embedded system usually has no operating system, no display, and no user interacting with it directly — it just runs, often for years without being rebooted, inside some larger device. | ||
| + | |||
| + | The constraints define the work. An MCU might have 64 KB of flash for program storage, 8 KB of RAM, and a clock running at 16 MHz. There is no virtual memory, no dynamic allocator you can trust, and no second chance if you corrupt the stack. This forces habits that general-purpose programmers rarely need: careful memory layout, deterministic timing, interrupt-driven design, and an intimate understanding of the hardware peripherals you are driving. | ||
| + | |||
| + | ## Microcontrollers | ||
| + | |||
| + | A microcontroller integrates a CPU core, flash memory, RAM, and peripherals (GPIO, UART, SPI, I2C, ADC, timers) onto a single chip. Common families include PIC (Microchip), | ||
| + | |||
| + | Most MCUs follow the [[harvard-architecture|Harvard architecture]]: | ||
| + | |||
| + | ## Communicating with peripherals | ||
| + | |||
| + | Peripherals on an MCU are controlled through memory-mapped registers. Writing a value to a specific address sets a pin high, configures a baud rate, or triggers a DMA transfer. The three dominant serial buses are [[uart|UART]] (asynchronous, | ||
| + | |||
| + | Interrupts are the primary mechanism for reacting to hardware events without polling. When a peripheral finishes a transfer or a pin changes state, it fires an interrupt that suspends the main loop, runs an interrupt service routine (ISR), and returns. ISRs must be short and must not block — any variable shared between an ISR and the main loop needs to be declared `volatile` so the compiler doesn' | ||
| + | |||
| + | ## RTOS | ||
| + | |||
| + | A real-time operating system ([[rtos|RTOS]]) sits between bare-metal and a full OS. It provides a task scheduler, mutexes, semaphores, queues, and timers, without the overhead of a general-purpose kernel. FreeRTOS and ZephyrOS are the two most common choices. The key guarantee an RTOS provides is **deterministic timing**: a task with a given priority will run within a bounded deadline. This matters in control loops, motor drivers, and anything that interacts with the physical world on a fixed schedule. | ||
| + | |||
| + | ## List of concepts | ||
| + | |||
| + | - [[list-of-embedded-engineering-concepts]] | ||
| - | ## List of embedded engineering concepts | ||
| - | - [[harvard-architecture]] | ||
embedded-engineering.1781125976.txt.gz · Last modified: by Ivan Janevski
