Embedded Notes

Key notes from The Art of Designing Embedded Systems.

Partition projects into as many small, independent pieces as possible to maximize efficiency and reliability. This can mean adding subprocessors to handle smaller tasks.

More people on a team is not better. Higher performing coders perform better on smaller, not larger, tasks.

Code inspections and careful design are more reliable than testing and debugging. Specs are key.
Design with the aid of high level goals, objectives, assumptions (“contracts”) for each function, such as this parameter must not be zero, the result must be smaller than x, this peripheral must be enabled, etc.

Real time tasks must finish before some deadline. Instrument the code with I/O’s that can be measured on an oscilloscope to see margin. Higher loaded processors imply significantly higher effort.

Interrupts and asynchronous code are very dangerous. Hardware based interrupts are typically asynchronous. All code must be re-entrant, where all used data including hardware manipulations are “atomic”, meaning the operation cannot be interrupted and modified by other code.

Be aware of EMI and SI.

Debounce switches in HW or SW. HW debounce requires Schmitt trigger input logic. SW debounce should poll and make sure x number of consecutive values are equal (shift register). For “instant” response to user input, react within 50 to 100 ms.

Developers are most effective when not interrupted, above even experience or skill level.

Use a version control system, use a firmware design standard, do code inspections, create quiet environment for thinking, measure bug and production rates, constantly try to study and improve.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.