This week in HTMaA the assignment was to program the HelloFTDI board that we made during week 5. The HelloFTDI board features an ATTiny44 chip which I have connected a red LED and momentary push button to two of the GPIO pins.
In order to program this board I had to first program the FabISP programmer I made earlier in the semester. After a bit of hunting around I located an ISP and FTDI cable that I could use for programming my boar.
Programming worked on the first try. The hello.ftdi.44.echo.c program compiled and uploaded to the board successfully. I used GNU Screen as a serial terminal by running the following command:
screen /dev/ttyUSB0 115200
The helloFTDI board echoed back anything I typed as expected.
After that I wanted to get my LED to blink by using this example code hello.arduino.328P.blink.c to program to the ATTiny44 so I started reading the datasheet.
When I had the LED on my HelloFTDI board blinking I wanted to interact with it using the push button.
//
// main loop
//
while (1) {
if (btn_read) {
set(led_port, led_pin);
} else {
clear(led_port, led_pin);
}
}