Can use reset pin for logic input? (newbie)

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello, this is for an ATtiny45, an 8 pin device. I need to pick two pins for inputs. I tried pins 1 and 2 (PB5 and PB4 respectively) and the circuit works strangely. I am wondering if I should use another pin besides pin 1, as it is the reset pin. Question is whether it is reset by default or if there is something special you need to do to enable the reset function. Thanks.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The pin is by default reset.
You need to program a fuse to make the pin to work as I/O.
When you have done this you cannot load new program code into the chip never ever.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, you can reprogram it, but you need a high voltage capable programmer for this.

This pin also has no protection diode to VCC, so it's less protected than the other pins.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you. I will use another pin. I am using pin 5 (PB0) for PWM out. If I use pins 2 and 3 for inputs, should there be any problems?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

If I use pins 2 and 3 for inputs, should there be any problems?

That kind of depends whether you have any other plans for the functions those pins can also perform. The datasheet says:

(PCINT3/XTAL1/CLKI/OC1B/ADC3) PB3
(PCINT4/XTAL2/CLKO/OC1B/ADC2) PB4

So do you need to use them as pin change interrupts, or do you plan to use a crystal, or do you plan to use the B outputs of timer 1 or perhaps those two ADC channels? Only you, the designer, knows your plan.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Good answer. I see the logic here, thanks.