Sooyeon Jeong

Embedded Programming

I tried using Arduino IDE and AVR ISP MKII programmer for this week's assignment. I installed CrossPack and FTDIUSBSerial Driver on my OSX machine and followed the tutorials from High-Low Tech Arduino tutorial. First, I installed the ATtiny support using the board by Preferences > Additional Board Manager URLs > https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json. Then, I saved the preference and selected Tools > Board > Boards Manager to install the ATtiny board. After the installation was finished, I selected Tools > Board > ATtiny, Tools > Clock > 20 MHz (external), Tools > Processor > ATtiny44, and Tools > Port > appropriate usb port. Programmer was set to AVRISP mkII. Then, I wrote some code in the loop() method and hit Burn Bootloader. The burning was not successful and returned this error:

avrdude: stk500v2_command(): command failed

avrdude: stk500v2_program_enable(): bad AVRISPmkII connection status: Unknown status 0x00

avrdude: initialization failed, rc=-1

Double check connections and try again, or use -F to override

this check.



Error while burning bootloader.

I tried debugging the board by checking connectivity in all the joints and making sure the schematic and the board layout was correct with one of the TAs, Amanda Ghassaei, but still could not find out what was wrong with the board after three hours. We tried the c code and the make file as well but it kept giving the pretty much the same error.

avrdude: stk500v2_command(): command failed

avrdude: stk500v2_program_enable(): bad AVRISPmkII connection status: Unknown status 0x00

avrdude: initialization failed, rc=-1

Double check connections and try again, or use -F to override

this check.


I resoldered the attiny44 chip and the ISP pins, also tried a different AVR programmer but none of the trials change the error message I was getting. The code I tried in the Arduino IDE was below:


int led = 8;

int button = 7;

int a;


void setup() {

// put your setup code here, to run once:

pinMode(led, OUTPUT);

pinMode(button, INPUT_PULLUP);

}


void loop() {

// put your main code here, to run repeatedly:

digitalWrite(led, HIGH);

delay(1000);

digitalWrite(led, LOW);

delay(1000);

digitalWrite(led, HIGH);

delay(1000);

digitalWrite(led, LOW);

}


By looking at the microcontroller data sheet, I realized that the pin numbers in the hardware and the pin numbers for the software programming were not the same.

I tried re-milling the PCB and soldering the components again. And here is how it looks:

And this time the board worked! I adapted the fade example from Arduino IDE. It slowly fades out the light and gets bright again.



Video link: https://goo.gl/photos/iPMGSCdGr2V3Jn7f7