Oscillo - readings not clear to me


Closed Thread
Results 1 to 7 of 7

Hybrid View

  1. #1
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938


    Did you find this post helpful? Yes | No

    Default WHILE/WEND is sometimes a blocking solution

    I have made a timer using the TMR0 interrupt.

    With the settings I use, I can't PAUSE for more than 16ms or I'll miss a tick.

    So I have to slice a
    PAUSE 50
    in
    PAUSE 10 : PAUSE 10 : PAUSE 10 : PAUSE 10 : PAUSE 10

    But this is not a problem.

    I have already used the WHILE/WEND loop followed by a PAUSE. And here, some problems occur from time to time.

    I'm not absolutely sure but I think it can miss the "real" button state. The WHILE/WEND loop can "see" a bounce of the button and not the real state of the button you actually want it to have. It may not have the desired effect.

    Moreover, this WHILE/WEND loop is a blocking loop since it will prevent the PIC to give the hand to the Interrupt as long as the button is pressed.

    I would really prefer some kind of interrupt scanning for a raising/falling edge of I/O ports with an internal routine preventing consecutive (bouncing) inputs whithin a certain time frame.

    Maybe something already existing in PICs, maybe something to do?
    Roger

  2. #2
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Default Why not Instant Interrupts

    Hi,

    I can't PAUSE for more than 16ms or I'll miss a tick
    Look at this: http://www.picbasic.co.uk/forum/showthread.php?t=3251
    Regards

    Sougata

Similar Threads

  1. Does CLEAR Command clear return adrress of a subroutine?
    By sayzer in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 19th February 2008, 16:25
  2. Replies: 14
    Last Post: - 26th September 2007, 05:41
  3. LCD and "count": need to clear LCD?
    By Mugel in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 23rd October 2006, 09:55
  4. having problems with Hantronix 20x4 lcd
    By Rhatidbwoy in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 22nd December 2005, 12:22
  5. Can anyone help a beginner in a struggle?
    By douglasjam in forum mel PIC BASIC
    Replies: 1
    Last Post: - 5th May 2005, 23:29

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