ARDUINO IN-DEPTH

TOPIC

DESCRIPTION

RESOURCE TYPE

Arduino Registers

To use the more advanced features of Arduino, or to optimize your code, we need to understand how to work directly with microcontroller registers. Video: https://www.sparkfun.com/news/2577
Finite State Machines

Introduction to FSM.

Intro to Yakindu Statechart Tools that model your system and then generate code from it.

Text: Finite State Machines
Sketch on Github  Local sketch

Finite State Machines & MCUs

Using Finite State Machines (FSM) is a common industrial practice in coding. They can easily be used in projects to help prevent bugs, to stop infinite loops hogging the processor, and to ease debugging. Instructables text and sketch.

Sparkfun FSM explained, and an example sketch using Blink.ino

Majenko FSM explained, and an example using a parking lot access gate.

Text 1: Instructables  Sketch 1: StateMachine.ino

Text 2: Sparkfun  Sketch 2: Blink_FSM.ino

Text 3: Majenko Tech Sketch 3: Access_Gate_FSM.ino

Multitasking the Arduino - Part 1 Sweep uses the delay() function to control the servo sweep speed. If you try to combine the basic Blink sketch (delays blinks on and off) with the servo sweep example, you'll find it alternates between blinking and sweeping but it cannot do both simultaneously. This article takes you through running 5 tasks simultaneously while also reading a user switch for presses. Great intro to multitasking.

Text and sketches.

Sketches: Blink, Servo_Sweep, Blink_without_Delay2, Flash_without_Delay2, Flash_2_LEDs_without_Delay,

Class_and_Constructor, Sweep, 5_Tasks, 5_Tasks_and_Switch.

Multitasking the Arduino - Part 2

Learn how to harness the timer interrupts to keep everything running like clockwork. Explore using interrupts to give us notifications of external events.

Text and sketches.

Sketches:

Multitasking the Arduino - Part 3    
More on Multitasking - 4 parts 1) How to multitask an Arduino, 2) RTOS: Getting Started with ChibiOS, 3) RTOS: ChibiOS Messages, 4) RTOS: ChibiOS Mutexes and Priorities. Youtube videos.
Arduino Timers and Interrupts This tutorial shows the use of timers and interrupts for Arduino boards. As Arduino programmers, we have used timers and interrupts without knowledge because all the low level hardware stuff is hidden by the Arduino API.

Text and sketches.

Sketches: ArduinoTimer101.zip, Arduino101-Timers.zip

Arduino ATmegaxx8 Timers & Interrupts

External Interrupts External interrupts on Uno require the use of pins D2 and D3 only, whereas M0-based boards usually support external interrupts on most digital pins.

Text: attachInterrupt() and detachInterrupt()

Arduino PWM Pulse width modulation Text.
Adjusting PWM Frequencies Cheatsheet. Text.
Timer 1 and Timer 3 Libraries Timer libraries that let you configure timers to generate interrupts.

Text, sketches, libraries.

Sketch: Flashers_Sweepers_Interrupts

What exactly is a GPIO pin? More info on DDxn and PORTxn and Pxn Text.
Inside AVR Microcontrollers Kanda have been making trainers for AVR and PIC microcontrollers for years and they include microcontroller courses for beginners. If you want a quick result, go for Arduino. If you want to learn microcontrollers, have a look at their training kits. I'm using the  STK200-X with Atmel Studio 7. Website.

Home