Embedded Programming

For this week we need to read a microcontroller data sheet and program our own board.

Data Sheet

Atmel-8271-8-bit-AVR-Microcontroller-ATmega48A-48PA-88A-88PA-168A-168PA-328-328P_datasheet_Complete.pdf

The datahseet talks about the several classes of ATMegas that share very similar characteristics. The differences between them are basically the following:

  1. Memory Size: each chip have different memory size (Flash, EEPROM and RAM). It is a limitant at the moment of coding. The number is proportional to the memory. For example the ATmega48a have 4KBytes of flash memory and the ATmega328P have 32KBytes.
  2. Also the interrupt vector size is different among the distinct classes, which means that some Atmega328p has mor interruptions than ATmega48a
  3. The rest of the datasheet is about the architecture of the controller, its register,s the relation between them and similar stuff.

Program Board.

This task was a nightmare. Really. I am not joking. At last I could do it for my final project. But I suffer. Like if I was in hell. I tried so many times to do an fabduino with ATmegas that I lost the count.. an the money associated with it… At least 5 times I tried to do it, but for several reason they never worked. Sometimes was a soldering issue, but in the last tries was a programming thing. What was the problem? My big, fat, frustrating problem? The resonator/crystal. I worked with 20MHz. For having a successful serial communication the resonator should be of 8MHz (or at least is the recommendation).

The design I made is shown:

 photo week14_zpsd4dc4912.png

The physical result was:

 photo week14_zpsd4dc4912.png

I burn the program by two different ways on the board:

  1. Using arduino by following the instructions from link and from other 3 links: link1 link2 and from other 3 links, link3 and from other 3 links.
  2. Using the method taught in older sessions. Arduino IDE generates a .hex file after compilation. This file was used for this process.

The program that I made was basically for my project, so it uses a hall sensor in order to sense the proximity of a magnet. The next video show it.

Video1

Return to index