Anders Häggman

MAS.863 Portfolio

WEEK 7 // Embedded Programming

Apart from some hardware issues with the FabISP, this weeks assignment of programming a board with an LED to blink repeatedly, or light up when a button was pressed/not pressed was relatively straightforward. I followed several different tutorials, and modified pre-existing example code in the Arduino IDE.

The ATtiny 44A datasheet  was a good reference. The C-book was also highly recommended, available here , and here in a less formatted version (in case the first link does not work).

I also needed to download the ATtiny hardware  to my Arduino library, as explained in the high-low tech tutorial.

  • Level of previous experience:              
  • Time taken:               
  • Tools used:
    Roland Modela MDX-20 Desktop Mill  //  Soldering Equipment  //  PreProgrammed FabISP  //  Arduino IDE
  • Got help from:
    Tomoaki Masuda  //  Sean Ricks  //  Charles Guan  //  Prashant Patil  //  +MAS863 IDC West-section
  • Main learnings:
      Pay attention to tool paths, make sure the mill is doing what you think it's doing.
      Make sure the board is clean of any solder residue, and that all the appropriate solder jumps on the FabISP have been removed once the ISP has been programmed.
      Basics of Arduino.

[Image_Missing]
At the beginning of the tutorial section that I was attending, we needed to first program our FabISP's. In order to do so, we needed to use a working FabISP, to program the un-programmed FabISP's. My FabISP was one of the few ISP's that had already been programmed (with the help of a student from 2013), so I lent mine out for other people to use. Unfortunately, as it was being used there was a 'puff' of smoke, and the FabISP was no more. (* Picture perhaps photoshopped a bit.)
[Image_Missing]
After the two-hour tutorial, after which I was in worse shape than before the tutorial, I was somewhat annoyed at my situation. I decided to suggest that we make several FabISP's, so that in case anyone experienced a similar 'smoking' ISP later on in the course, there would be a supply of ready ISP's, so that no one would have to spend time making a new one later on (since presumably the time-pressure of the course would not get any easier later on). In our section we milled out a couple of extra boards, and the person who had handled my board as it decided to self-destruct, soldered and programmed an extra ISP to replace the one that got smoked. I also made and programmed an extra, so that the IDC west section had at least one extra, working FabISP.
[Image_Missing]
I also decided to make some quick modifications to the FabISP, for our emergency stash of ISP's. This is the outline...
[Image_Missing]
...and these are the traces, based on the FabISP.
[Image_Missing]
I cut eight boards in one sitting. Although the ground trace is a little on the thin side (on the right side of the board), it seems functional. The picture was taken before de-burring, so the traces look almost corroded, but after cleaning it up with the edge of a metal paint scraper they looked much better.
[Image_Missing]
Unfortunately, I was not paying attention when cutting the outlines of the boards, and four out of the eight boards were destroyed. The online fab module had created diagonals in the tool path, and I did not notice these were actual cuts (I had just assumed they were tool jogs). So much for having a large cache of pre-cut boards.
[Image_Missing]
After the unfortunate episode with the FabISP's, I was ready to start coding the echo board, blinking light, and button press > LED blink.
[Image_Missing]
I tackled the echo board assignment first, following the instructions put together by Tomoaki as well as the programming instructions on the course website .  The information from theses sources proved not to be sufficient though, so I did need some extra help that I got by mailing the West section e-mailing list. I had some issues with not having spaces, or having typo's in my commands.
[Image_Missing]
I used the Arduino IDE  to program my blinking LED, as well as the button press LED blink. I looked at several tutorials, such as this one  which already, unfortunately, had many broken image links. I also had a look at the high-low tech blog , as well as Pauline Varley's website . The programming in the Arduino IDE was pretty straightforward, as there were plenty of existing examples. The most challenging part was figuring out which Arduino pin mapped to which ATTiny pin. I was also somewhat hesitant to just try different ones after my FabISP had smoked, and I wasn't sure if choosing the wrong pin could destroy my board. In the end, I realized that the pin numbers in the Eagle chart were correct.
I was able to get the LED on my board to blink. As proof, I made this short video. Since the event is somewhat underwhelming, I decided to add some music to make it a bit more interesting...
...here the LED blinks when I press the button. Changing between 0 and 1 for the 'ButtonState' in the code made the LED light up either when the button was pressed, or when it was not pressed. It was quite satisfying to exert some control of what the PC-board was doing, not having done anything like this before.