COUNT is not counting again


Closed Thread
Results 1 to 34 of 34

Hybrid View

  1. #1
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by jellis00 View Post
    I discovered one of DT's posts that explained part of my problem was that I wasn't properly clearing the mismatch. When I did that the On-interrupt for RA3 worked. However, I noticed in the same DT post his statement "Keep in mind that you will get an interrupt on both the Press and Release of the button. You will eventually need to change the interrupt handler to determine which Edge occurred." I am using a momentary switch button that grounds RA3 for this On-interrupt and now I see happening what he was warning about...I get an intterupt on press AND release. However, I don't quite grasp how to modify my interrupt handler "to determine which Edge occurred." Obviously I want the interrupt to respond only to the press and not the release. Is there a way to filter out the release action to prevent the 2nd interrupt?
    Page 37 of the data sheet, Option Reg allows you to control rising or falling edge on RA2, you might have to move your ports around a bit . . .
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  2. #2
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    If your switch grounds the input pin to generate the interrupt, and it returns high when the
    switch is released, just wait for the pin to return high before exiting the interrupt.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  3. #3
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378


    Did you find this post helpful? Yes | No

    Default Your suggestion solved problem

    By following your suggestion for basically debouncing it works. Thanks for advice!

Similar Threads

  1. Can't get COUNT to count
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 24th March 2009, 00:14
  2. Remain counting while sending out a pulse
    By ultiblade in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 10th January 2007, 16:51
  3. hardware counting while software runs
    By Archangel in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 2nd October 2006, 04:26
  4. continious counting process (capture)
    By asynch in forum General
    Replies: 1
    Last Post: - 17th February 2006, 08:42
  5. Count command
    By hawk72501 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 6th September 2005, 20:04

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