0
\$\begingroup\$

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.

\$\endgroup\$
8
  • \$\begingroup\$ You are probably resetting the chip. When configured as a reset input, the logic high level is considered anything 0.9xVcc or above (4.5V). Anywhere between there and 1V and the chip may or may not be in reset. \$\endgroup\$ Jan 9, 2018 at 20:43
  • \$\begingroup\$ Try blinking an LED as the first thing you do in the program and see if it blinks when you take the reset signal down to 3.7V \$\endgroup\$ Jan 9, 2018 at 20:44
  • 1
    \$\begingroup\$ @TomCarpenter One could almost think you were reading a datasheet if you could come up with this vital information. \$\endgroup\$ Jan 9, 2018 at 20:52
  • 3
    \$\begingroup\$ @HarrySvensson maybe. ;) \$\endgroup\$ Jan 9, 2018 at 20:53
  • 1
    \$\begingroup\$ Take note that you can only use the reset pin as an input if you disable its reset functionality, and you need an ISP programmer to set the fuses to do that. Without reset pin, uploading a program using Arduino will be much harder, and ISP programming will become impossible altogether. \$\endgroup\$
    – marcelm
    Jan 9, 2018 at 22:37

1 Answer 1

1
\$\begingroup\$

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.
\$\endgroup\$
1
  • 1
    \$\begingroup\$ Looks like the pull-up resistor inside is keeping me from reading correct values. Well, time to get a different mcu with more IO. Thanks for your help! \$\endgroup\$
    – user158029
    Jan 10, 2018 at 18:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy