cancel
Showing results for 
Search instead for 
Did you mean: 

Switching pin mode

j3lda
Associate II
Posted on January 31, 2015 at 19:13

Hello, I have log. 1 on a pin and switch it off. After switching off I need immediately  measure voltage on this pin. How can I do this?

One possibility is to configure pin to output, set log. 1, configure the same pin to input and measure voltage by ADC. But this switching takes a lot of time and I need to measure it immediately.

How can I do it with two connected pins - one ADC input and one output? How should I configure output pin?

Thank you for answeres.
1 REPLY 1
Posted on January 31, 2015 at 20:37

Define a ''lot of time'' in SI units.

You'd want to switch the output pin to an input (ideally an analogue input as this disables a schmitt trigger on the digital input). I'd perhaps suggest starting the ADC conversion, and then changing the pin mode, and having a sufficient sample time configured on the ADC, so the point at which the actual conversion process starts is sufficiently ''immediate''

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..