I am using an ATTINY13 for a toy application. It simply blinks LEDs in specific patterns. I decided to add a "speed control" using a potentiometer but the only pin I had left is the reset pin.
I've created a voltage divider and padded it with 330 ohm resistors, and things seem to work just fine on a breadboard.
After reading up a bit on using the reset pin for ADC, it seems that some people advise that you cannot program the AVR again. I haven't had this problem, but I am also not doing in-system programming.
The code I am using to enable ADC0 on pin 1 (PB5) is as follows:
DDRB = 0b00001000; ADCSRA = 0b11100111; ADMUX = 0b00100000;
My question is: Why is this working? I would like to know a little bit more before proceeding with PCB manufacture. Is it just dumb luck so far?
I assume because reset never "sees" ground, the micro never resets spontaneously in circuit, but I'm unclear as to how I've managed to use the reset pin for ADC without disabling flash reprogramming.
Note: I currently am using a DIP-8 version of the chip in a socket, which I relocate to a programmer to change parameters. I will switch to a SOIC version for production.
Other: The 6-pin header connects to some Charlieplexed LED's