Pages: [1]   Go Down
Author Topic: Going from UNO to bare ATTiny2313  (Read 806 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 178
Posts: 12288
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

'round the world...
Offline Offline
Faraday Member
**
Karma: 41
Posts: 3113
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset



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. :\
Logged

Eu não sou o teu criado. Se respondo no fórum é para ajudar todos mediante a minha disponibilidade e disposição. Responder por mensagem pessoal iria contra o propósito do fórum e por isso evito-o.
Se realmente pretendes que eu te ajude por mensagem pessoal, então podemos chegar a um acordo e contrato onde me pagas pela ajuda que eu fornecer e poderás então definir os termos de confidencialidade do meu serviço. De forma contrária toda e qualquer ajuda que eu der tem de ser visível a todos os participantes do fórum (será boa ideia, veres o significado da palavra fórum).
Nota também que eu não me responsabilizo por parvoíces escritas neste espaço pelo que se vais seguir algo dito por mim, entende que o farás por tua conta e risco.

Dito isto, mensagens pessoais só se forem pessoais, ou seja, se já interagimos de alguma forma no passado ou se me pretendes convidar para uma churrascada com cerveja (paga por ti, obviamente).

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@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 :\
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 178
Posts: 12288
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: