Embedded Programming Mar 13

The plan this week was to integrate some previous week work together by using my FabISP (Electronics Production) to program my button/LED board (Electronics Design).  This would be accomplished using Arduino software to program the  ATtiny 44A microcontroller.  

The first steps involved downloading Arduino as some associated board files and drivers for the spcific pieces we had.  This was pretty simple and the hardest part was creating a directory for the ATtiny board.  After that things started to go downhill for me pretty quickly.

When I tried to "Burn the Bootloader"  I kept getting this error message:

 

Having little experience with all this, I had no idea what that meant, so I tried a number of things.  My colleague Chris suggested unplugging and replugging everything in, as this had solved this issue for him when he ran into it.  In attempting to do this, I ripped off the 6-pin header which was held on by some pretty shoddy soldering.  Awesome.  I re-soldered, got everything in the right place, and tried again.  Same error.  Since my colleagues had already completed their work, I tried using one of their button/led boards.  Same error.  Since the error was referring to the USB device on the fabISP I tried using the AVRISP mkII.  Green light meant both my boards should be working.  Burned the bootloader again, same error.  

At this point, Chris suggested that it may be a software issue.  We took my boards to his computer, where he had got everything working and tried there.  "Burn the bootloader:"    No errors!  "Done burning bootloader."  This meant it was a software issue rather than hardware.  Chris had only been able to get his to work in Linux, and Brad had used a Mac so it looks like I'd be trying one of those two uptions.  Hopefully my next update has some success.

 

Update 3/17:

Today started pretty rough in the ole Fab Lab but has come around a lot as of late.  I began by trying the above proceduer on both a Mac OS and Ubuntu.  Both were failures.  I couldn't even get the Arduino program to download on Ubuntu (another casuality of using a work computer with non-administrator access).  With the Mac, I got to the exact same place as above, Burn the Bootloader, with the exact same results, "Cannot find USBtiny."  This was pretty frustrating, and many a curse was uttered.  

There seemed few options left.  There was the complete nuclear option: mill new boards, solder (my favorite) again, and try again.  I chose the slightly less drastic option and un-did everything I had done for this week.  I unistalled all the programs, drivers, and deleted any related files I had downloaded in the last week.  I then started completely over.  When I got to the same point I got a different error!  In the absence of success, newness was amazing.  I was thrilled that I wasn't stuck in the same place.  The error showed:

 

I attempted to fix this by basically unplugging and re-plugging in everything.  A few tries later and success!  "Done burning bootloader" read blistfully across the screen.  The next step was to update the button code.

I opened the Button Example file in Arduino and changed this:

to this

 

where the difference was making sure the pin numbers of the program matched the pin numbers on my ATtiny44 microcontroller.  

Once done with that I uploaded the sketch and lo and behold the button on my board turned on!

When I pushed the button it turned off!

Immediately my success at being able to design and program circuits went to my head and I started thinking about what to call my multi-billion dollar computer company.  I thought I'd better hold off and at least finish this week's assignment.

I opened the "Blink" file in the Arduino, changed the LED pin to 7, and now when I push the button the LED blinks.  Very cool.  I imported a file from Anna France's tutorail shown below and got the light to only turn on when I pushed the button.  Also very cool.

 

Next, I did a little modification.  I took the original button program where the light was on unless the button was pressed.  I modified it to give it a delay when the button was pushed, I increased the delay to ten seconds.  So push the button, light turns off for 10 seconds.  Very freaking cool.