Abstract
This chapter presents a complete example of building, flashing and executing a microcontroller C++ program using the LED program. The LED program will be built with GCC cross tools in the MinGW/MSYS [5] environment. Our target microcontroller is an 8–bit ATMEL®; AVR®; microcontroller [2]. This popular microcontroller has state-of-the-art quality, widespread availability and a moderate price. In addition, there is a well-maintained GCC port for this microcontroller making it well-suited for our example. In the second half of this chapter, we will investigate efficiency aspects and compiler warnings and errors based on the example of the LED program.
Notes
- 1.
There are tools and methods available for building microcontroller C++ projects. In addition to traditional ∗ nix-style commands, other popular build facilities include GNUmake [3], the Python programming language [8] and SCons [10]. Furthermore, a variety of both cost-free as well as commercial GUIs are available for project management and build.
- 2.
With GCC version 4.7 or later, the newer flag -std=c++11 can be used to select the C++11 language standard.
- 3.
See [11], Chap. 1 in section “Exploring C Warning Messages” and also Appendix A for comprehensive information on GCC’s warning options.
References
ARDUINO®;, ARDUINO ®; (2012), http://www.arduino.cc
ATMEL®;, 8-bit ATMEL ®; Microcontroller with 4/8/16/32K Bytes In-System Programmable Flash (ATmega48A, ATmega48PA, ATmega88A, ATmega88PA, ATmega168A, ATmega168PA, ATmega328, ATmega328P), Rev. 8271D–AVR–05/11 (ATMEL®;, 2011)
Free Software Foundation, GNUmake Version 3.81 (2006), http://www.gnu.org/software/make
IEEE Computer Society, IEEE Std 1149.1—1990: IEEE Standard Test Access Port and Boundary-Scan Architecture (1990), available at http://standards.ieee.org/findstds/standard/1149.1-1990.html
MinGW, Minimalist GNU (2012), http://www.mingw.org
S. Meyers, More Effective C++: 35 New Ways to Improve Your Programs and Designs (Addison Wesley, Reading, 1996)
S. Meyers, Effective C++: 55 Specific Ways to Improve Your Programs and Designs, 3rd edn. (Addison Wesley, Reading, 2005)
Python Software Foundation, Python Programming Language—Official Website (2012), http://www.python.org
M. Schmidt, ARDUINO ®; : A Quick-Start Guide (Pragmatic Programmers, Raleigh, 2011)
SCons, SCons: A Software Construction Tool (2012), http://www.scons.org
W. van Hagen, The Definitive Guide to GCC (Apress, Berkeley, 2006)
Wikipedia, Executable and Linkable Format (2012), http://en.wikipedia.org/wiki/Executable_and_Linkable_Format
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2013 Springer-Verlag Berlin Heidelberg
About this chapter
Cite this chapter
Kormanyos, C. (2013). Working with a Real-Time C++ Program on a Board. In: Real-Time C++. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-34688-0_2
Download citation
DOI: https://doi.org/10.1007/978-3-642-34688-0_2
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-34687-3
Online ISBN: 978-3-642-34688-0
eBook Packages: Computer ScienceComputer Science (R0)