Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: madsci1016 on September 25, 2010, 04:19:05 PM

Title: Questions on the AVR ATtiny's
Post by: madsci1016 on September 25, 2010, 04:19:05 PM
Hey guys.

I'm trying to design a data acquisition system into my electric panel, so i can get power consumption data. (yes i know there's a bunch of other setups on the net, but i'm designing my own).

I'm trying to keep what actually get's installed into my panel as minimal as possible. I was thinking of using am ATtiny, since really all i need is 2 ADC pins and a UART TX pin to send the data to something else. An ATmega seems way overkill for this.

But i'm lost on how the mega-multiplexing works on the pins.

(http://circuits.datasheetdir.com/18/ATTINY25-pinout.jpg)

Ok, So i assume i'll connect a capacitor to PB0 and VCC for AREF, and use PB3 and PB4 for my two analog input pins.

 I get mixed results when googling how a UART works on this, if it even has one. Which pin would TX be?

Would hard wiring a cap to PB0 and VCC interfere with a hardware programmer since PB0 is also MOSI? my gut says yes, and i'll have to pop the chip in and out of a flasher socket to my circuit's socket every time i want to flash a program.

EDIT:

Code: [Select]
ADMUX |= (0 << REFS0) | (0 << REFS1);      //Sets ref. voltage to VCC +5v
Ok, so it looks like i don't have to use external AREF pin if i don't want to, as i can set AREF internally, right?
Title: Re: Questions on the AVR ATtiny's
Post by: Ro-Bot-X on September 25, 2010, 08:38:14 PM
This chip does not have hardware serial (UART) interface. But it has a USI (universal serial interface) that you can configure in different ways, one being I2C. I don't remember if serial works or not.

I have some future plans using the tiny85 and 84, but at the time I'm way too busy to dig into it more.
Title: Re: Questions on the AVR ATtiny's
Post by: madsci1016 on September 25, 2010, 09:51:24 PM
Hmm, looks like i would be codding my own software serial then. I guess since it would be TX only, it shouldn't be that hard.
Title: Re: Questions on the AVR ATtiny's
Post by: Soeren on September 26, 2010, 04:38:00 PM
Hi

If you're hard pressed for space, there's always the PIC10Fxxx in SOT23-6, the same outline as conventional SMD transistors, just with twice the pins  ;D
What you're doing is a prime example of where it excells.

On the positive bump of an AA cell:
(http://That.Homepage.dk/Img/PIC10_on_AA_Battery.jpg)

On my finger:
(http://That.Homepage.dk/Img/PIC10_on_finger.jpg)

Sorry for the crappy quality - they were shot single handed in low light.
Title: Re: Questions on the AVR ATtiny's
Post by: madsci1016 on September 26, 2010, 05:48:39 PM
That is tiny.

Thanks, I'll consider it. It's sad to say my gf knows more about PICs then I do, which still isn't much at all. I've been meaning to teach myself, and this might be the project to do it. I already ordered some ATtinys, so i'll take a further look to see if i want to bite the PIC bullet instead.