ATtiny85: pin 1 (PB5) with ATtiny core by S. Konde 1.5.2

PB5 is the reset pin (1) on the ATTiny85, ie it responds to 0V on its input to reset the chip (needed for ISP programming).

But what if this pin 1 (PB5) gets defined as an output in void setup()?
Does this set RSTDSBL, ie prevent further ISP programming? Or not, and can this board be reprogrammed over ISP?

This is using Spence Konde's ATtinycore board/core defintions.

PS: most answers to this question respond that a fuse reset does occur, others answers disagree. Reading the datasheet requires knowledge of registers which I don't have (yet).

From what I have read (I know 1% of what Spence knows) pin 1 can only be used as an I/O pin after the fuse that controls it has been set. After that, the chip cannot be programmed over ISP. The only way to restore the reset pin and ISP programming is to use a high-voltage programmer.

Ah, but you won't have knowledge of the registers until you have read the datasheet.

1 Like

Great, I have a week's vacation coming, I will know how to spend time :slightly_smiling_face:

I just found this reference, from Spence himself:

PB5 when set to work as I/O pin works fine as an input, but as an output, it's' current is extremely limited. Basically all it can do is drive the input to a digital pin on something else...

"Very limited" is not quantified but I guess not enough to drive a LED. But at least it will I think be able to grive the gate of a mosfet that will drive the led. I guess?

And this without resetting RSTDSBL, so still able to use ISP programming from what I think to understand from his comments in that link?

Perhaps enough to make a led glow very dimly.

Should be ok, yes.

But would it be easier to swap the use of a couple of pins so that PB0 is not driving a led?

No, I think you may have misunderstood. You cannot use PB0 as either input or output until you have set RSTDSBL. If you try, you will just be resetting the chip by accident.

My understanding is the PB5 can be used as an analog input (A0), be it with limited range. Dropping the input voltage below 0.5 * VCC will reset the ATttiny. I have used it (and still do in an application) on an ATtiny13, but the principle is the same. It is very usable as a digital input pin using 'analogRead()' and a voltage divider
Signal -> 10K -> A0 -> 4.7K -> VCC and consider anything below '1000' as a logical 'LOW' (10-bit ADC)
If you want to use it as an output pin you will need to set the fuse.

@DrAzzy Maintains the ATtiny core and has just released the newest 2.0 something version if i am not mistaken. If in doubt, check with the boss.

They all have to sink LED current (and serve to detect open collector device) except for one pin that drives a relay, but I want that connected to the onboard LED (I use Digispark without the USB, hence ISP programming).

Thanks Deva, but the issue here (I should have made that clear in the title, my sorry for that!) is the use of PB5 as an output.

That issue had already been addressed, you should consider swapping pin or using a pin expander of some kind.

Please see reply #8

Check the context of the post you;'re talking about from me - that was WITH rstdsbl.

Even with RSTDSBL, reset pins are piss poor outputs For technical reasons, it's apparetnly dffficult to make the output drivers such that they dont get damaged by the 12v HV programming method used for programming w/out bootloader in cases where reset is disabled or SPI programming is disabled. They recently (2016) on many of their new chips habve been makiing reset usable as input only, even when disabled as a reset pin.

Sounds like you need more pins than the t85 can get you, and it's tome to get - at minimum - an ATtiny84, or 841 - or more preferably one of the modern AVRs supported by my megaTinyCore (they are MUCH more capable parts).

No, ATTintCore 2.0.0 is not yet released, it is in public beta via manually installing the 2.0.0-dev branch from Github. There are still definiely known issues with it (though NOT MANY at this point - release could come as soon as next week for the largest release in the history for ATTinyCore by far. There will be over 700 bootloader binaries as .hex files included.. It's a pretty big deal /

In general folks, if you care about using classic tiny's please give the new version a try via manual install before the release and get those bug reports in! I can't get the CI testing to work so testing coverage is essentially 0, and it is entirely possible that huge swathes of it are broken that I don't know about because of not being able to do any sort of scalable testing.

3 Likes

"....and it's tome to get - at minimum - an ATtiny84, or 841 - or more preferably one of the modern AVRs supported by my megaTinyCore (they are MUCH more capable parts)...."

Right, but it such a challenge to squeeze the last drop out of these Tiny's.. :slight_smile:

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