Go Down

Topic: ATtiny84 (Read 380 times) previous topic - next topic

CantSayIHave

Apr 28, 2015, 04:46 pm Last Edit: Apr 28, 2015, 04:48 pm by CantSayIHave
Hey, just a few quick questions:

I have an ATtiny84. Here is the datasheet for it.

What is the difference between PA and PB?

Can I use all 12 pins as input/output? If so, are they numbered 0-11 counterclockwise when using Arduino as ISP?

Thanks

Riva

What pins are used for what will be dependent on the Arduino core your using.
Don't PM me for help as I will ignore it.

CantSayIHave

Just asking if I can format the board to use all 12 pins as I/O

legonick22

#3
Apr 28, 2015, 05:26 pm Last Edit: Apr 28, 2015, 05:38 pm by legonick22
Let me give you the full shake-down here (in order according to pin #):



1. VCC = Put your +5V here.
2. XTAL1 = Put one lead of your XTAL here, can be GPIO if external clock fuse is disabled. No analog.
3. XTAL2 = Put other lead of XTAL here. Same as above,
4. RESET = Unless you have configured your fuses to disable it, this is RESET when tied to low. You can use it for I/O if you disable external reset, but I highly recommend against that.
5. INT0 = Interrupt 0. Can be used for External interrupts or GPIO. No analog.
6. GPIO. Can also be analog in.
7. MOSI = UART connection. Also GPIO or analog in.

8. MISO = UART. GPIO or analog in.
9. SCK = UART. GPIO or analog in.
10. T0 = GPIO or analog in.
11. AIN1 = GPIO or analog in.
12. AIN0 = GPIO or analog in.
13. AREF = Analog reference pin. I see people use it for GPIO or analog in, but I don't know how.
14. GND = Put your 0V here.

You don't really need to worry THAT much about PA and PB. They are a distinction useful for port manipulation, which the average user won't use.

Pinouts for the Arduino IDE depend upon both your core and your variant. Check the files included with your bootloader folder. Try looking under /your_bootloader/Variants/Standard
My mother said I could be anything I wanted. But I don't want to be anything I wanted. I want to be an engineer!

Riva

#4
Apr 28, 2015, 05:57 pm Last Edit: Apr 28, 2015, 05:58 pm by Riva
Here is the pinout from a different core taken from here.
Notice the digital pins are in a different order to the previous post.
Don't PM me for help as I will ignore it.

DrAzzy

PA and PB are PortA and PortB; which port it's on is important if you're doing direct port manipulation. Not important if not doing that.

The second pinout seems to be less common now - I only found one core using that, all the others have it the other way around.
ATtiny core for 841+1634+828 and x313/x4/x5/x61/x7/x8 series Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts (some assembled), mosfets and awesome prototyping board in my store http://tindie.com/stores/DrAzzy

CantSayIHave

Thanks so much guys!

You answered all of my questions!

DrAzzy

Also, btw - if you're going to be using the SOIC-14 package variant of the Tiny84, take a look at the Tiny841 (link in sig for Arduino core). It's pin compatible, and just a few cents more on digikey, but it has dual hardware UARTs and 6 PWM outputs, and hardware SPI, and 12 analog input channels instead of 8 (11 usable - the 12th is on reset)
ATtiny core for 841+1634+828 and x313/x4/x5/x61/x7/x8 series Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts (some assembled), mosfets and awesome prototyping board in my store http://tindie.com/stores/DrAzzy

Go Up