Programming 8-bit microcontrollers

This example illustrates a solution that was developed for programming a voice menu system for home automation. The system would enable the user to control devices at home remotely over the phone. For example, while driving home from work, you could call in and order the system to turn on the air conditioning and garage lights. The voice menu system is based on an 8-bit microcontroller with limited memory and other resources. Therefore there is no higher-level abstraction layer available for the developers but the controller is programmed with a proprietary, low-level assembler-like language. There are, however, a few system level services that can be called to pass values between the menu software and devices.

The design models in this case are based on the menu logic and flow of the voice controller system. The first model describes the overall menu structure while the other model covers the flow of spoken text and selection mechanism within individual menu items. It is worthwhile to note that even though the target platform and source code are on a very low level, the DSM language can still operate on pure domain concepts like menu item, voice message and menu selection.

Model example

Lifecycle menu example

The evaluation of this DSM case suggested the increase of productivity by a factor of five. Without doubt the main vehicle for this is the raising of the level of abstraction, which sets the developer free from the troublesome coding with assembler. Not only it is faster to design menus on the model level rather than assembler, but DSM also automates lots of error-prone routine coding typical for embedded software like time-outs and error handling. See the sample of the generated code below.

Generated 8bit assembler

Original material © MetaCase, used by permission