Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
C Programming for Arduino

You're reading from  C Programming for Arduino

Product type Book
Published in May 2013
Publisher Packt
ISBN-13 9781849517584
Pages 512 pages
Edition 1st Edition
Languages
Author (1):
Julien Bayle Julien Bayle
Profile icon Julien Bayle

Table of Contents (21) Chapters

C Programming for Arduino
Credits
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Preface
Let's Plug Things First Contact with C C Basics – Making You Stronger Improve Programming with Functions, Math, and Timing Sensing with Digital Inputs Sensing the World – Feeling with Analog Inputs Talking over Serial Designing Visual Output Feedback Making Things Move and Creating Sounds Some Advanced Techniques Networking Playing with Max 6 Framework Improving your C Programming and Creating Libraries Index

Understanding Arduino software architecture


In order to understand how to make our nice Arduino board work exactly as we want it to, we have to understand the global software architecture and the toolchain that we'll be using quite soon.

Take your Arduino board in hand. You'll see a rectangle-shaped IC with the word ATMEL written on the top; this is the processor.

This processor is the place that will contain the entire program that we'll write and that will make things happen.

When we buy (check Appendix G, List of Components' Distributors, and this link: http://arduino.cc/en/Main/Buy) an Arduino, the processor, also named chipset, is preburnt. It has been programmed by careful people in order to make our life easier. The program already contained in the chipset is called the bootloader (http://en.wikipedia.org/wiki/Booting). Basically, it takes care of the very first moment of awakening of the processor life when you supply it some power. But its major role is the load of our firmware (http://en.wikipedia.org/wiki/Firmware), I mean, our precious compiled program.

Let's have a look at a small diagram for better understanding:

I like to define it by saying that the bootloader is the hardware's software and the firmware is the user's software. Indeed, it also has some significance because memory spaces in the chipset are not equal for write operations (within a specific hardware which we'll discuss in the future sections of this book). Using a programmer, we cannot overwrite the bootloader (which is safer at this point of our reading) but only the firmware. This will be more than enough even for advanced purposed, as you'll see all along the book.

Not all Arduino boards' bootloaders are equivalent. Indeed, they have been made to be very specific to the hardware part, which provides us more abstraction of the hardware; we can focus on higher levels of design because the bootloader provides us services such as firmware upload via USB and serial monitoring.

Let's now download some required software:

Processing is used in this book but isn't necessary to program and use Arduino boards.

Tip

What is the Arduino's toolchain?

Usually, we call Arduino's toolchain a set of software tools required to handle all steps from the C code we are typing in the Arduino IDE on our computer to the firmware uploaded on the board. Indeed, the C code you type has to be prepared before the compilation step with avr-gcc and avr-g++ compilers. Once the resulting object's files are linked by some other programs of the toolchain, into usually only one file, you are done. This can later be uploaded to the board. There are other ways to use Arduino boards and we'll introduce that in the last chapter of this book.

You have been reading a chapter from
C Programming for Arduino
Published in: May 2013 Publisher: Packt ISBN-13: 9781849517584
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}