Programming the ATTiny2313

Support forum for the Geiger Counter.
Post Reply
Posts: 1
Joined: Thu Apr 11, 2019 12:00 pm

Programming the ATTiny2313

Post by apu-punchau »

I damaged the ATtiny that came with the package, and I'm trying to reprogram a fresh one. I've used the guide on the website, and have been able to get the blink program uploaded and running.

However, I'm confused about how to actually implement the source code. Can I just copy and paste it into Arduino? I've tried that, and get a bunch of undeclared variable errors.
The guide mentions an GCC compiler, I downloaded the version mentioned but don't know how to work it.

Can anyone give me some advice? I'd greatly appreciate it.

User avatar
Site Admin
Posts: 1016
Joined: Fri Apr 03, 2009 10:29 pm
Location: Seattle, WA

Re: Programming the ATTiny2313

Post by mightyohm »

The source code is not compatible with Arduino. You'll need avr-gcc (WinAVR is no longer being actively developed but last time I checked I was still able to download and install it) and an AVR programmer like the USBTinyISP. Windows 10 may have some problems with drivers, since WinAVR is quite old - in the past I have been able to find workarounds for these (disable digital signature checks and possibly create updated libusb drivers from scratch).

If you download the source code you should be able to enter "make install" from the command line. This will flash the hex file to the AVR and set the configuration fuses.

Sorry this isn't more straightforward, the code was developed several years ago when WinAVR was still under development and it was easier to get all of this working. I need to go back and figure out the best way to do this now. I can also send you a replacement AVR if you contact me directly.

Post Reply