Thread Tools
Feb 24, 2013, 09:35 PM
No bounce, No play.
davidmc36's Avatar
Question

Programming ATTiny wit Arduino


I am trying to do this:

http://www.forkrobotics.com/2012/04/...-on-an-attiny/

If I have an AtTiny that has already been programmed, do I need to re-set the fuses for it to be reprogrammed?
Sign up now
to remove ads between posts
Feb 25, 2013, 10:58 AM
RC beginner
probably not. it depends on what clock you want (1mhz or 8mhz) but if it was used before they are probably ok. fuses do not change when the chip is re-flashed. be careful if you do change them because thats about the only way to destroy a chip.

i didnt have much use for arduino before but with the new easy to customize ide and support for tiny, mighty (m1284), and just about any other avr its of much more interest. you do have to realize most standard library routines dont work with tiny but as time goes by they are adding some capability there.
Feb 25, 2013, 08:06 PM
No bounce, No play.
davidmc36's Avatar
I have just started playing around with Arduino and the tiny chips. I really don't know much about them.

I was able to read the chip and view the hex data. Was looking for a way to program with the "plain language" of Arduino. Tried some of the sample code in the tutorial but got "sync" error.
Feb 25, 2013, 08:53 PM
RC beginner
that msg is almost always caused by wiring error or using wrong type of programming. there are 2 types: isp and bootload. by default the ide uses bootload but tiny chips dont have a bootloader inside so isp must be used. you have to tell the ide this by changing the boards.txt file.
Feb 25, 2013, 10:03 PM
No bounce, No play.
davidmc36's Avatar
I think I will re-check the wiring and try again. I had the Arduino as ISP selected. Does it make any difference if I select 1 or 8 mhz internal or 20 external?
Feb 25, 2013, 10:39 PM
RC beginner
if you selected from the ide i think that does not work. that is for putting in a bootloader which tiny cannot do. if you selected by editing board.txt that is correct. mhz is important in order for the compiler to work. if you select external crystal the chip will probably die and youll need to attach a crytal to get it going again.
Feb 26, 2013, 03:44 AM
No bounce, No play.
davidmc36's Avatar
Thanks for taking time to respond here. Hmmmmmm......

I may just go with Arduino Mini....can do more with that anyway. Not that expensive.
Feb 26, 2013, 12:34 PM
RC beginner
yes, mini or even bare mega8, mega168, or mega328 is better to get started. all you need is crystal and pins:



and a usbasp or 4 wires on a parallel port. after you become an arduino expert is a good time to play with avr tiny.
Feb 26, 2013, 07:09 PM
No bounce, No play.
davidmc36's Avatar
Cool, thanks for the tips. I picked up the usbasp a bit ago. Will look into the ATMEGA chips.
Feb 28, 2013, 12:36 PM
No bounce, No play.
davidmc36's Avatar
I have achieved what I wanted. The reason I was looking to use the Tiny was to make two independent flashers, one for beacon and one for strobe. Using the Nano I did some reading and learned a bit about writing code:

int led1 = 3;
int led2 = 4;
void setup() {
pinMode(led1, OUTPUT);pinMode(led2, OUTPUT);
}
void loop() {
digitalWrite(led1, HIGH);
delay(200);
digitalWrite(led1, LOW);
digitalWrite(led2, HIGH);
delay(30);
digitalWrite(led2, LOW);
delay(300);
digitalWrite(led2, HIGH);
delay(30);
digitalWrite(led2, LOW);
delay(300);
digitalWrite(led2, HIGH);
delay(30);
digitalWrite(led2, LOW);
delay(1000);
}

At ten bucks a pop they are a bit pricey to put one in each airplane but this will get me going for this season. Maybe next winter when I have more time I will work more on learning how to load each flasher onto separate Tiny chips. That would be a better device for smaller airplanes too.
Feb 28, 2013, 01:39 PM
RC beginner
excellent job dave! (did i just pat myself on the back or... )

perfect eaxmple of how to get started with arduino or any other toolset for that matter. next you might try running that program on a stripped down homebuilt version and someday switch the 328 for a tiny. $1 instead of $10 and 1/10th the size/weight.

"10 bucks a pop a bit pricey" lol! i have to laugh! the original arduinos were $70 ea. and some people still pay that.
Feb 28, 2013, 05:19 PM
Registered User
lmhart's Avatar
You can use an Arduino Uno as an ISP for the attiny45/85/etc - if you have one handy, the instructions at the High-Low Tech site worked for me: http://hlt.media.mit.edu/?p=1695
Feb 28, 2013, 05:29 PM
RC beginner
dave mentioned already having a usbasp and not dave, but dave, knows where you can get mega8s for 1/3 what dx charges: EBAY! seventy something cents ea.

its true dave does love these chips. bet you cant eat just one!
Feb 28, 2013, 05:32 PM
Registered User
bet your chewing on one


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Question Program/configure ESC with Arduino bogophan Multirotor Drone Talk 12 Jun 28, 2012 06:28 PM
Discussion Multiwii Arduino Programming dyarrow Multirotor Drone Talk 3 Mar 07, 2012 10:50 AM
Discussion Arduino RC Programs/routines library Tifani Multirotor Drone Talk 0 Nov 07, 2010 03:26 PM
Discussion Engine Run In program using Arduino board cadzilla DIY Electronics 4 Aug 16, 2010 08:21 PM