| Electronics > Beginners |
| Atmel external interrupt and rotary encoder |
| << < (4/4) |
| Naguissa:
You can use only one of both, as pulses come very close (you will need turn the encoder a little bit more) or use a xor gate and wake up on change if possible. Enviado desde mi Jolla mediante Tapatalk |
| Zanshin:
@mvs The Atmel is in power off mode, so only the 2 external interrupts or an I2C address match will wake it up; therefore I can't use the pin-change-interrupts on any other pins. The Rotary encoder uses pin-change interrupts in normal operating mode. I've got some 4-channel XOR chips on order now which fit perfectly - I have a total of 5 external lines which can trigger a wakeup (clockwise turn, counterclockwise turn, pushbutton, SPI SS and 1-Wire) so the XOR solution fits perfectly for this project: low-cost, low-energy and a small footprint. Thanks for all the help! |
| mvs:
--- Quote from: Zanshin on November 16, 2018, 06:36:04 am ---@mvs The Atmel is in power off mode, so only the 2 external interrupts or an I2C address match will wake it up; therefore I can't use the pin-change-interrupts on any other pins. The Rotary encoder uses pin-change interrupts in normal operating mode. --- End quote --- Pin Change Interrupt is a valid wake up source for all sleep modes including power down, see Table 7-1 in Atmega328P datasheet. |
| Zanshin:
@MVS we were looking at the same datasheet but one of us was mis-interpreting the chart :palm: While I've now got some unnecessary XOR chips on order, I can now use the pins directly to wake up the Atmel; I'm already using pins from each of the pin-change-interrupt ports so I don't even have to change my code. Thanks. |
| Navigation |
| Message Index |
| Previous page |