08 - Embedded Programming

PROGRAMMING THE BOARD

Two weeks ago we made the LED + Button Board and got a jump start on the programming to make sure it worked. We used the Arduino IDE to do the programming. The programmer was the FabISP (based on the USBTinyISP) we made a few weeks ago and the board was the ATTINY24 with a 20MHz external clock.

The first program I loaded was the ATTINYButton, which sets the LED off and turns it on when the button is pressed. Here is the board in action:

There is only so much you can do with an LED on a board, so I altered the program to make it flash SOS. My goal this week is to become more familiar with the how to code in the Arduino IDE. I don't like the length of my code as I know I can make it neater by using some repeating loops, so I will work on that.


We also programmed the board in C and made it echo back keystrokes. Since I am now using a different computer than I was when we made our FabISPs, I had to install WinAVR on my new computer. I couldn't install the newest version as I got an error message saying that the installer was corrupter or incomplete.

 

Instead, I used this version, WinAVR-20090313-install.exe, which installed just fine.

Using Neil's code, this was the result:

Finally, I decided to program my name in Morse Code. Here is the ino file for with the code: dianeled.ino

MAKING AN ARDUINO

Since I was finished all of the initial programming, I had time to make my own Arduino. I used Anna's version of the board where she pulled out all of the pins from the chip so we can use them at a later time. I thought thus board would be especially useful after we make cover input and output devices.

I milled the board, stuffed it, and then tried to burn the bootloader. When I powered it up, the LED was on. I got a communication error, so took a closer look. There was the smallest bit of solder that had dragged between two of the pins that went to the programming header. Once that was cleaned up...success!!! The LED was no longer on, which turns out to be a good thing. I then loaded a blinking LED example from the Arduino IDE.

Published on   May 28th, 2013