Electrical – Attiny 45 use reset pin as analog input

attinypinsreset

So after debugging for 6h+ I am stuck at that the reset pin of my attiny 45 needs to differentiate between two voltage levels. (5v and 3.7v) Ive seen in the datasheet that this pin has an adc. So it should be able to read an analog value, right? Atleast as long as it is not pulled to gnd. I am using an Arduino Uno as an isp to program the chip.
The essential question I have, which pin number has the reset pin in arduino code? As it seems th hang on this point. I thought it is five. But it doesnt seem to work. (I may be worng on this part because my debugging seemd to loose quality over time.) Ive also found, that one may need to put the chip in high voltage programming mode, which I wont like to do.

Best Answer

A few gotchas using the RESET pin as input...

  1. There is an internal pull-up resistor on it...

enter image description here

  1. In order to be able to use the ~RESET pin as an input and NOT also reset the chip, you need to disable the RESET pin with the RSTDISBL fuse...

enter image description here

  1. If you set the RSTDISBL fuse, you will be unable to use in-circuit programming to reprogram the part.