PIC Math - the need for speed


Results 1 to 19 of 19

Threaded View

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


    Did you find this post helpful? Yes | No

    Default

    Apparently, your Scope works Really Well.

    I ran the numbers again for a 16F877 this time, and the results are rather surprising.
    Code:
    Start:                     ' Cycles   uS@20mhz
        PORTD.0 = 1            '    1         .2
        Delay = Value /*$004D  '  243       48.6
        PORTD.0 = 0            '    1         .2
        PauseUs 700            ' 3502      700.4
    Goto Start                 '    4         .8
                                 -----     -----
               '    Loop Total   3751      750.2
               ' Without Pause    249
    Code:
                                ' Cycles   uS@20mhz
    Dummy1 = OldPulseTime >> 2  '  37        7.4
    Delay = Dummy1 >> 2         '  37        7.4
    Delay = Delay + Dummy1      '   6        1.2
                                 -----     -----
                  '      Total     80       16.0
    Code:
                                ' Cycles   uS@20mhz
    Dummy1 = OldPulseTime >> 1  '   5        1.0
    Dummy1 = Dummy1 >> 1        '   3         .6
    Delay = Dummy1 >> 1         '   5        1.0 
    Delay = Delay >> 1          '   3         .6
    Delay = Delay + Dummy1      '   6        1.2
                                 -----     -----
                  '      Total     22        4.2
    I really didn't expect that much difference between the same code compiled for the 2 different chips.

    Way to go Ingvar.
    Last edited by Darrel Taylor; - 11th October 2005 at 00:57.
    DT

Similar Threads

  1. SMS via pic
    By kenandere in forum GSM
    Replies: 15
    Last Post: - 10th March 2010, 11:00
  2. HSERIN & Interupts (aka controlling PIC programs from a remote PC)
    By HankMcSpank in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 17th June 2009, 15:46
  3. pic to pic ir link versus wired link : help please anyone
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 30th May 2008, 22:01
  4. My PIC can't do the math! Can yours?
    By sayzer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 12th May 2006, 08:28
  5. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 12th March 2005, 00:14

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