I try PAUSE 1000 and does'nt seem to pause program 1 seconds. Why?


Closed Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2010
    Posts
    37

    Default I try PAUSE 1000 and does'nt seem to pause program 1 seconds. Why?

    For large amount of time, Pause does'nt seem to work well, the measured period is less than I expected.
    Code:
    main:
    high Led
    For i = 1 to 30
    pause 100
    next i
    low Led
    for i = 1 to 30
    pause 100
    next i
    goto main
    Above code produced about 1Hz on Led pin and not 1/6Hz!

  2. #2
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    637


    Did you find this post helpful? Yes | No

    Default Re: I try PAUSE 1000 and does'nt seem to pause program 1 seconds. Why?

    Quote Originally Posted by luxornet View Post
    For large amount of time, Pause does'nt seem to work well, the measured period is less than I expected.
    Code:
    main:
    high Led
    For i = 1 to 30
    pause 100
    next i
    low Led
    for i = 1 to 30
    pause 100
    next i
    goto main
    Above code produced about 1Hz on Led pin and not 1/6Hz!
    You are pausing for 3 seconds instead of 1 second.
    "No one is completely worthless. They can always serve as a bad example."

    Anonymous

  3. #3
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,520


    Did you find this post helpful? Yes | No

    Default Re: I try PAUSE 1000 and does'nt seem to pause program 1 seconds. Why?

    What's the oscillator frequency and have you used DEFINE OSC xx to inform the compiler OF that oscillator frequency?

    /Henrik.

  4. #4
    Join Date
    Jan 2010
    Posts
    37


    Did you find this post helpful? Yes | No

    Default Re: I try PAUSE 1000 and does'nt seem to pause program 1 seconds. Why?

    I tried with 8MHz resonator and DEFINE OSC 8.
    The LCD attached to PIC display data properly and all other thing work well.
    Somebody else tried large PAUSE?

  5. #5
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,520


    Did you find this post helpful? Yes | No

    Default Re: I try PAUSE 1000 and does'nt seem to pause program 1 seconds. Why?

    Yes, many many many times and never ever have I had an issue.
    Which chip?
    What version of PBP?
    Are you using the default CONFIG?

    /Henrik.

  6. #6
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    637


    Did you find this post helpful? Yes | No

    Default Re: I try PAUSE 1000 and does'nt seem to pause program 1 seconds. Why?

    I didn't read the last sentence of your first post. Yes, besides DEFINE OSC 8, you might need to check on other registers related to the PIC frequency. Does your chip uses the OSCCON register? What chip are you using?
    "No one is completely worthless. They can always serve as a bad example."

    Anonymous

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


    Did you find this post helpful? Yes | No

    Default Re: I try PAUSE 1000 and does'nt seem to pause program 1 seconds. Why?

    Quote Originally Posted by HenrikOlsson View Post
    What's the oscillator frequency and have you used DEFINE OSC xx to inform the compiler OF that oscillator frequency?

    /Henrik.
    . . . and be sure your define is in ALL CAPITAL LETTERS as Henrik posted, lower case will not work.
    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.

Similar Threads

  1. Pause command? (maximum number of seconds allowable?)
    By HankMcSpank in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 8th July 2010, 05:24
  2. Do I need a pause?
    By tazntex in forum Serial
    Replies: 21
    Last Post: - 29th August 2008, 04:32
  3. Pause
    By blue in forum General
    Replies: 7
    Last Post: - 29th December 2005, 14:24
  4. pause 0.5
    By detail in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 27th June 2005, 11:32
  5. GOSUB to do a pause?
    By tcbcats in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 11th August 2004, 15:21

Members who have read this thread : 1

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