Embedded Programming

March 11, 2015

Assignment:
Read a microcontroller data sheet and program your board to do something with as many different programming languages and programming environments as possible.


Programming a Micro-Controller:

With the help of our Lab Manager I reviewed the lengthy data sheet for our ATtiny44A and got a very general idea of the specifications of our microcontroller.

I then proceeded to learn a bit of C programming with different online videos posted on YouTube together with the thorough explanations from our Lab Manager.

We then came up with a simple C code, taking to account the specs of our microcontroller for turning on and off one of the LED Lights (on pin PB2), but couldn't get the second LED to flash...

C-Code for alternating flashing LED:

A few weeks later I had more time to delve deeper in learning C-programming. I reviewed the code and re-programmed an alternating flash between the two LEDs. As a default, one light will always be flashing, otherwise when the button is pressed the other LED will flash.

Here is the link to my Embedded Programming C-Code File:
Electronic Design PCB G-Code

See code below:

By default, the ATtiny44A runs at 1MHz but we modified the configuration and set the clock speed on the code to run at 12MHZ to match our 12MHz Crystal Oscilator, which replaced the 20MHz Resonator.

To connect the ATtiny we first needed to provide power to it and then connect it to our in-system programmer (FabISP).

Unfortunately, we weren't able to get our FabISP to work so we decided to use the in-system programmer (ISP), we had originally used to program our FabISP. We made sure we connected the MISO, MOSI, SCK, RESET, VCC and GND of the programmer to the corresponding pins on the ATtiny44A.

Atmel Studio was used to compile the C Code into computer readable instructions. It took our Source Code above written in C programming language, optimized it, and converted it into an Object Code. It all got linked together (the Standard Libraries, any User's Libraries and the Object Code) and an executable program was created.

Note: Upon further trials my FabISP did work and I was able to use it to re-program the board.

...and there was light!