Use Arduino to Program Attiny84a with .c code SERVO TRIGGER

Hello, I am interested in those Servo Triggers you guys sell but I thought it would be fun to make them myself as it is open source. I have an Arduino Uno here which can program the Attiny84a, no problem, right. My conflict is the code that is provided. It is in .c format. I can open that in the Arduino IDE but cannot get it to compile as it gives me this error:

Arduino: 1.8.11 (Windows 10), Board: "ATtiny24/44/84, ATtiny84, Internal 8 MHz"

D:\Desktop\ServoTrigger\ServoTrigger.ino: In function 'void __vector_5()':

ServoTrigger:825:3: error: 'FSMA' was not declared in this scope

   FSMA();

   ^~~~

D:\Desktop\ServoTrigger\ServoTrigger.ino:825:3: note: suggested alternative: 'TSM'

   FSMA();

   ^~~~

   TSM

ServoTrigger:829:9: error: 'FSMB' was not declared in this scope

         FSMB();

         ^~~~

D:\Desktop\ServoTrigger\ServoTrigger.ino:829:9: note: suggested alternative: 'TSM'

         FSMB();

         ^~~~

         TSM

exit status 1
'FSMA' was not declared in this scope

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

My question is how do I allow this code to compile in the Arduino IDE so I can use an Arduino UNO to program these attiny84a chips. Thanks!

That code was written for Atmel Studio, not Arduino. It looks like they are playing some linker games in order to get things to fit in the tiny84. Best bet would be to download Atmel Studio and build it there.

/mike

Ok, I got Atmel Studios 7. I opened the solution, it asked me to upgrade or something so I said yes. I do not have a programmer but I do have an Arduino Uno with an ATMEGA328P chip. I uploaded the example ArduinoISP code to the Uno with no code changes.

Now in Atmel Studios, I went to Project>Device>ATtiny84A.

Then, I created an external tool with the arguments:

-p t84 -c arduino -P COM3 -b 115200 -v -D -U flash:w:"$(OutDir)Debug\$(TargetName).hex":i

I connect the Arduino Uno pins 5v, GND, and 10-13 to the ISP pins on the ServoTrigger board.

What happens now is annoying.

             System wide configuration file is "D:\avrdude-6.3-mingw32\avrdude.conf"

             Using Port                    : COM3
             Using Programmer              : arduino
             Overriding Baud Rate          : 115200
avrdude.exe: stk500_recv(): programmer is not responding
avrdude.exe: stk500_getsync() attempt 1 of 10: not in sync: resp=0xef
This goes on all the way to 10 and just says thank you at the end...

But then I remove the 10uF cap, it works. But sometimes it does work with the capacitor… It’s confusing. Sometimes I also need to click the Arduino reset button while uploading. Then it uploads. So just hitting the reset button on the Arduino fixes that problem. BUTTTT the next problem:

Once getting it to upload I get this:

 System wide configuration file is "D:\avrdude-6.3-mingw32\avrdude.conf"

             Using Port                    : COM3
             Using Programmer              : arduino
             Overriding Baud Rate          : 115200
             AVR Part                      : ATtiny84
             Chip Erase delay              : 4500 us
             PAGEL                         : P00
             BS2                           : P00
             RESET disposition             : possible i/o
             RETRY pulse                   : SCK
             serial program mode           : yes
             parallel program mode         : yes
             Timeout                       : 200
             StabDelay                     : 100
             CmdexeDelay                   : 25
             SyncLoops                     : 32
             ByteDelay                     : 0
             PollIndex                     : 3
             PollValue                     : 0x53
             Memory Detail                 :

                                      Block Poll               Page                       Polled
               Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               eeprom        65     6     4    0 no        512    4      0  4000  4500 0xff 0xff
               flash         65     6    32    0 yes      8192   64    128  4500  4500 0xff 0xff
               signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
               lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
               lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
               hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
               efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
               calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00

             Programmer Type : Arduino
             Description     : Arduino
             Hardware Version: 3
             Firmware Version: 4.4
             Vtarget         : 0.3 V
             Varef           : 0.3 V
             Oscillator      : 28.800 kHz
             SCK period      : 3.3 us

avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude.exe: Device signature = 0x1e950f (probably m328p)
avrdude.exe: Expected signature for ATtiny84 is 1E 93 0C
             Double check chip, or use -F to override this check.

avrdude.exe done.  Thank you.

I even override the check with -F and it uploaded again just without the check. It still seems to have not programmed the attiny84a though… So I am lost.

[](https://imgbb.com/)

Turns out, there was a short on the SCK pin. dunno how or where. I also had a second board, the 16MHZ SMD clock was not soldered on correctly… (My first time with SMD) The third board I think I just locked up with the fuse bits. Oops, luckily I bought 9 extra :smiley: Since I knew I was going to screw up. Anyways, I got it to work as long as I solder a lot nicer and use the Arduino IDE to burn the bootloader fuses then use CMD to flash the compiled hex code.