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.

What is Digital?

Often electronics are divided into analog and digital circuits.
Analog refers to circuits that operate on waveforms that are continuous in the mathematical sense.
That means that any value of amplitude or time may exist in the circuit, so if there is 0 and 5, there can also be the possibility of 2, 3, and 4.9999.

Except for in quantum physics, all real values are continuous. Therefore all circuits are really analog. However, that fact isn’t very useful, so what is being digital all about?

Continue reading “What is Digital?”

Logic Levels

Logic circuits always specify the voltage levels required for correct operation.
Binary digital circuits of course have 1’s and 0’s, which are typically defined as high and low voltage respectively.
There are several different standards for logic levels and it is important to know the implications of mixing logic families with different standards.

Continue reading “Logic Levels”