English | 2020 | ISBN: NA | 175 Pages | PDF, EPUB + Extras | 2.8 MB
Eighty percent of embedded system projects can be implemented using a main loop with function calls, and an interrupt routine or two. The remaining twenty percent, for various reasons, are better developed with other run- patterns. Control programs for devices used in open heart surgery, for example, somes reset themselves before each pass through the main control logic. This prevents effects of hidden bugs from accumulating and causing a malfunction. State machines allow functions called from the main loop to handle greater complexity, and longer duration processes, than functions without state machines. Event handlers support processes which occur at random s or repeat at different rates. Message pumps excel at sending messages between computers, or for passing encoded data, from user interface devices to view managers. Fiber managers allow multi-processing capabilities without resorting to some of the tools above. This books presents, with complete ARM Cortex-M source code, a number of examples of different run patterns. The patterns are illustrated by a program using color blobs on an LCD and user interaction with a touchscreen. It also supplies complete source code in C, with Visual Studio Code build folders, of an example program that illustrates all of the patterns discussed, including the run-reset pattern, nested state machines, event handlers, a message pump, a fiber manager, and a combination of event-triggered, interacting state machines. All source code is MIT Licensed, and has been tested on the STM32F7 Discovery board. Since that board supports the mbed interface, the program binary is also available to be loaded into the board over USB.
TO MAC USERS: If RAR password doesn't work, use this archive program:
RAR Expander 0.8.5 Beta 4 and extract password protected files without error.
TO WIN USERS: If RAR password doesn't work, use this archive program:
Latest Winrar and extract password protected files without error.