Embedded Programming


This week we focused on embedded programming, bringing together everything we learned about electronics production and design in previous weeks. Our assignment was to program the echo hello-world board that we modified by adding a button and an LED a few weeks ago. I ended up re-designing and re-milling the board I made before because I broke some of the copper traces when trying to solder the resonator. Luckily, the design, milling, and soldering process went much more smoothly this time.
Materials and tools:
  • Eagle (to design the schematic and board)
  • Copper-plated sheet
  • Modela milling machine with two sizes of end mills: 1/64” and 1/32”
  • Fab modules to communicate directly with the Modela
  • Solder, flux, tweezers, copper braid, components
  • ISP programmer (either the one we made ourselves, or a commercial programmer like the ATMEL ATAVRISP2)
  • Terminal and text editor
To set up my computer for AVR programming, I followed the instructions on Lady Ada's website and used CrossPack to install the GNU compiler suite, a C library for the AVR, and the AVRDUDE uploader.
To program my board, I used Sublime Text 2 + the Terminal. I tested my board by uploading the hello.ftdi.44.echo.c.make text file that Neil made, using his instructions. Because I used a commercial ISP programmer (the one I made wasn't working anymore), I had to change some of the commands. Instead of "usbtiny" in the code, I used "AVRISP2," the ID of the ATMEL programmer.
I used and modified some sample code I found on Micah Carrick's tutorial. I had two LEDs on my board, so I experimented with having both LEDs blink, and turn off when the button was pressed. Greg Borenstein's post about how the AVR microcontroller actually works was really helpful to understand its architecture and how it controls pins on an Arduino, which I have used previously.
Video of the board blinking!
I can't wait to play around with other inputs and outputs in the next few weeks!