As follow-up of my former question:
Hi, I want to know how I can access PB3 reset pin of ATtiny44 IC. I ran out of pins so I am using it as I/O pin, but I am unable to declare it in the code.
This picture above says that PB3 is pin 11. But if I declare it as pin 11, the reset pin does not function at all.
// in setup():
DDRB |= (uint8_t)(1U << 3);
// in loop():
PORTB |= (uint8_t)(1U << 3); // set PB3 to "high"
PORTB &= ~((uint8_t)(1U << 3)); // set PB3 to "low"
This code works with only direct declaration.
In my code I just need to add pin number to the command like #define CSN 2.
EDIT
#include <avr/io.h>
const int led = 0;
#define led1 11
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(led, OUTPUT);
pinMode(led1, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(led, HIGH);
digitalWrite(led1, HIGH);
delay(1000); // wait for a second
digitalWrite(led1, LOW);
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
This is the code that does not work (led1 is reset pin as GPIO). Even if I change the led1 declaration to PB3 of PCINT11, it still does not work.


