ATTINY for a begginer

Hello all, I want to get serious with Atmel, Arduino's good for prototyping but I just don't always need the pin count.

One application is to simulate the bright blue flickering of an arc welder in a 1/76 scale model or 1/87 for our american cousins, an atmega 328 would be overkill for this project which only requires generating random delays to turn a led on and off.

So I'm looking at an 8 pin attiny, trouble is there are so many variations, I'm more used to microchip pic's so am lost in the relm of attiny's, I don't need adc, comparators, pwm or anything fancy, so whats a good 8 pin chip to start off with? And can i use my atmega 328 to ICSP it?

Thanks in advance

So I'm looking at an 8 pin attiny, trouble is there are so many variations

There are? As far as I can tell, there are only four 8-pin models: ATtiny13, ATtiny25, ATtiny45, and ATtiny85. The ATtinyX5s are only different in the amount of memory; in all other respects they are identical.

Any of those will work for your application and can easily be programmed using your ATmega328. I would go with the cheapest (probably the ATtiny13). If the difference in price is insignificant, I suggest "upgrading" to the ATtinyX5 models. They have two timers instead of one which gives you considerably more flexibility with blinky LEDs.

Part numbers ending in "A" (e.g. ATtiny13A) are newer revisions. I tend to favour the newer revisions because they have fewer errata (and, ironically, are often less expensive).

I like the ATtiny85s because they have the most memory for their device class (ATtiny25/45/85). They cost $1.30 each for DIPs in quantity of 1. The ATtiny25s cost $1.05. Considering you are buying non-volume DIPs, I would say just pay the 25 cents more considering you get four times as much flash and RAM.

If I were you I would skip the Arduino as ISP and just buy this: and a cheap programmer such as a USBtinyISP or the "official" AVR ISP mkII. Why? Putting in those wires manually all the time is annoying and can often add half an hour to your debug session. I had to buy an ISP for class, which is why I lean toward this decision.

There is one more option. You don't really learn anything but it's the absolute easiest: buy the chips and program with the Arduino IDE:

Right now at mouser for through hole the attiny85 and attiny45 are cheaper than the attiny13. For quantity 1: attiny45 is $0.81 attiny85 is $0.92 (last week the attiny85 was $0.72) The tiny13A is $0.94 The tiny25 is $0.75

With the 13s the ram is quite limited at 64 bytes RAM/1k code where the tiny45 has 4k code/256 of RAM. tiny85 has 8k code/512 RAM. tiny25 has 2k code/128 RAM

The costs are so close now that I'd just get some tiny85s to play with until there was need for cost optimization.

--- bill

Thanks all, thats helped me decide, I'll probably start with the 13 chip and maybe get one of the higher spec chips to start off with, memory & speed isn't important right now

While memory and speed may not be important for your code, development environment and tools might. With the limited RAM on the Attiny13, I'm not sure if you will be able to use Arduino for your programming environment and development tools for that part.

If you want to use Arduino then you will want to stick to the ones that have 3rd party Arduino add-on support for the chip you select. (Arduino as shipped, does not natively support they tiny parts) Here are couple of links for such 3rd party add-on packages:

--- bill

Thanks Bill I will check those links, In reality i would drop atmel in favour of microchip as BSF PORTB,0 is more native to me than digitalWrite(8, HIGH); but I want to explore atmels beyond 328's, I'll check those links now

One to add to the list in case the temptation to use an ATtiny13 is too much to resist...,89781.0.html

Don't confuse Arduino for Atmel / AVR / ATtiny.

digitalWrite() is an Arduino library call.

PORTB = 0x01

.. is an AVR C thing, which is closer to what you're used to.

[quote author=Coding Badly link=topic=103828.msg778839#msg778839 date=1335831623]The ATtinyX5s are only different in the amount of memory; in all other respects they are identical.[/quote]

There's an ATTiny85 and an ATTiny85V that might be causing OP's confusion. The latter will operate down to 1.8V.

To OP, assuming you're looking for only the PDIP format there's just the ATTiny85-20PU and ATTiny85V-10PU. The former is the less expensive/faster part and probably what you want.

Moderator edit: quoting corrected.

Thanks for all the responces It's really apreaciated

OK, so for the application then, take one scale model of a construction site, scale is not important here but it will be aimed at 1/76th or 1/87 scale, one plastic figure of a worker arc welding, the chip of choice need only generate random off times, on time will be constant, or random brightness of a blue led, the light from which will be fed down thin fibre optic light guide to his welding handle, later I might add a green led to get a more realistic arc welder flash and the chip will only perform this one task.

Then I'm sure it doesn't matter which you pick. But, if you're going to the trouble of illuminating fake sparks, isn't there something else you could do? Spin a cement mixer, e.g.?

Then again, if it's a union shop, one person working is probably realistic. ;-) (I keed, I keed.)

Then again, if it's a union shop, one person working is probably realistic