Page 23 - ARM Based Microcontroller Projects Using MBED
P. 23
CHAPTER
2
Microcontroller-Based Project
Development Cycle
2.1 OVERVIEW
Microcontroller-based project development cycle has two stages: program development
cycle (PDC) and hardware development cycle (HDC). Both development cycles are based
around simple loops. In this section we briefly look at both the development cycles.
2.1.1 The Program Development Cycle (PDC)
Fig. 2.1 shows the program development cycle (PDC) which basically consists of developing
the application program. This is usually carried out using a development board (or a develop-
ment kit) incorporating the target microcontroller and additional components and interface de-
vices (e.g., transistors, LEDs, motors, relays, sensors, etc.) that may be required for the project.
At the beginning of the PDC we write the source code using the in-built text editor of the chosen
integrated development environment (IDE). We then compile the source code and remove any
syntax errors or any other compile time errors. Notice that at this stage we are not sure whether
our source code is logically correct or not. At this stage we can either simulate or debug our
source code using the tools offered by the IDE. Using the simulator has the advantage that
we can test our source code on our PC without having to upload the executable code to the
program memory of the target microcontroller. With the help of the simulator we can single
step through our source code, examine the variables, insert breakpoints, modify the variables,
and so on. Simulators are available almost on all IDEs and they are very easy to use. Simulation
helps the programmer to verify that the source code may be logically correct and the application
is probably working. Of course simulation is not same as the real testing using the target hard-
ware. There still could be logical errors and the application may not behave as desired and such
errors will not be shown during the simulation stage. If any errors are detected at the simulation
stage we should go back and correct the source code to remove these errors. After a successful
simulation the next stage in the PDC cycle is to upload the executable code to the program
9
ARM-based Microcontroller Projects Using mbed # 2019 Elsevier Ltd. All rights reserved.
https://doi.org/10.1016/B978-0-08-102969-5.00002-1