This is my checklist that I use when approaching a new embedded system project using a uController. Its not complete and I add to it whenever I think of new things. There are 3 major goals for this checklist:
I group things into 7 key issues:
1.0 The "Data Path"
2.0 The "Control Path"
3.0 Memory
4.0 Real-Time
5.0 Persistence
6.0 Tools/Development
7.0 Chips and Board
All hardware and software projects should include a requirements analysis, user interface evaluation, documentation, etc. etc. This is not intended to replace all that - just highlight some of the special microcontroller issues we face.
Borrowed from hardware design lingo; the "Data Path" refers to how the microcontroller does its math and data handling. A small PIC 16C54 microcontroller, for example, has an 8-bit data path and is capable of directly doing 8-bit ADDs and SUBs but not Multiplies or Divides. Larger widths can always be accomplished in software, but at the expense of memory and speed.
List any major "functions" or computations. This is NOT a list of all the functions of the program, but rather specific data functions such as a FIR filter, or 'Interpolate PWM Table Values'. Many applications may not need this sort of list (e.g. the Elevator or Traffic Light Controller really does not do any elaborate math functions beyond just adding and subtracting).
Again, borrowed from hardware design lingo; the "Control Path" is the firmware portion that creates the sequence of actions and provides the decision making. State Machines, Rules, etc. make up the control path. Try to establish a sense of how many states, modes, rules, etc. the program needs. Compile some code examples and count the memory and cycles required to do, say, a state machine with 6 states using an 8-bit state variable. You may be surprised! List control variables in the same manner that data variables were cataloged.
List all your major program functions. This is just the outlining of software and not unique to microcontrollers, so I won't say any more.
The analysis done above in sections 1.0 and 2.0 naturally provides an estimate of memory requirements. You should be keeping a column of "words required" for all variables. The total memory required is, of course, always an art of estimation. Judge the risk of choosing too small a memory footprint against the need for room to grow and cost of unused memory. Optimally, pick a microcontroller family with a range of memory sizes within identical packages.
Firmware projects usually have real-time requirements. Some requirements are more stringent than others. Performing the debounce delay for a keypad switch is a much easier real-time contraint than is measuring the frequency of an audio input signal. Some real-time requirements will require simple software tricks while others will require dedicated hardware solutions. Do not confuse this list of real-time "tasks" with general firmware tasks. The key words here are real-time. Also note that I am not refering to a RTOS "task" (BTW: my personal experience has been that I implement my designs in a very state-based manner and have rarely felt the need for a RTOS).
| Task | Description | Latency | Period | Implementation |
| Keyboard Debounce | Detect a switch closure and ignore switch for some debounce period after sensing initial closure. Switches will be fairly clunky mechanical toggle switches. | Soft latency requirement. Detect initial edge no later than 50 ms. Debounce interval is about 250 ms +/- 50 ms | 500 ms | Software down-counters based on some real-time clock (TIMER0). |
| PWM Motor output | Control DC motor speed using PWM. Motor spec sheet specifies typcial PWM parameters. | Soft Latency requirement. | 80 ms PWM period. 8-bit PWM resolution. | Use TIMER1 with PWM setting. |
| User "beeps" | Beep when keypad depressed. Existing Beeper requires square-wave to drive. | Soft latency, but keep below 100 ms to maintain imperceptible delay. | Use a 2000 Hz tone, therefore period is 0.5 ms +/- 5%. Beep duraction is about 100 ms +/- 25%. | Generate square wave by direct program delay loops. THIS IS PRE-EMPTIVE but no other firmware-based hard latency requirement is present. Note that beeping is only required during setup and not during operation when the optical switches are polled. |
| Detect optical "switch"closures from assembly line sensors. | Detect the ENTER and EXIT pulses for the metal ingots. | Must respond to pulses within 1 ms. | Min pulse width is 4 ms, Max pulse width is 1 second. Min period is 25 ms. | Firmware polling. |
Undetected persistence requirements can be a real show-stopper and wreck a project if discovered too late. Persistent variables (or "non-volatile" variables) keep their values even if the box is turned off and on again. For example, your unit may have a network address, some operating parameters, event counters, etc.
The list above will detirmine how much persistence storage is required (e.g. 4 bytes or 4 Kbytes). The number of times any variable changes may detirmine the hardware implementation, for example, most EEPROM memories only allow about 100,000 writes. If you must maintain a persistent variable that changes very, very fast or frequently and is therefore inappropriate for EEPROM or FLASH, then you may have to consider alternatives like battery-backed SRAM, Power Fail Detect or EEPROM with "shadow ram". Some microcontrollers conveniently include some EEPROM. If not, some traditional semiconductor companies offering non-volative memory include; XICOR (EEPROM, EEPROM with "shadow SRAM"), Dallas Semiconductor (Battery-backed SRAM), AMD (FLASH) and ATMEL (FLASH and EEPROM).
The bottom line is to consider persistence very, very carefully.
Here are some key points and ideas:
Again, here are some miscellanious checklist items.