Button/switch debouncing


Closed Thread
Results 1 to 16 of 16

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default

    Hi Melanie, thanks.

    I understand what you are saying, but don't understand whether you answered my question

    Quote Originally Posted by Melanie View Post
    You don't HAVE to use any of PICBasics commands...
    - Clearly, but that would leave me with, ...with, ..................ASSEMBLER! :0
    Pat. Pending

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


    Did you find this post helpful? Yes | No

    Default

    Clearly, but that would leave me with, ...with, ..................ASSEMBLER!
    No it wouldn't... take this thread topic as an example...

    First here's a couple of defines...
    Code:
    	MyButton var PortB.0
    	ButtonTemp var Byte
    Now check this code...
    Code:
    	ButtonTemp=0
    	BUTTON MyButton,0,255,0,ButtonTemp,1,ExecuteButton
    Look at the above code... it's almost the same as...
    Code:
    	IF MyButton=0 then
    		Pause 10
    		Goto ExecuteButton
    		Endif
    The salient difference is that the example with the IF statement doesn't require a dummy variable for it's exclusive use.

    Compile both examples... tell me which one uses more codespace? Both exclusively use PBP, neither uses any Assembler.

    When I say "Learn how to access and manipulate PICs Registers", - you're probably already doing it. To disable Comparators on may PICs you need to set...
    Code:
    	CMCON=7
    Well, that statement has preset the CMCON register with a value of 7 (ie CMCON=%00000111). So now, what's so difficult about dropping a byte into the appropriate USART Register instead of using HSEROUT?

Similar Threads

  1. What debouncing technicques do you know?
    By Humbleworker in forum General
    Replies: 4
    Last Post: - 30th March 2007, 16:55
  2. Debouncing
    By Demon in forum Documentation
    Replies: 0
    Last Post: - 24th October 2005, 19:40

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