Go Down

Topic: Going from UNO to bare ATTiny2313 (Read 1 time) previous topic - next topic

adman

So my prototype (a simple intrusion alarm) works fine with the Uno, I've written and debugged the code and all is well. I now want to move over to a bare ATTiny2313 and release the Uno for more important things. I've been looking for information on how to do this in the forums and wiki pages, but I've only gotten more confused. I can build the circuit alright, but I'm stuck at how I get the code onto the ATTiny.
1. Can I use the Uno as an ISP or do I need to buy an ISP? Some reports on the forum suggest that I can use the Uno, but the ArduinoISP wiki page says the sketch does not work with the Uno.
2. I've located the hex file for my sketch. Is it sufficient to load the hex file onto the ATTiny using an ISP (Uno or otherwise), or do I need to load the Arduino bootloader as well?
3. If I use an ISP (not Uno), how do I load the bootloader onto the ATTiny?

Apologies if these are dumb questions, but I've got so many differing hits on google that I'm really confused.

Thanks for your help.

Coding Badly

1. Can I use the Uno as an ISP


Yes.  At a certain point you will need to disable auto-reset.  For the Uno this is accomplished with a capacitor.

Quote
or do I need to buy an ISP?


That is also an option but is not required.  The Uno will work fine.

Quote
2. I've located the hex file for my sketch. Is it sufficient to load the hex file onto the ATTiny using an ISP (Uno or otherwise)


No.  The dot-hex file is specific to the ATmega328 family of processors.  Your Sketch needs to be rebuilt for the ATtiny2313.  The first step is to locate and install a "core".  I recommend this one...
http://code.google.com/p/arduino-tiny/

Quote
or do I need to load the Arduino bootloader as well?


No.  If you are using an ISP there is not need for a bootloader.

The ATtiny2313 really does not have enough Flash available to make use of a bootloader.

bubulindo




2. I've located the hex file for my sketch. Is it sufficient to load the hex file onto the ATTiny using an ISP (Uno or otherwise)


Maybe writing your software in C with AVR-GCC and that won't be a problem. :\
This... is a hobby.

adman

@Coding Badly, thanks a bunch, that's a lot of very useful information. I have now installed the 'core' and I can see that the Arduino software generates a ATTiny2313-specific hex file when that board is chosen. I'm guessing I can load that onto the bare ATTiny using an ISP.



Maybe writing your software in C with AVR-GCC and that won't be a problem. :\

Kinda defeats the purpose of using Arduino as a prototyping platform, though, doesn't it :\

Coding Badly

I'm guessing I can load that onto the bare ATTiny using an ISP.


Yes.  If you change the "upload.using" entries in "boards.txt" (instructions in the readme file) you can perform the upload from the IDE.

Go Up