Project: Electronics Bash - #17- Control Registers


The code we write for an Arduino is ultimately meant to get certain bits and bytes into the microprocessor so that it does what we want. This week, we'll continue to peek behind the curtain and see how standard Arduino code represents modifications to various places in the microprocessor's memory, and how we can directly access those places to gain faster, tighter, more precise control of the Arduino.

Topics Include:

  • The Three Types of Memory
  • What is a register?
  • Register Access
  • Bitwise Math
  • Introduction to Timers?

Code

The following code will make use of the above circuit diagram

LED Button

Click here to view code on Github

LED Button Registers

Click here to view code on Github

LED Button Registers with with Bitshifting

Click here to view code on Github

LED Button Registers with with Bitshifting

Click here to view code on Github

Pin Change Interrupts

Click here to view code on Github