2

Referring to guide at High-low tech, I were able to flash ATTiny84 via UNO through Arduino IDE 1.6.7.

I loaded a simple blink LED program on IDE pin 0 (physical Attiny84 pin 13, PA0) and everything works fine for pin 0 till 7 at Port A.

But what if I want to access or blink a LED at one of the pins at Port B? Example, PB0 (physical pin 2)

The following is my current code to blink PA7

int led=7; //PA7
void setup() {
 pinMode(led, OUTPUT);
}
void loop() {
 digitalWrite(led, HIGH);
 delay(100);
 digitalWrite(led,LOW);
 delay(100);
}
asked Mar 7, 2016 at 5:53

2 Answers 2

4

According to the ATtiny web-page the pin/ports are numbered as below:

ATtiny44/ATtiny84

The physical pin 2 is the Arduino ATtiny core pin 10. You can also find this well documented in the pins_arduino.h file.

Cheers!

answered Mar 7, 2016 at 6:58
1
  • the picture is not what i looking for but the pins_arduino.h does help a lot Commented Mar 7, 2016 at 7:30
0

Refer to url link by @Mikael, this is the answer I'm looking for.

Arduino IDE & Pin Mapping 
// ATMEL ATTINY84 / ARDUINO
//
// +-\/-+
// VCC 1| |14 GND
// (D 10) PB0 2| |13 AREF (D 0)
// (D 9) PB1 3| |12 PA1 (D 1) 
// PB3 4| |11 PA2 (D 2) 
// PWM INT0 (D 8) PB2 5| |10 PA3 (D 3) 
// PWM (D 7) PA7 6| |9 PA4 (D 4) 
// PWM (D 6) PA6 7| |8 PA5 (D 5) PWM
// +----+
IDE Attiny84 Physical Pin
 0 PA0 13
 1 PA1 12
 2 PA2 11
 3 PA3 10
 4 PA4 9
 5 PA5 8
 6 PA6 7
 7 PA7 6
 8 PB2 5
 9 PB1 3
 10 PB0 2

In order to blink PB0, I would need to replace my code with int led=2; //PB0

answered Mar 7, 2016 at 7:41
1
  • Should it not be: int led=10; //PB0 Commented Jul 13, 2023 at 10:30

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.