Electronics > Beginners

Atmel external interrupt and rotary encoder

(1/4) > >>

Zanshin:
The Atmel microcontrollers that I am using have 2 external pins that can be used to wake the device upon pin change. I am already using one of these and thus have only one left available. I would like to connect a standard quadrature encoder so that the device wakes up when it is turned.  But the encoder has two lines that can be either "high" or "low" (1 or 0) when the device is put to sleep. Turning the encoder will transition one of these two pins to the other state. This gives 4  possible states where the transition to another state is always done just one pin at a time.

State0 00 11 01 1
I cannot figure out how to electronically combine these two pins so that any state change will trigger a pin change and wake up the device. At first I thought I could combine some diodes and an OR gate and a NAND gate, but that didn't solve my issue for all 4 combinations and thus I'm posting my question here to see if there is an answer to what I assume is a basic electrical engineering problem.

t1d:
Hmm??? Where did my reply go?

Not my strongest area, but...

Rotary encoders have, very often, a separate switch that is actuated, by pressing down on the stem. There is a separate set of pins, for the switch. Three for the RE and two, for the switch.

Set the pin state low, as a matter of the go-to-sleep procedure. When the pin goes high, on a button press, wake up and switch over to the RE decoding function. Or, visa verse, high to low. Don't forget the pull-up, or pull-down, resistors.

This means that the switch and the RE share the one controller pin. Add diodes, to prevent power getting to the wrong place.

If you must go with turning the RE, just turn the stem several clicks, to make sure that the logic state changes... On any change, wake up the controller and switch over to the decoding function...

Hope that gives you some ideas...

Yanayoei:
Gusto ko talagang malaman kung paano i-scan ang site at karamihan sa mga impormasyon tungkol dito ay sapat na upang ipaliwanag?

t1d:

--- Quote from: Yanayoei on November 14, 2018, 10:32:36 am ---Gusto ko talagang malaman kung paano i-scan ang site at karamihan sa mga impormasyon tungkol dito ay sapat na upang ipaliwanag?

--- End quote ---
Translated on Google
"I really want to know how to scan the site and most of the information about it is enough to explain?"

I think this was posted to the wrong spot, maybe?

Peabody:
One possibility is to select an encoder which has the same number of detents per revolution as pulses per revolution.  These will have both switches open at every detent, so any wakeup transition would always be high-to-low on one of the switches, and diodes could be used for the OR function.  Of course the servicing algorithm for these encoders is slightly different than for those with pulses = detents/2.  You get the full 11-10-00-01-11 or 11-01-00-10-11 sequence between each detent.

Once your device wakes up, how are you planning to service the encoder?  Will you be using polling?

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod