Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

ATTiny13
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

ATTiny13

by shobley on Fri May 28, 2010 5:00 am

Does anyone know of a good resource site on programming and hooking up this tiny uController?
Does it require an external osc?
(I would think not, it barely has any pins to begin with)

I have a very simple function I need to implement and the Arduino is overkill.

Steve
http://www.stephenhobley.com
http://www.youtube.com/shobley
For all your laser harp, tesla coil, and killer robots from outer space needs.
shobley
 
Posts: 184
Joined: Fri Sep 07, 2007 5:16 pm

Re: ATTiny13

by uhe on Fri May 28, 2010 6:59 am

You don't need an external osc just include F_CPU = 8000000 in your Makefile and it'll run on 8 MHz. In fact I didn't even see xtal pins in the datasheet. If you need one look at the ATtiny 25/45/85 line.
Programming is done via the standard ISP pins like every other atmel.
What kind of resources on programming and hooking up are you exactly looking for?
"I have not failed. I've just found 10,000 ways that won't work." - Thomas Edison
uhe
 
Posts: 178
Joined: Mon Sep 03, 2007 4:50 pm
Location: metric world

Re: ATTiny13

by Entropy on Fri May 28, 2010 10:00 am

I haven't worked with the 13, but I have worked with the 25/45/85.

These units typically are set to a default of the internal oscillator at a particular frequency. (8 MHz for the x5s). With the x5s you can actually select a PLL clock doubler to generate a 16 MHz clock internally.

In fact I think most AVRs ship configured to the internal RC oscillator - most people working with Megas reconfigure these to external for the extra precision or higher clock freq. (Most AVRs don't have the nifty clock doubler that the TinyX5s do.)

Pretty much hook up power, ground, and that's it. Power supply decoupling capacitor is reccommended, but optional. Someone actually made an RFID chip from a Tiny that used the I/O clamping diodes and die capacitance for the power supply!

(Of course, you need to hook up the programming pins to your programmer and BE CAREFUL with your fuse bits as always.)

Edit: Do you have experience with straight AVR-GCC on the ATMegas used in the Arduino? A good way to do things is to prototype in your Arduino hardware but programming using AVR-GCC, so you have extra I/O for debugging. Then once the program is reasonably stable, port it down to a Tiny.

Also, Atmel has an ATTiny48 which is almost identical to the MegaXX8s but missing a few peripherals such as the serial port - porting from the MegaXX8 in an Arduino down to a Tiny48 might be easier, especially if you want to do I2C (TWI) work - the Tiny48 has a full hardware TWI implementation, while the TinyX5s have the "USI" which is basically a shift register that provides what I could best call "hardware accelerated software TWI".
Entropy
 
Posts: 472
Joined: Tue Jan 08, 2008 12:43 am
Location: Owego, NY USA

Re: ATTiny13

by uhe on Fri May 28, 2010 10:15 am

Entropy wrote: Most AVRs don't have the nifty clock doubler that the TinyX5s do.
Cool feature! I didn't know that some AVRs have that.

And... I think one can't stress that enough:
Always set the fuses as you need and don't rely on factory settings!
"I have not failed. I've just found 10,000 ways that won't work." - Thomas Edison
uhe
 
Posts: 178
Joined: Mon Sep 03, 2007 4:50 pm
Location: metric world

Re: ATTiny13

by shobley on Fri May 28, 2010 12:49 pm

Thanks for all the replies.

I want the tiny to take over the job of this:
http://www.youtube.com/watch?v=43xqnzfwNQg

Basically "when pin 1 goes high, pulse pin 2 for duration <x> and ignore any other pulses for <y> milliseconds."
I opted for a uController because eventually I want to update an LCD display (via serial) with offset and period information so I can see how accurate the pendulum.

(And possibly calculate gravity and other geekful things)

So if I buy some ucontrollers and the adafruit 6-pin programmer, all I need is a "target" board to program?

Steve
http://www.stephenhobley.com
http://www.youtube.com/shobley
For all your laser harp, tesla coil, and killer robots from outer space needs.
shobley
 
Posts: 184
Joined: Fri Sep 07, 2007 5:16 pm

Re: ATTiny13

by uhe on Fri May 28, 2010 3:03 pm

shobley wrote:I opted for a uController because eventually I want to update an LCD display (via serial) with offset and period information so I can see how accurate the pendulum.
The Tiny13 might be a bit small / has not enough pins for this. In that case I'd go with a ATTiny2313.

shobley wrote:So if I buy some ucontrollers and the adafruit 6-pin programmer, all I need is a "target" board to program?
Correct. I don't know of any for the Tiny13 but the ATtiny2313 Target Board from the Evil Mad Scientists might be suitable. Adafruit has only the big version for the ATmega it seems.
"I have not failed. I've just found 10,000 ways that won't work." - Thomas Edison
uhe
 
Posts: 178
Joined: Mon Sep 03, 2007 4:50 pm
Location: metric world

Re: ATTiny13

by Entropy on Tue Jun 01, 2010 10:12 am

If you want UART serial, you need a Tiny2313 or larger.

Mega168s aren't too expensive either if you run them from internal RC osc.
Entropy
 
Posts: 472
Joined: Tue Jan 08, 2008 12:43 am
Location: Owego, NY USA

Please be positive and constructive with your questions and comments.