Embedded Programming
Part OneProgramming my PCB
Part TwoError running Arduino in Linux
Part ThreeHello World in Morse Code
Part Four ATtiny 44 Datasheet
Programming my PCB LED and button board
There are many ways to program a board. First I tried the Arduino IDE, determined to get it working on linux though everyone said windows was the better system to use it with.
After downloading Arduino - since I was using linux I did not need to download the FTDI driver. I did add the ATtiny board files (note make sure you get the correct zip file for your version of arduino)
In the Arduino IDE I go to File->Preferences to find my Sketchbook Location
I then create a directory inside of Sketchbook called Hardwareand unzip the ATtiny44 files inside. Now, when I go to the Arduino IDE I have the ATtiny files inside the Board options.
UH OH - ERROR!
Error in Ubuntu for Arduino IDE, I did two things:
1. Add some udev rules for my USBtinyISP
2. Use Arduino IDE using Sudo commands
1. Adding Udev Rules
I used the following tutorial involving making a file and using gedit to paste this line of code.
SUBSYSTEM=="usb", SYSFS{idVendor}=="1781", SYSFS{idProduct}=="0c9f", GROUP="adm", MODE="0666"And then:
sudo restart udev2.Use Sudo for Arduino IDE
Hello World in Morse Code
I wanted to program my board to say "Hello World" in morse code. So I used thisMorsecode Translator. In the Arduino IDE I changed the led high delays: 200ms for short morse code and 500ms for long morse code. I also changed the led low delays: between code to 200ms , between letters to 500ms and delays between words 800ms . It repeats in a loop after 3 seconds of pause (3000 milliseconds).
You can download my Arduino sketch for Hello World in Morse Codehere
Data Sheet of ATtiny 44
I started to read the data sheet, I printed half of it out, still can't believe that something so small as the Attiny 44 can have a manual so big!
Most of the reading went over my head. I understand that it functions using 8 bit data direction register (DDR). Also an 8 bit peripheral data register (PR). These can be changed to be inputs or outputs. I am also beginning to understand the concept of PWM as a way of transmitting information: