18F26K80 Code Optimisation.


Results 1 to 8 of 8

Threaded View

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


    1 out of 1 members found this post helpful. Did you find this post helpful? Yes | No

    Default Re: 18F26K80 Code Optimisation.

    Do you NEED it to run faster? Are you at or close to the limit or do you just want to see what can be done?

    I would not bother with overclocking the PIC, running it 25% above its specification, which I said in the other thread. Perhaps you couldn't make it work because it simply does not work.
    Besides, I don't think PBP has a valid DEFINE OSC for 80MHz so all software timing etc will be wrong, which I now see Alain also said in the other thread. That can of course be compensated for but nah...

    Here's what I'd do.
    Start wrapping subroutines and small sections of code with LATB.0=1 / LATB.0=0 (or whatever pin is available) and put a scope probe on that pin.
    Measure the sections and figure out where most of the time is spent. Then look at that section in more details.

    Shaving off a couple of instructioncycles here and there on code that runs 5 times per second doesn't pay off. Shaving off the same number of cycles in code that runs thousands of times per second does. I'd probably start with the display update code as outlined in my previous reply. Which I now realise is completely the oposite of what I just said but if there's anywhere you can save a LOT of cycles it might be there.

    /Henrik.
    Last edited by HenrikOlsson; - 16th August 2023 at 16:38.

Similar Threads

  1. 18F26K80 Serial setting sanity check and 4xPLL.
    By retepsnikrep in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 20th August 2023, 16:05
  2. Replies: 0
    Last Post: - 9th September 2018, 01:43
  3. Serial problem between BasicStamp code and PBP code
    By AllanZilkowsky in forum mel PIC BASIC Pro
    Replies: 22
    Last Post: - 6th April 2014, 02:15
  4. Working code but my layman approach uses too much code space
    By Christopher4187 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 14th December 2012, 20:44
  5. Code: Why is this code greater than 2000 words?
    By DrDreas in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 1st June 2007, 19:51

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