What's Embedded Programming

Designing and fabricating PCB is cool but not enough. Programming the board is essential, designing the right program and algorithm is the whole thing. Embedded programming share the same concepts of "traditional" programming, but has some extra "embedded" stuff. In the electronics production week, we have programmed the programmer board, in this week we will use the program board we have made to program the customized board we have designed 2 weeks ago. I highly encourge you to check the documentation of the pervious weeks to understand everything.

Step 1: Installing Environment

We will use different platforms and tools, as we will try to program our board in different ways. I using Ubuntu so all the commands will work fine on linux. First you'll need to install avr-gcc and other dependices, you can use these commands: apt-get install avr-gcc apt-get install avr-dude apt-get install avr-libc apt-get install libc6-dev We will also use Arduino IDE, you can download it from here.


Step 2: Programming in C

When programming in C, you'll need to understand how the MCU is working on a low-level; you'll need to read the datasheet for the ATtiny44, not the whole thing of course just the I/O section, and you can find it here. You'll also need some experience in programming, especially bitwise operations. I have implemented two files, push-button.c, which contains the actual code, and push-button.c.make file, which contain -basically- some commands to automate the compilling and execution of the .c file.

Step 3: Uploading the file

Now it's time to compile and upload the file on the board. First we make the .c file using make -f push-button.c.make

then configuring the fuses on board make -f push-button.c.make program-usbtiny-fuses

finally uploading the HEX file make -f push-button.c.make program-usbtiny

If you got no errors you should have your board working properly.

Step 4: Programming using Arduino IDE

It's much easier to program using arduino IDE, but as Neil said it limits your control. You'll need to install ATtiny cores for arduino from here.

That's for now. And by the way, this how messy you can get working on assignments