Interrupt Button Wiring Question


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2005
    Location
    Virginia
    Posts
    65

    Question Interrupt Button Wiring Question

    Hello! I have been playing with interrupts for a few weeks now with great success (thanks to all you and the information on this forum), but I have now hit a wall. I am using a simple N.O. switch to activate an interrupt. It works wonderfully if I feed GND to the RB0 pin through a 10K resistor and hook the other end of the switch to 5V through a 100 ohm resitor. Graphically,

    o RB0
    |
    | 10K
    /\/\/\/\----------------GND
    |
    \ N.O.
    | 100
    |------------/\/\/\/\-------5V

    Due to design constraints, I need to pull it low to activate.
    Graphically,

    o RB0
    |
    | 1K-10K
    /\/\/\/\---------5V
    |
    \ N.O.
    |
    |---------------GND


    Unfortunately, this does nothing. Works great for regular button commands, just not for an interrupt. I've also tried activating the interrupt on both the rising and falling edges to no avail.

    I get the impression the interrupt likes seeing a high signal normally. I don't know how to tell it to like a normally low signal though. I've also gone through the datasheet often, though not with a fine-tooth comb.

    Anyone have any ideas? Any help is appreciated. Thanks!
    Last edited by elec_mech; - 7th June 2005 at 18:13.

  2. #2
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    elec_mech, I would lower the resistance of the pullup to about 4.7k to about 1k. if you have a meter, read the voltage at the micro pin and see if it is switching between 1/4 and 3/4 vcc.

    Dave Purola,
    N8NTA

  3. #3
    Join Date
    Apr 2005
    Location
    Virginia
    Posts
    65


    Did you find this post helpful? Yes | No

    Default Success!

    Well, I had gone down as low as 1K with no luck, but I took your advice and checked the voltage going to the pin. With the 1K I read about 2.8V, which is just above the 2.5V limit. On a side note, I checked the voltage on the pin referenced to ground with nothing connected to the pin and read 1.56V. I have no clue why this is, especially since the pin is set as an input and its initial state is programmed to be low.

    Anyways, since 2.8V was on the hairy edge, I tried two 1K's in parallel (500 ohms) and read about 3.2V. When I tried this, everything worked beautifully! Thanks for the advice Dave! I feel a little silly for not looking harder at the voltages on the pin earlier, but this is a learning experience. Thanks again!

    -Tony

  4. #4
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    elec_mech, I still beleive there is something wrong with your setup because if the pin is programmed as an input, 10k ohms should pull it all the way up to + 5 volts and with that resistor in place putting a 1k ohm resistor to ground from the same pin should result in a voltage of about .3 volts or less.

    Dave Purola,
    N8NTA

Similar Threads

  1. Using Sleep
    By elec_mech in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 17th August 2008, 04:05
  2. 3 HPWM channels
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 4th April 2006, 02:43
  3. Code check -- button not working
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 2nd March 2006, 22:43
  4. Simple Interrupt Program
    By eoasap in forum General
    Replies: 5
    Last Post: - 28th October 2005, 16:22
  5. USART interrupt not interrupting right
    By Morpheus in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 6th March 2005, 01:07

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts