18F series performance not so good?


Closed Thread
Results 1 to 17 of 17

Hybrid View

  1. #1
    Join Date
    Feb 2013
    Posts
    1,158


    Did you find this post helpful? Yes | No

    Default Re: 18F series performance not so good?

    No I don't mean that. I mean different thing - a lot of code posted here is exclusively for 18F series. When asked, authors say that 16F has no speed to do it. But now it turns out that there is no performance difference per mhz at all?

  2. #2
    Join Date
    Apr 2014
    Location
    OK
    Posts
    557


    Did you find this post helpful? Yes | No

    Default Re: 18F series performance not so good?

    The PIC18F advantage over the 16F is more instructions. The 18F's ASM "MOVFF" allows transfer of a byte of data directly from one register to another. For the PIC16F, it would take several instructions using the W Register.

  3. #3
    Join Date
    Feb 2013
    Posts
    1,158


    Did you find this post helpful? Yes | No

    Default Re: 18F series performance not so good?

    Thanks!

    So besides more peripherals, like USB host, 2x osc speed and 2x memory, there are no other advantages, right?

  4. #4
    Join Date
    Aug 2011
    Posts
    460


    Did you find this post helpful? Yes | No

    Default Re: 18F series performance not so good?

    Those extra instructions definitely make a difference. It's not just clock speed. If it takes more instructions to do the same thing then that's a disadvantage.

    That, plus even though the memory is still banked you don't have the horrible ram arrangement that the PIC16 suffers from, and no program memory page issues.
    The 18F has a hardware multiplier, dual-priority interrupts, more FSR registers.

    All in all, if you have a choice between 16F and 18F, 18F is the better choice. It'll produce faster code in a lot of instances.
    The only reasons I can think of to use a 16F might be price or perhaps power consumption.
    Last edited by tumbleweed; - 12th January 2023 at 00:22.

  5. #5
    Join Date
    May 2013
    Location
    australia
    Posts
    2,705


    Did you find this post helpful? Yes | No

    Default Re: 18F series performance not so good?

    not to mention the flash memory is 16 bits wide allowing for tabled data to be accessed way easier, eliminating any need to pack/unpack data.
    bigger faster fonts with less effort, works for me
    Warning I'm not a teacher

  6. #6
    Join Date
    Feb 2013
    Posts
    1,158


    Did you find this post helpful? Yes | No

    Default Re: 18F series performance not so good?

    All that good, but does PBP uses them? The main difference I found is the dimension of arrays and long variables.
    Say, average, 500 line PBP code will run significantly faster on 18F or not?
    I don't care for banks or whatever with 16F - compiler takes care of.
    Price is also not an issue - 18F45K80 and 16F1939 (which I most often use) have same price in china - around $3 new, $1 - 2nd hand.

  7. #7
    Join Date
    May 2013
    Location
    australia
    Posts
    2,705


    Did you find this post helpful? Yes | No

    Default Re: 18F series performance not so good?

    if you put a bowling club granny in a ferari would she drive faster ?

    in the right hands a pic18 is faster by a large margin
    Warning I'm not a teacher

  8. #8
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,172


    Did you find this post helpful? Yes | No

    Default Re: 18F series performance not so good?

    Quote Originally Posted by CuriousOne View Post
    All that good, but does PBP uses them?
    Yes it does.

    You can vedrify this by yourself. Though a simple two variable multiplication in your editor and after compilation check the LST file. You will see that mulwf command is used just fine!

    Ioannis

    Code:
    '****************************************************************
    '*  Name    : UNTITLED.BAS                                      *
    '*  Author  : [select VIEW...EDITOR OPTIONS]                    *
    '*  Notice  : Copyright (c) 2023 [select VIEW...EDITOR OPTIONS] *
    '*          : All Rights Reserved                               *
    '*  Date    : 12/1/2023                                         *
    '*  Version : 1.0                                               *
    '*  Notes   :                                                   *
    '*          :                                                   *
    '****************************************************************
    
    b1   var byte
    b2   var byte
    w3   var word
    
    b1=123
    b2=456
    
    w3=b1*b2
    
    end
    and part of the LST file:

    Code:
                          00001 ;******************************************************************
                          00002 ;*  pbp_pic18FxxK40.LIB                                           *
                          00003 ;*                                                                *
                          00004 ;*  By        : Leonard Zerman, Jeff Schmoyer, Darrel Taylor,     *
                          00005 ;*              Charles Leo                                       *
                          00006 ;*  Notice    : Copyright (c) 2017 ME Labs, Inc.                  *
                          00007 ;*              All Rights Reserved                               *
                          00008 ;*  Date      : 04/05/2017                                        *
                          00009 ;*  Version   : 3.1.0                                             *
                          00010 ;*  Notes     : Created for 18FxxK40 and similar devices          *
                          00011 ;******************************************************************
                          00081   LIST
                          00082 ; Oscillator is 4MHz
                          01288   LIST
    000000                01289     ORG RESET_ORG               ; Reset vector at 0
                          01298   LIST
    000000 EF23 F000      01299         goto    INIT            ; Finish initialization
                          08250   LIST
    000004 5004           08251 MUL     movf    R1, W
    000006 0208           08252         mulwf   R3              ; R1 * R3 = PRODHL
    000008 CFF3 F006      08253         movff   PRODL, R2
    00000C CFF4 F007      08254         movff   PRODH, R2 + 1

Similar Threads

  1. Replies: 7
    Last Post: - 21st September 2014, 02:59
  2. Moving on to 18F series.
    By Tina10 in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 4th September 2012, 06:50
  3. 18F series challenges
    By Charlie in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 23rd July 2011, 16:32
  4. 18f series chip locked up
    By glkosec in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 11th August 2009, 08:27
  5. OT - Firefox browser - faster performance
    By malc-c in forum Off Topic
    Replies: 2
    Last Post: - 14th August 2006, 11: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