Go Down

Topic: ATtiny85 (Read 25165 times) previous topic - next topic

baum

I was interested in the ATtiny85 for a project. How do I program it, though, over ISP? Can I use the arduino ide? Or do I need to do it in C++?

Can someone also point me to some tutorials on using it/programming it over arduino ISP?

biocow

I found this page a while back. Have not tried it myself.

http://hlt.media.mit.edu/wiki/pmwiki.php?n=Main.ArduinoATtiny4585

baum

I also may need to use I2C comm. with the tiny as a master. Would it just be easier to get an atmega328 and burn the arduino bootloader onto it? It's only $2 more expensive at sparkfun.

Coding Badly

I was interested in the ATtiny85 for a project. How do I program it, though, over ISP?


Yes.

Quote
Can I use the arduino ide?


Yes.

Quote
Or do I need to do it in C++?


That's what you type into the Arduino IDE so the answer is yes.

Quote
Can someone also point me to some tutorials on using it/programming it over arduino ISP?


Follow the links here...
http://code.google.com/p/arduino-tiny/

This may help...
http://arduino.cc/en/Tutorial/ArduinoISP
...be sure to disable autoreset.

Coding Badly

I also may need to use I2C comm. with the tiny as a master.


This should help...
http://code.google.com/p/arduino-tiny/wiki/TWIMasterLibrary

Quote
Would it just be easier to get an atmega328 and burn the arduino bootloader onto it? It's only $2 more expensive at sparkfun.


You haven't said why you want to use an ATtiny85 so there's no way anyone but you can answer that question.

baum

I have a project in which my normal arduino duemilanove is being used up by something else. I need to output a simple sine wave on an I2C and do the something else at the same time. So I though of getting an ATtiny to drive the DAC.

baum

Thanks for all the links. :)

baum

And to clarify:

1. Upload ArduinoISP to board.
2. Put 120 resistor 5V--Reset
3. Hookup up tiny85 as shown in the MIT site.
4. Download I2C and tiny 85 library/cores
5. Upload final program and unplug arduino.

baum

Also....

How do I install the tiny85 framework that CodingBadly recommended? I downloaded it, but don't know where to put it!

Coding Badly

Were I in your shoes I would treat the ATtiny as a learning experience.  If I had the time and motivation, I would use the ATtiny.  If I didn't have the time or I was distracted, I would stick with what I know.

The ATtiny85 will very likely do what you need and being able to use an ATtiny processor is indeed a handy tool to have.  They can't be beat for solving certain problems.

The 328 processor is lower risk in the sense that many more people on this forum use it so, if you run into trouble, you are more likely to find someone who has direct knowledge.

Coding Badly

And to clarify...


Yes.  A very good overview.

Quote
2. Put 120 resistor 5V--Reset


Some boards (like an Uno) will also require a capacitor.

Quote
3. Hookup up tiny85 as shown in the MIT site.


You can get away with some things connected to the programming pins (like LED + resistor) but not other things (like a piezo-buzzer).  Be aware of what you have connected when programming.

Coding Badly

How do I install the tiny85 framework that CodingBadly recommended? I downloaded it, but don't know where to put it!


You will have to modify "boards.txt" to reflect the programmer you are using.

If I remember correctly, the ZIP file includes the "tiny" sub-directory so you should be able to unzip to "{Sketch folder}/hardware/". 

The final directory tree should be something like this (some files may not be present)...

{Sketch folder}/hardware/tiny/

  boards.txt
  programmers.txt

{Sketch folder}/hardware/tiny/bootloaders/empty/

  empty2313at1.hex
  empty2313at8.hex
  empty25at1.hex
  empty25at8.hex
  empty45at1.hex
  empty45at8.hex
  empty84at1.hex
  empty84at16.hex
  empty84at8.hex
  empty85at1.hex
  empty85at16.hex
  empty85at8.hex

{Sketch folder}/hardware/tiny/cores/tiny/

  {core files go here}

baum

So I should -NOT- put it inside the Arduino application, but rather put the whole thing in the sketch folder?

baum

And to ask another question:

Should I use the internal or an external clock?

If I should use the internal (it needs to be fairly accurate):
The datasheet says the clock is shipped at 8MHz@3V, so how can I change this to 5V?

Coding Badly

So I should -NOT- put it inside the Arduino application, but rather put the whole thing in the sketch folder?


Either place works.  The recommended location is the one I gave you.

Go Up