Skip to main content
Top

2020 | Book

Arduino Software Internals

A Complete Guide to How Your Arduino Language and Hardware Work Together

insite
SEARCH

About this book

It’s not enough to just build your Arduino projects; it’s time to actually learn how things work! This book will take you through not only how to use the Arduino software and hardware, but more importantly show you how it all works and how the software relates to the hardware.
Arduino Software Internals takes a detailed dive into the Arduino environment. We’ll cover the Arduino language, hardware features, and how makers can finally ease themselves away from the hand holding of the Arduino environment and move towards coding in plain AVR C++ and talk to the microcontroller in its native language.
What You’ll Learn:How the Arduino Language interfaces with the hardware, as well as how it actually works in C++;How the compilation system works, and how kit can be altered to suit personal requirements;A small amount of AVR Assembly Language;Exactly how to set up and use the various hardware features of the AVR without needing to try and decode the data sheets – which are often bug ridden and unclear;Alternatives to the Arduino IDE which might give them a better workflow;How to build their own Arduino clone from scratch.
Who This Book Is For: No expertise is required for this book! All you need is an interest in learning about what you’re making with Arduinos and how they work. This book is also useful for those looking to understand the AVR microcontroller used in the Arduino boards. In other words, all Makers are welcome!

Table of Contents

Frontmatter
Chapter 1. Introduction
Abstract
The Arduino is a great system for getting people into making with electronics and microcontrollers. I was reintroduced to a long-lost hobby when I was gifted an Arduino Duemilanove (aka 2009) by my wife’s late grandmother, and since then, I’ve had lots of fun learning and attempting to build things. I’ve even built a number of Arduino clones based on just the AVR microcontroller and a few passive components – it’s cheaper than fitting a new Arduino into a project!
Norman Dunbar
Chapter 2. Arduino Compilation
Abstract
This chapter is all about what happens when you compile an Arduino sketch and how the various header files are used. Hopefully, by the time you have read (and understood) this chapter of the book, you’ll have a much better idea of what happens during the compilation of an Arduino sketch. However, before we dive into the gory details of a sketch’s compilation, we need to understand a bit about some of the text files that live in and around the $ARDINST directory.
Norman Dunbar
Chapter 3. Arduino Language Reference
Abstract
In this chapter, I look at the Arduino-specific features of the C/C++ language which relate to the AVR microcontroller and how it operates, as opposed to looking at the C/C++ language in general.
Norman Dunbar
Chapter 4. Arduino Classes
Abstract
This chapter investigates the various C++ classes supplied as part of the Arduino Language and which help, in most cases, to make the programmer’s life easier when using features of the Arduino board (and the ATmega328P) such as the serial interface.
Norman Dunbar
Chapter 5. Converting to the AVR Language
Abstract
This chapter briefly explains how you can begin to wean yourself off of the helpful features of the Arduino Language and write code that is in the AVR’s own variant of C/C++ which can greatly reduce the size of your compiled code and could make the difference in fitting your project into an ATtiny85, for example, rather than needing a full-blown ATmega328P.
Norman Dunbar
Chapter 6. Alternatives to the Arduino IDE
Abstract
A number of alternatives to the Arduino IDE exist. Some are massive overkill such as the Atmel Studio 7 (www.microchip.com/mplab/avr-support/atmel-studio-7), based on Microsoft Visual Studio and which only runs on Windows, and MPLAB-X (www.microchip.com/mplab/mplab-x-ide). Others such as the AVR Eclipse Plugin (http://avr-eclipse.sourceforge.net/wiki/index.php/The_AVR_Eclipse_Plugin) are plugins for the Eclipse IDE, a Java-based IDE on steroids, and again quite large. This chapter looks at two other, smaller, alternatives and the two which I will be investigating here are
Norman Dunbar
Chapter 7. ATmega328P Configuration and Management
Abstract
In these last three chapters, I’ll dig deeper into the ATmega328P microcontroller itself and take a look at some very important features of the device, many of which are either ignored, unused, or just too confusing as you read through the data sheet.
Norman Dunbar
Chapter 8. ATmega328P Hardware: Timers and Counters
Abstract
This chapter and the next look at the hardware features of the ATmega328P and should link up with the information presented in Chapters 2 and 3. You should, I hope, see how the Arduino Language talks to the hardware described in these chapters. This chapter starts by looking, long and hard, at the facilities of the ATmega’s timer/counters, while the following chapter delves into the ADC and serial communications hardware, the USART.
Norman Dunbar
Chapter 9. ATmega328P Hardware: ADC and USART
Abstract
This chapter continues our look at the various hardware components of the ATmega328P. Some of them are not visible ("surfaced") in the Arduino IDE or Language, so they may at first appear new to you – the Analogue Comparator, for example.
Norman Dunbar
Backmatter
Metadata
Title
Arduino Software Internals
Author
Norman Dunbar
Copyright Year
2020
Publisher
Apress
Electronic ISBN
978-1-4842-5790-6
Print ISBN
978-1-4842-5789-0
DOI
https://doi.org/10.1007/978-1-4842-5790-6

Premium Partner