Using one External Interrupt

Discussion in 'General Electronics Chat' started by chrisw1990, Oct 26, 2011.

  1. chrisw1990

    Thread Starter Active Member

    Oct 22, 2011
    543
    41
    Hi, so just had a little thought, been trying to figure out a way of letting my uP know when the user interface has been touched/changed, but only having one or two interrupts left on my pic32 has left me a little.. confused how to do this, i have attached (hopefully) a schematic of a circuit that might solve my problem, can someone have a look and "thumbs up" or "thumbs down"?
    or if you have an alternate method?
    Cheers in advance
    Chris
     
  2. crutschow

    Expert

    Mar 14, 2008
    13,006
    3,232
    That scheme should work in general.

    A 1k resistor to ground will give a low level of 1/11 * 3.3V = 0.30V when a button is pushed which I assume is well below the low-level logic threshold of the μP (?).
     
  3. chrisw1990

    Thread Starter Active Member

    Oct 22, 2011
    543
    41
    its ttl and cmos pins..
    ttl Input low level is 0.8V and cmos the same apparently.
    so yes that would work.. so hook it up like the attached image?
     
  4. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,387
    1,605
    I've done similar things and they do work well.

    Do keep in mind that as wired if the user pressed say button 2 while button 1 is pressed it will not re-trigger the interrupt.
     
    chrisw1990 likes this.
  5. crutschow

    Expert

    Mar 14, 2008
    13,006
    3,232
    I had assumed that your interrupt input was CMOS. It won't necessarily work with those resistor values for TTL since you must sink current from the input to create a logic low. You can just remove the 1k resistors and replace with a direct connection to the switches. The 1k resistors serve no real purpose. That will give a solid logic low for any logic family.
     
    chrisw1990 likes this.
  6. chrisw1990

    Thread Starter Active Member

    Oct 22, 2011
    543
    41
    they would only be momentary switches and the interface would only require one button to be pressed at a time
     
Loading...