Push button on PIC16F887


Closed Thread
Results 1 to 22 of 22

Hybrid View

  1. #1
    Join Date
    Jun 2008
    Posts
    84


    Did you find this post helpful? Yes | No

    Default

    Ye, I though about it,
    But I use the button as "Rising Edge" so when the button is pressed there is no interrupt yet.

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by menta View Post
    Ye, I though about it,
    But I use the button as "Rising Edge" so when the button is pressed there is no interrupt yet.
    I didn't say anything about the button causing the interrupt did I?
    If you re-read my post, you'll see that I said that a timer causes an interrupt and the button input is read during that interrupt. Therefore, it doesn't matter if your button pulls a line high or low, or what, as long as you are able to read the state of that pin during the interrupt.

  3. #3
    Join Date
    Jun 2008
    Posts
    84


    Did you find this post helpful? Yes | No

    Default

    Right,
    Thanks.

  4. #4


    Did you find this post helpful? Yes | No

    Default

    Just a question Menta, why did you set the ports as analogue if you are using them for a switch???

  5. #5
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by gringobomba14 View Post
    Just a question Menta, why did you set the ports as analogue if you are using them for a switch???
    They aren't...
    PortA is set for analog...
    PortB is set for digital (ANSELH = 0). The comment behind the line in the code a few posts back is technically correct, but slightly misleading.

  6. #6
    Join Date
    Jun 2008
    Posts
    84


    Did you find this post helpful? Yes | No

    Default

    Thats right.

Similar Threads

  1. 3 HPWM channels
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 4th April 2006, 02:43
  2. Code check -- button not working
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 2nd March 2006, 22:43
  3. Button Push within 3 second Window
    By Tissy in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 22nd December 2005, 10:06
  4. push button problem
    By ngeronikolos in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 2nd June 2005, 19:44
  5. Push Button 'Menu' to Choose Variable.
    By Tissy in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 10th March 2005, 07:00

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