Project 7 - Embedded Programming
This week, I learned about AVRs and how to read datasheets (or rather, how to reference them when you need them). I also programmed the microcontroller I made for the electronics design week to blink!
My Personal Goals:
- read a microcontroller data sheet
- program your board to do something, with as many different programming languages and programming environments as possible
- get a grasp on what an AVR even is, and understand how to use them
- use a gif in my website!
Things I learned
- How to set up Arduino for a board I've made myself!
- How to communicate with a board using serial (kind of, the code was written for us but now I know how it's possible)
- How to refer to a datasheet
- Programming a board has a lot of technical difficulties that I don't fully understand, but that so much is possible!
The Process + Pics there
- Reading the datasheet
Ok so to be completely honest, reading a 286 page datasheet scares the bejeezus out of me; I don't know what every third word is. I tried to start multiple times, but just became discouraged as I looked up what things were, only to look up more things related to those things, and so on. So I didn't fully read the data sheet, but I did orient myself with it so that I would know where to find information when I knew what I was looking for. Later in the semester after I had learned more about the details of the FabISP and ATtiny44A, about clocks, registers, pins, etc I was able to refer to it when I needed it.
- Setting up Arduino
To program the board, I decided to use Arduino. Because I never finished testing the board in week 5, I started by trying to get echo hello to work. I followed a guide to be able to program ATtiny boards with Aruino.
- Echo Hello
After I got the environment set up, I copied Neil's C code and tried to run it.
I ran into a few issues, but TA Will helped me find how to get user rights to run the program using sudo chown .
It was relieving to see the board work and things happen!
I also tried to use PySerial to talk to the board, but that didn't go as well. I did all the appropriate set up, but TA Will says that there was a problem with term.py.
- Making the board blink
Now it was time to make the board do something! I used an Arduino example template to make the board blink. I set the LED_OUTPUT pin to 7 to match my board setup. When the code was uploaded however, the board blinked really slowly. Once I burned the bootloader, the timing issue was fixed! This was really satisfying.
My next step is to control the LED with the button, but the lab is about to close, so that's a task for some other time.