Requirements:
- 1 Arduino Uno (with ATmega328p).
brew install avr-gcc avrdude
- Warm-up: write the blink program for Arduino.
- Now write it using C, avr-gcc and avrdude.
- Turn it into a benchmark: blink 1,000,000 times and then spin.
- Compare the time to 1,000,000 blinks for Arduino vs C.
Resources:
- ATmega328p datasheet, appnotes: https://www.microchip.com/wwwproducts/en/ATmega328p
- avr-gcc wiki: https://gcc.gnu.org/wiki/avr-gcc
- avr libc: https://www.nongnu.org/avr-libc/
- adafruit avr-gcc blinky tutorial: https://www.ladyada.net/learn/proj1/blinky.html
For the Arduino sketch:
- use
pinMode()
anddigitalWrite()
.