calculating speed of a loop


Closed Thread
Results 1 to 2 of 2
  1. #1
    EDWARD's Avatar
    EDWARD Guest

    Default calculating speed of a loop

    THIS MY BE A SIMPLE QUestion.

    lets say i have a loop like the one below. how long would it take for x=65,000. i have a 4 mhz proccessor (actually 4.19 i use HS)

    x=0

    loop:
    x = x+1
    goto loop

    basiically i need a have a variable count for 500 ms. how high would it have to count? am i goning to need to nest a counter? is it 1 assembly instruction for every clock cycle?

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Edward,

    Take a look at this thread. You can easily measure the actual loop time, and adjust it accordingly.

    http://www.picbasic.co.uk/forum/showthread.php?t=365

    HTH,
     Darrel

Similar Threads

  1. Controlsystem for compact sporting (clay shooting)
    By Fredrick in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 30th July 2009, 16:48
  2. Closed loop speed controller
    By Ryan7777 in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 26th January 2008, 14:15
  3. Replies: 14
    Last Post: - 26th September 2007, 05:41
  4. Serial Relays
    By tazntex in forum General
    Replies: 3
    Last Post: - 17th May 2007, 17:42
  5. Newbie question:
    By Izone in forum mel PIC BASIC
    Replies: 2
    Last Post: - 26th February 2006, 16:24

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