Embedded Programing

25 Feb

Week8 Embedded Programing;

Firstly I connected the board I made from week 6 to the FAB ISP I made from week 4.

I refered the blink code from Neil's page and put the makefile and .c file under the same folder. I changed the MCU to ItTiny44 in the makefile. Then I defined led_pin to PB1 according to my board design. Finally I ran the terminal under this directory. In the terminal I typed:

$ sudo make program-usbtiny-fuses

$ sudo make program-usbtiny

The code file can be downloaded here:

blinkCode.c

Makefile

☞ Problems

It constantly occurs error 1 when I tried to program the blink function to it. Our local instructor suspect it might be the problem with the position of the crystal as it states clearly from the design that it should connect to PB0 and PB1 while I connect it to other pins randomly from my design. Then I cut out the wire on the board and added four outside of the board. The first time I used only one wire. Then I tried using wires coated with plastic tubes. Unfortunately neither time did I succeed in getting rid of error 1.

I then tested all wires using the multimeter to check if all components were correctly connected and the false ones were cut out. That said I should hear beeps when I lay two pins onto the two nodes which were connected whereas hearing nothing over the ones that were not. The test was done and it turned out that the wires were connected correctly.

After that our local instructor helped me lay the board onto the microscope. He figured out that there was a place where a wire actually touched the board. My classmate Barry helped me pull it up and finally it worked.

☞ Tips

To test if the ISP is working correctly, type the below code in the terminal:

$ lsusb