58 3. EMBEDDED SYSTEMS DESIGN
To develop the UML activity diagram for the system, we can use a top-down, bottom-up, or a
hybrid approach. In the top-down approach, we begin by modeling the overall flow of the algorithm
from a high level. If we choose to use the bottom-up approach, we would begin at the bottom of
the structure chart and choose a subsystem for flow modeling. The specific course of action chosen
depends on project specifics. Often, a combination of both techniques, a hybrid approach, is used.
You should work out all algorithm details at the UML activity diagram level prior to coding any
software. If you can not explain system operation at this higher level, first, you have no business
being down in the detail of developing the code. Therefore, the UML activity diagram should be of
sufficient detail so you can code the algorithm directly from it [Dale].
In the design step, a detailed circuit diagram of the entire system is developed. It will serve
as a roadmap to implement the system. It is also a good idea at this point to investigate available
design information relative to the project. This would include hardware design examples, software
code examples, and application notes available from manufacturers.
At the completion of this step, the prototype design is ready for implementation and testing.
3.2.5 IMPLEMENT PROTOTYPE
To successfully implement a prototype, an incremental approach should be followed. Again, the top-
down design, bottom-up implementation provides a solid guide for system implementation. In an
embedded system design involving both hardware and software, the hardware system including the
microcontroller should be assembled first. This provides the software the required signals to interact
with. As the hardware prototype is assembled on a prototype board, each component is tested for
proper operation as it is brought online. This allows the designer to pinpoint malfunctions as they
occur.
Once the hardware prototype is assembled, coding may commence. As before, software should
be incrementally brought online. You may use a top down, bottom up, or hybrid approach depending
on the nature of the software. The important point is to bring the software online incrementally
such that issues can be identified and corrected early on.
It is highly recommended that low cost stand-in components be used when testing the software
with the hardware components. For example, push buttons, potentiometers, and LEDs may be used
as low cost stand-in component simulators for expensive input instrumentation devices and expensive
output devices such as motors. This allows you to insure the software is properly operating before
using it to control the actual components.
3.2.6 PRELIMINARY TESTING
To test the system, a detailed test plan must be developed. Tests should be developed to verify that
the system meets all of its requirements and also intended system performance in an operational
environment.The test plan should also include scenarios in which the system is used in an unintended
manner. As before a top-down, bottom-up, or hybrid approach can be used to test the system.

Get Arduino Microcontroller, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.