Is there a faster way to compare?


Results 1 to 13 of 13

Threaded View

  1. #1
    Join Date
    Aug 2006
    Location
    Omaha, Nebraska USA
    Posts
    263

    Question Is there a faster way to compare?

    I'm doing something like this (pseudocode):

    FOR INDEX=1 TO SOMETHING
    IF INDEX>A THEN PIN1=1
    IF INDEX>B THEN PIN2=1
    IF INDEX>C THEN PIN3=1
    IF INDEX>D THEN PIN4=1
    IF INDEX>E THEN PIN5=1
    NEXT INDEX

    Each of those IF . . . THENs appears to chew up a lot of time, each reducing the upper limit on the number of iterations (SOMETHING).

    I'm having to do this in/as an interrupt handler and I've got about 7ms (at 8MHz) to do it in.

    Is there a faster/better/simpler way? (Someone <i><u>please</u></i> tell me there is!)

    Fingers crossed here . . .
    Last edited by RussMartin; - 7th February 2010 at 20:05.
    Russ
    N0EVC, xWB6ONT, xWN6ONT

    "Easy to use" is easy to say.

Similar Threads

  1. How to compare strings/array? RFID Project
    By dan-tron in forum mel PIC BASIC Pro
    Replies: 100
    Last Post: - 10th April 2017, 07:21
  2. how to compare data
    By Mus.me in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 1st November 2009, 22:30
  3. Compare Data
    By Pesticida in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 14th February 2008, 20:40
  4. 12F675 compare voltage help.
    By geckogrotto in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 2nd February 2007, 16:46
  5. OT - Firefox browser - faster performance
    By malc-c in forum Off Topic
    Replies: 2
    Last Post: - 14th August 2006, 10:33

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