Espritmodel.com Telemetry Radio
Reply
Thread Tools
Old Feb 24, 2013, 09:35 PM
No bounce, No play.
davidmc36's Avatar
Canada, ON, Ottawa
Joined Oct 2010
3,247 Posts
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?
davidmc36 is online now Find More Posts by davidmc36
Reply With Quote
Sign up now
to remove ads between posts
Old Feb 25, 2013, 10:58 AM
RC beginner
New York
Joined Oct 2008
6,028 Posts
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.
dave1993 is offline Find More Posts by dave1993
Reply With Quote
Old Feb 25, 2013, 08:06 PM
No bounce, No play.
davidmc36's Avatar
Canada, ON, Ottawa
Joined Oct 2010
3,247 Posts
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.
davidmc36 is online now Find More Posts by davidmc36
Reply With Quote
Old Feb 25, 2013, 08:53 PM
RC beginner
New York
Joined Oct 2008
6,028 Posts
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.
dave1993 is offline Find More Posts by dave1993
Reply With Quote
Old Feb 25, 2013, 10:03 PM
No bounce, No play.
davidmc36's Avatar
Canada, ON, Ottawa
Joined Oct 2010
3,247 Posts
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?
davidmc36 is online now Find More Posts by davidmc36
Reply With Quote
Old Feb 25, 2013, 10:39 PM
RC beginner
New York
Joined Oct 2008
6,028 Posts
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.
dave1993 is offline Find More Posts by dave1993
Reply With Quote
Old Feb 26, 2013, 03:44 AM
No bounce, No play.
davidmc36's Avatar
Canada, ON, Ottawa
Joined Oct 2010
3,247 Posts
Thanks for taking time to respond here. Hmmmmmm......

I may just go with Arduino Mini....can do more with that anyway. Not that expensive.
davidmc36 is online now Find More Posts by davidmc36
Reply With Quote
Old Feb 26, 2013, 12:34 PM
RC beginner
New York
Joined Oct 2008
6,028 Posts
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.
dave1993 is offline Find More Posts by dave1993
Reply With Quote
Old Feb 26, 2013, 07:09 PM
No bounce, No play.
davidmc36's Avatar
Canada, ON, Ottawa
Joined Oct 2010
3,247 Posts
Cool, thanks for the tips. I picked up the usbasp a bit ago. Will look into the ATMEGA chips.
davidmc36 is online now Find More Posts by davidmc36
Reply With Quote
Old Feb 28, 2013, 12:36 PM
No bounce, No play.
davidmc36's Avatar
Canada, ON, Ottawa
Joined Oct 2010
3,247 Posts
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.
davidmc36 is online now Find More Posts by davidmc36
Reply With Quote
Old Feb 28, 2013, 01:39 PM
RC beginner
New York
Joined Oct 2008
6,028 Posts
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.
dave1993 is offline Find More Posts by dave1993
Reply With Quote
Old Feb 28, 2013, 05:19 PM
Registered User
United Kingdom, Bristol
Joined Aug 2008
1,774 Posts
9.00 http://dx.com/p/arduino-pro-mini-mic...v-16mhz-178183
dave's fav http://dx.com/p/atmel-atmega8-16pu-a...ce-pack-136056 3x$6.30 Diamonds in the ruff (no bootloader) add 1x http://dx.com/p/usbasp-usbisp-downlo...-51-avr-157167
SadSack is offline Find More Posts by SadSack
Reply With Quote
Old Feb 28, 2013, 05:19 PM
Registered User
lmhart's Avatar
United Kingdom, Northern Ireland, Belfast
Joined Jan 2013
113 Posts
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
lmhart is offline Find More Posts by lmhart
Reply With Quote
Old Feb 28, 2013, 05:29 PM
RC beginner
New York
Joined Oct 2008
6,028 Posts
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!
dave1993 is offline Find More Posts by dave1993
Reply With Quote
Old Feb 28, 2013, 05:32 PM
Registered User
United Kingdom, Bristol
Joined Aug 2008
1,774 Posts
bet your chewing on one
SadSack is offline Find More Posts by SadSack
Reply With Quote
Reply


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Question Program/configure ESC with Arduino bogophan Multirotor Talk 12 Jun 28, 2012 06:28 PM
Discussion Multiwii Arduino Programming dyarrow Multirotor Talk 3 Mar 07, 2012 10:50 AM
Discussion Arduino RC Programs/routines library Tifani Multirotor 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