0
\$\begingroup\$

I have a microcontroller with only one pin left which supports external interrupts. It is supporting 3 encoders which outputs can generate either rising or falling edge. I would like to find the way to generate a pulse whenever any of the encoder pin generate rising or falling edge in order to trigger interrupt routine and read the values. I was trying to find solution but I'm stuck. Maybe someone could give me a hint what can be used for such purpose ?

\$\endgroup\$
1
\$\begingroup\$

This will work, after some fashion.

schematic

simulate this circuit – Schematic created using CircuitLab

Caveats.

If two inputs change state at the same time, their XOR (parity) sum will not change.

The pulse-forming network is a bit crude. You would be better with a Schmidt input following the RC delay. A chain of a few spare gates is also a commonly used delay element, and cleaner than an RC.

If two input changes occur within the pulse length defined by the delay, the output will not be clean.

It may be better to configure the interrupt input to detect change of state (if that's possible) and omit the pulse-forming stage.

\$\endgroup\$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.