Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Interrupts - created equal?


  • Please log in to reply
1 reply to this topic

#1 DrJaymz

DrJaymz

    Advanced Member

  • Members
  • PipPipPip
  • 42 posts

Posted 09 February 2012 - 08:39 PM

I am using D4 and D5 with an twiddly knob (encoder). The common is connected to ground and the weak pullups are enabled. Thus when I the encoder connects D4 and Common I get a 0, and same for D5. I have built a state machine and configured it such that 4 - 1 represents a clockwise detent and 1 - 4 is anticlockwise. All good so far. I am using an interrupt on edge for both and when either is interrupted I check both and compare it with my state machine. The problem I am having is that I am not receiving all interrupts. The main weird thing is that it works better in one direction than the other. The speed of the interrupts is not very high perhaps 10 per second or so. If I disconnect my encoder and use push buttons I can see what happens. Holding down Button A first prevents Button B from generating an interrupt. B on its own generates an interrupt. Holding down B doesn't interfere with A. Its nothing to do with A not finishing the interrupt routine, everything ought to be symmetric. For now I have bodged it knowing that 3 - 1 is a clockwise rotation, though its not a valid set of states. I have added 10nF on D4 and D5 to ground, based on the premise that internal pull-up is about 100k, this should filter out glitches and still pass the fundamental that I want. Any ideas why the interrupts are not working as they should.

#2 Cello

Cello

    New Member

  • Members
  • Pip
  • 1 posts

Posted 12 May 2012 - 10:46 AM

Hi there I have the same problem with D4 and D5. I tried to rebuild a Garmin 495 for my sim setup using 2 rotary encoders and a lot of push buttons. Everything works fine exept the rotary with D4 and D5 attached. Did you find out more about that issue? PS: What avionics project are you doing? Just out of interest, I'm a fellow pilot




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.