DT_INTS-18 - problem with INT0


Closed Thread
Results 1 to 17 of 17

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default

    Hi,
    Q: Isn't it so that INT_Handler execution cannot be interrupted (e.g interrupt in interrupt sequence)?
    If yes, then debounce filtering is not needed, because first falling edge trigger INT_Handler. Ringing is ignored during interrupt execution time.
    Yes, (as long as we're not talking low priority interrupts) but if the switch bounces longer than the time it takes to execute the ISR then it will get triggered again as soon as it leaves the interrupt routine.

    The while-wend loop won't solve the problem either. If the switch bounces, the while-loop may check it at a moment when it's high and then exit the ISR, the switch continues to bounce and trips the interrupt again. The switch probably bounces on release as well so even if the while-loop manages to the job "sometimes" it's likely that once the button is released causing the program to leave the ISR, it will bounce and trip the interrupt again.

    How about trying a bit of hardware, a single capacitor should do it.

    /Henrik.

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,133


    Did you find this post helpful? Yes | No

    Default

    Just post it to be sure that after this modification it will work OK. If it does, then sure the de-bounce is an issue here.

    If not, then we have to look elsewhere, though I doubt.

    Ioannis

  3. #3
    Join Date
    Dec 2007
    Location
    Finland
    Posts
    191


    Did you find this post helpful? Yes | No

    Post

    Quote Originally Posted by HenrikOlsson View Post
    How about trying a bit of hardware, a single capacitor should do it.
    I fully agree with Henrik. And a small RC-loop would be even better.

    If return from INT_Handler is not critical, then just add
    Code:
    PAUSE 100 'or some shorter time
    as a last comment in interrupt routine.

    BR,
    -Gusse-

  4. #4
    Join Date
    Dec 2008
    Location
    Los Angeles, CA
    Posts
    156


    Did you find this post helpful? Yes | No

    Smile

    I am suffering from the worst contact bounce I've ever seen.

    I'm using the INT line on a PCF8574 and thought it latched until the chip was read... false... it latches until it is read OR is returned to it's original state (which offers no help whatsoever in the case of contact bounce!)... and the INTCON2.6 settings to work on rising or falling edges doesn't help either, so simply added a .1uF cap on the INT line right at the CPU to ground, and it 100% debounced the interrupt.

    Sometimes a 10-cent hardware solution is still the best.

  5. #5
    Join Date
    Feb 2006
    Location
    Brussels, Belgium
    Posts
    104


    Did you find this post helpful? Yes | No

    Default

    Couple of closing comments from me:

    1) didn't seem to make any difference whether I used INTCON.4 = 1 or the @ INT ENABLE

    2) This particular routine when in use needs to have a 1sec exit pause anyway so I just debounced with a pause statement

    All's well that ends well - thanks for pointing me at key bouncing

    Andrew

Similar Threads

  1. USART Problem , but don't know where, in pc? or in PIC?
    By precision in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 15th July 2007, 08:12
  2. Microcode Studio 18f2455 problem?????
    By volkan in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 21st May 2007, 21:04
  3. Real Time Clock & Eeprom
    By smart_storm in forum General
    Replies: 8
    Last Post: - 17th February 2006, 19:03
  4. 1 slave 1 master 1 MAX232 1 problem ?
    By SuB-ZeRo in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 31st July 2005, 22:59
  5. PORTA.PinNo = 1 ' problem
    By frank small in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 6th May 2004, 14:30

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