Skip to content

Instantly share code, notes, and snippets.

@yarwelp
Last active August 24, 2016 17:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yarwelp/589f67ab8828a39d9e4862532991e833 to your computer and use it in GitHub Desktop.
Save yarwelp/589f67ab8828a39d9e4862532991e833 to your computer and use it in GitHub Desktop.
FreeBSD 11.0 -- ATmega32 blink LED

FreeBSD 11.0 -- ATmega32 blink LED

  1. Connect the Sparkfun AVR Pocket Programmer via USB to the FreeBSD 11.0 computer.
  2. Connect the Sparkfun AVR Pocket Programmer to the ATmega32 using a breadboard, the AVR Programming Cable and some jumper wires.
  3. Connect the positive lead of the 2V LED in series with a 330 ohm resistor to pin 0 of the ATmega32.
  4. Connect the negative lead of the 2V LED to ground.
  5. In the directory of the attached file blink.c, run the following commands.
doas pkg install avr-gcc avr-libc avrdude
avr-gcc -O2 -mmcu=atmega32 blink.c -o blink.elf
doas avrdude -c usbtiny -p atmega32 -U flash:w:blink.elf

Video

YouTube video: ATmega32 blink LED

Click the image above to view the video on YouTube.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment