M
Michael C
- Jan 1, 1970
- 0
I've asked this question here before and got the answer that it's possible
to do it with a resisitor and a cap by measuring how long it takes for the
pin to reach a high state. I tried this and much to my suprise it worked
extremely well first go. I just guessed values for the resistor, capacitor
and delays in software and it all worked straight off! Usually it takes me
hours or days of stuffing around to get something like this working.
Anyway, my question is that it is possible to measure voltages higher than 5
volts while keeping the voltage at the pin continuously below 5 volts. But
there is an off chance of the micro crashing and leaving the pin as open
which would allow the voltage at the pin to exceed 5 volts. This can only
happen while the pin is in it's high (open) state as a low state will hold
the voltage low. Is this likely to be a damage the micro? Should I use
resistors to, say, halve the voltage and keep it at a max of 5volts?
My other question was when I switch the micro pin low to discharge the cap
it will discharge very quickly. Is that likely to be a problem? Should I use
a resistor to slow the discharge?
Thanks again,
Michael
to do it with a resisitor and a cap by measuring how long it takes for the
pin to reach a high state. I tried this and much to my suprise it worked
extremely well first go. I just guessed values for the resistor, capacitor
and delays in software and it all worked straight off! Usually it takes me
hours or days of stuffing around to get something like this working.
Anyway, my question is that it is possible to measure voltages higher than 5
volts while keeping the voltage at the pin continuously below 5 volts. But
there is an off chance of the micro crashing and leaving the pin as open
which would allow the voltage at the pin to exceed 5 volts. This can only
happen while the pin is in it's high (open) state as a low state will hold
the voltage low. Is this likely to be a damage the micro? Should I use
resistors to, say, halve the voltage and keep it at a max of 5volts?
My other question was when I switch the micro pin low to discharge the cap
it will discharge very quickly. Is that likely to be a problem? Should I use
a resistor to slow the discharge?
Thanks again,
Michael