Arduino under the Hood - AVR for Professionals
What you'll learn
- Program and Software Optimizations to reduce Power Consumption
- Stripping away the Arduino library, how does the ATmega work under the Hood?
- All peripherals: Timers, Watchdog, Reset, Brown-Out, Clock Manipulation registers, ADC, Temperatur Sensor (built in), etc.
- Effective Computing for Embedded Systems and the Arduino Platform
- Pointers to Registers in C: An easy guide, on how to access Registers. Make your code efficient.
- Steps in the GNU Compiler Chain: The journey from the Source Code to the Executable
- Ease the Compilation Process: What are Makefiles and how to use them?
- Communciation Protocols (TWI/I2C, SPI U(S)ART, debugWIRE, Bit Banging) of Embedded Systems: How does the MCU communicate and how to configure it?
- How to debug the AVR using debugWIRE? (How to read the Register Contents, step through the Program?)
- What is the purpose of the Boot Loader? How to programming the AVR using without it? (through ISP)
- Protect your Intellectual Property (IP): Fuses and Locks of the AVR
- Develop proficiency in your embedded development skills and confidently take the next steps.
- The documentation is thick, but not scary. Learn how to get the information that you need.
Requirements
- Working Knowledge in C or Arduino
- Soldering/Breadboard Skills for the Examples and Exercises
- Able to work with a Multimeter and read Circuit Diagrams
Description
As one of the most extensive courses available: we will look at everything and more under the hood of Arduino. At its core, the ATmega328P MCU integrates many features that are not exposed through the Arduino library. While learning how the periphery works, the student writes code, exhibiting high performance at low power consumption. Embedded systems deployed in the field and powered by small batteries can run and collect data for years.
The enormous advantage of the AVR platform is that many concepts introduced in this course also apply to other MCUs. Therefore, an entire portfolio of MCUs, ranging from the small ATtiny to the larger ATmega series, becomes accessible. The ATmega328P used in this course is just an example and the gained knowledge is applicable to many embedded systems not limited to the Arduino platform. This is motivated by practical sessions and exercises in which real-world problems are to be solved. In case questions during implementation arise, the student can peek at hints and tips and if nothing works, also at the solutions with plenty of comments in the source code.
This course provides handmade captions in English covering the following topics, which focus on the practical aspects and what a concept can be used for. In addition, the course does not follow a particular outline and the topics can be taken in any order based on the interest and needs. The covered topics include:
GNU Compiler Collection and what happens in every Step and why
A brief introduction to C and Pointers
Moving from the Arduino library to AVR: Less Luxury, faster Execution, fewer Resources
How to compile with Makefiles? Targets, Rules, and Shortcuts
Easy Mistakes in C and how to avoid them
Attack Vectors
Peripheries:
Timers, Counters, and Pulse Width Modulation
Interrupts
Communication Protocols
UART/USART
I2C/TWI
SPI
DHT and 1-Wire
USI
How to mimic other, formerly incompatible, and unsupported Protocols?
Analog-Digital Converter
How does it work?
Measuring the Temperature without external Components
Measuring Battery Level with the ADC
Analog Comparator
Non-volatile Memories
Flash
How to use the Flash (Program Memory) for Constants?
How to use the Flash while executing a Program?
EEPROM
Fuses
Clock Sources
Lock Bits
Debugging
Running the AVR on a Breadboard
Saving power
Sleeping
Dynamic Clock Frequency
Turning off unnecessary Components
Wake-up Sources
Debugging (with practical examples)
Simulators
JTAG
debugWIRE
Bonus Chapter: Parallel Task Execution
After completing this course, the successful student will have the experience not only to evaluate existing software but also create implementations that are highly optimized to be deployed on small microcontrollers to squeeze out every quantum of performance and battery life.
Who this course is for:
- Professional Developers curious about various Program Optimizations for Embedded Systems
- Embedded System and IoT Engineers looking for tips how to reduce Power Consumption and extend Battery Life for the Arduinoi Platform
- Entrepreneurs who want to lauch a product or start-up
Instructor
In my capacity as assistant and adjunct professor at various institutes in India and Singapore, I gained extensive experience how to communicate theoretical concepts. My approach is more practically oriented and I follow the principle: Learning by doing.
Due to my research, I became an expert in cybersecurity with significant practical experience in embedded systems, processor architectures, and FPGAs.
Some successful projects in those areas:
Embedded Systems: Battery powered devices have been deployed in Antarctica to monitor nesting behaviors. Such harsh environments are challenging in terms of components, but especially the limited power resources. The software needed to be highly optimized to squeeze every bit out of those batteries to maximize its operational lifetime.
Processor Architectures: Side-channel attacks are attacks which use a involuntary channels to leak information. Those channels are often unavoidable consequences of computations and include electromagnetic emission or power consumption of the processor. In this project the aim is to harden the processor against side-channel attacks by modifying the processor itself and to make the compiler side-channel aware. The processor that has been used for this project is the new RISC-V.
FPGAs: Those devices are perfect for machine learning (ML) algorithms due to their spatial (parallel) computation capabilities. While interference latencies are usually reduced by using GPUs, those processors have a power budget that is too high for embedded systems. FPGAs offer a flexible alternative, however the data interface to load weights for the neurons is limited. In this project, new algorithms and symmetries are developed to achieve high accuracy and throughput.