Can i measure 2 secs with pulsin?


Closed Thread
Results 1 to 12 of 12

Hybrid View

  1. #1
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Wink

    Hi,

    For pulsin,

    You also can play with the internal oscillator ... if your chip, like the 16F88 has a configurable internal osc ...

    use the " classic " 4 or 8 Mhz speed, and switch, on the fly, to 31 Khz or 125 Khz ... just changing osccon IRCF bits, when needed ...


    note the BUTTON command can be configured to have a 250ms debounce time ( DEFINEs ...) ... 8 x 250 ms make 2 seconds.
    which is much, much simpler !!! ( matches Bruce's idea ...)

    Alain
    Last edited by Acetronics2; - 9th March 2010 at 17:17.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  2. #2
    Join Date
    Feb 2010
    Posts
    15


    Did you find this post helpful? Yes | No

    Default

    Acetronics,

    i really don't understand very well how it's works BUTTON, but, it will work if I use BUTTON just when PIC is turned on.

    By example the following flow,

    1. turn on PIC and if button is pressed 2 seconds GOTO X, or

    2. turn on PIC and if button is not pressed run normally.

  3. #3
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Wink

    Hi, Lugo

    let's suppose your button B is active LOW

    Code:
    DEFINE BUTTON_PAUSE 250
    
    .
    .
    .
    
    FOR I = 1 to 8 
    
       Delay = 0                                ' reset check time
       BUTTON B,0,255,0,Delay,1, Incr          ' Check if button pressed for 250 ms , IF yes, increment I and recheck
       GOTO Main                              ' If not jump to main
    
       Incr:
    NEXT I                                    ' If checked 8 times we enter Setup routine
    
    Setup_routine :
    .
    .
    .
    .
    Main :
    .
    .
    Note there's NO DELAY to enter main routine if button hasn't been pressed ... either test will be left as soon as button is released ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

Similar Threads

  1. Replies: 17
    Last Post: - 12th April 2014, 02:17
  2. Funny PULSIN values: what is going on???
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 30th April 2008, 08:02
  3. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 17:27
  4. CCP1 and CCP2 to measure 2 frequencies together
    By bobonapoletano in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 28th December 2005, 07:34
  5. PULSIN and RCTIME
    By Dwayne in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 4th November 2004, 14:45

Members who have read this thread : 0

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts