for/loop for a timer?


Closed Thread
Results 1 to 4 of 4

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    What are you trying to achieve?... doing an AD conversion once per minute, otherwise keeping time in 1mS Steps?

    CounterA var word

    Loop:
    For CounterA=0 to 60000
    Pause 1
    Next CounterA
    Gosub A2D
    Goto Loop

  2. #2
    Scott's Avatar
    Scott Guest


    Did you find this post helpful? Yes | No

    Default

    I am sending data out over the GPRS network to a webserver. One minute is the minimum for the timer! I would like to be able to increment trigger every time my loop reaches 60000 with trigger = trigger + 1. My thought is that I can set "if (trigger == X)" trigger with X = 1, 2 and so on... depending on the cellular sevice provided or customers request.

  3. #3
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    Hello Scott,

    Scott>>I am sending data out over the GPRS network to a webserver. One minute is the minimum for the timer! I would like to be able to increment trigger every time my loop reaches 60000 with trigger = trigger + 1. My thought is that I can set "if (trigger == X)" trigger with X = 1, 2 and so on... depending on the cellular sevice provided or customers request.<<

    Use Melanies Code, Unless you *must* use a interupt. Melanies code will give you 1 minute delay, it is much shorter.

    Or you can use a another kind of loop:

    Loop:
    Pause 60000
    Gosub A2D
    Goto Loop

    If you use a interupt, this is a poor way how to do it. PBP will not call the interupt until the Pause is over with. Unless you use a assembly interupt.

    Dwayne
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

Similar Threads

  1. Elapsed Timer Demo
    By Darrel Taylor in forum Code Examples
    Replies: 111
    Last Post: - 29th October 2012, 17:39
  2. High Resolution Timer & Speed Calculator
    By WOZZY-2010 in forum Code Examples
    Replies: 4
    Last Post: - 7th February 2010, 16:45
  3. Timer + rc5
    By naga in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 19th November 2009, 07:56
  4. Timer interrupt frequency
    By Samoele in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 17th January 2009, 23:49
  5. timer interupt help 16f73
    By EDWARD in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 3rd July 2005, 08:41

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