Week 6: Embedded Programming

Programming with AVR Toolchain

Oct 26, 2016


Read a microcontroller data sheet. Program your board to do something, with different programming languages and programming environments.

Setting Up the Environment

Programming the board

My board from week 4 has an LED and a button. I wanted to program the LED to blink once the button is pushed.

To load the program onto the board, run the following commands:

make -f makefile_name.make

make -f makefile_name.make program-usbtiny-fuses

make -f makefile_name.make program-usbtiny

When running program-usbtiny-fuses throguh fabISP, I got an error that USBtiny device could not be found:

I used another programmer to see if the bug is due to my board or fabISP. Since I didn't get the error anymore, so there is most likely a harware bug with my fabISP (which I programmed in week 2). For the rest of the assignemt, I just used the programmer.

But then the LED still didn't turn on! As I was checking voltages on different nodes, I realized that if I pressed down the microcontroller, the LED would turn on and if I let it go it would turn off again!

I resoldered the microcontoller, and it finally worked. Well kind of at least - I had to press the button a couple of times and hold it for a bit.