Efficient Design With Microcontrollers (Part 1)

[I take the next few posts from C and the 8051]

An efficient microcontroller application involves designing with a minimum of external hardware necessary to allow the software to keep up with all of its tasks.

Efficient is not always an intuitive or even obvious concept. With many years’ experience in assisting customers and teaching students, I have strong personal opinions about what constitutes efficient use of microcontrollers and enumerate a few below:

  1. Transfer as much of the project’s functionality as possible to software. Only if you can have just one processor, and it is quite busy, should you allow yourself more hardware.
  2. Use as few port pins as possible.
  3. If you transfer debouncing and calibration to software, you reduce construction costs and simplify hardware troubleshooting. (Debouncing is discussed beginning on page 321.)
  4. Use functions rather than straight-line programming so code can be re-used.
  5. Use tables, interpolation, and simplified calculations with the smallest-sized variables to make code faster and smaller with simpler math operations.

This is what I mean by “efficient.” Next time I will describe what I see as efficient hardware. Some of these ideas date back many years. Do you think they are outmoded with the higher-performance ICs available today?

Related posts: