Cannot access PB3 of attiny44 using arduino IDE platform

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 pin11 but if I declare it as pin 11, the reset pin does not function at all.

 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"

The code works with only direct declaration.

In my code i just need to add pin number to the command that is #define Tink 2

Even if i change the led1 declaration to PB3 of PCINT11, it still does not work.

I am using damellis file to use arduino as ISP programmer. All portA works perfectly but portB3 does not work.

The RESET pin of attiny cannot be used as an Arduino pin unless the internal fuses are changed to allow it. Once that fuse has been changed, ISP programming can no longer be used, because for ISP programming, the RESET pin must be in its original mode. The only way to change the fuse back is, I think, to use a "high voltage programmer" which is a specialist and expensive programmer.

However, it is possible to change the fuse and install a bootloader which allows the chip to be programmed over USB. This is how Digispark boards work.

Yes, i already did that it works also perfectly, luckily, i have high voltage programmer with me so that's not at all an issue for me.

But only with this kind of declaration:

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"

I just want declare one variable as PB3. How do i do that

I think you simply use digitalWrite(11, HIGH). Why are you trying to use direct port manipulation here?

You mean the damellis core package for attiny chips?

If so, I recommend you change to use the SpenceKonde core package (the image you posted above comes from the same developer).

1 Like

Manipulation is because int led=11; does not work.
yes i am using damellis.
Is there any way to declare in this one because i am afraid spence would take time to install, i have to do alot of research before i can do it.

OK, i am using arduino platform for writing code and then i use HVP in order to turn my reset pin into GPIO. Just now i made a test using atmel studio (the pin declaration as PB3 and it worked perfectly) but in arduino IDE it does not work.I believe that there is some issue with library file, let me try spencekonde core package as you have mentioned.

Hi,it is working but only with internal crystal , my project uses 8MHZ external crystal, spence does not work with 8mhz

From this page:

External crystal (all except 828, 43 and x8-family):
...
8 MHz

Oh God!!!!!!!!!!!!!!!! it does not accept 8MHZ clock :frowning: then what do i do now.

@DrAzzy can you please confirm for the benefit of @polish_girl if your attiny core supports 8MHz external crystal on attiny44?

1 Like


see it does show 8MHZ but it does not upload to IC, i checked with my HVP(high voltage programmer)
It shows me (CKSEL 3-0= 0000 external clock).
Same issue is there with 16mhz, i believe there is some other issue.

Thank you sooooo much for your help. I struggled for a week and now finally got it working perfectly.

The issue was, i used version 1.5.2 but with spence we have to use version 1.4.0 otherwise external crystals won't work

The hell? You're saying that crystals don't work on the r84 at 8 MHz on v 1.5.2? That version has been out for over a year and nobody has reported anything about it.

Note that there are two options - external CLOCK and external CRYSTAL.

Also 1.5.2 - i just checked - doesn't have the external clock options. So you're using the head from github which is 2.0.0 beta. it looks to me like that's the menu from the 2.0.0, where I use scripts to generate all the clock options for all parts. But looking at the file it should be setting the low fuses to 0xFF if you select the external crystal option (but 0xE0 if you set it to external CLOCK, which is what you seem to be selecting in the screenshot)

Hi DrAzzy, it is working perfectly now with 1.4.0 version spence konde.

Strange! For attiny44, nothing seems to have changed in the kernel

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.