Explain advantages of 18F over 16F

Discussion in 'Embedded Systems and Microcontrollers' started by wannaBinventor, Jan 8, 2011.

  1. wannaBinventor

    Thread Starter Member

    Apr 8, 2010
    179
    4
    I'm currently using the enhanced midrange devices.

    I like them over the regular midrange 16Fs because they have auto context saving on interrupt, 2 FSRs, 2 INDFs, extra instructions for easier indirect addressing, 8MIPs capabilities, extra instructions for branching, and a few other extra bells and wistles.

    I keep seeing people say things like "You should use an 18F, they are better" or "the 18F let's you do more stuff" or "the 16F is obsolete compared to the 18F"

    Can some one please save me the trouble of extensive datasheet reading and just tell me, barney style, why an 18F PIC is so much better than an enhanced midrange?

    In terms of its functions, how it operates, and how it's programmed (I only use ASM), why is it better?
     
    Last edited: Jan 8, 2011
  2. blueroomelectronics

    AAC Fanatic!

    Jul 22, 2007
    1,758
    98
    1976 = PIC1650 where every bit cost $ (lots of bank switching like the old C128 computer), tiny stack, not designed for compilers, a tiny but useful instruction set.

    18F was designed for compilers, bigger stack, hardly any bank switching, extra very useful instructions, more memory and only a buck or two more than their 16F equivalent.

    Although I cut my teeth on the 16C54 JW I don't miss bank switching, RMW, or wonky table methods in the 16 series.

    For the most part they are almost exactly the same to program, just less fuss with the 18.
     
  3. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    PIC18 series has many more features to make it "compiler friendly".

    PIC10/12/16 series are relatively hard to make a compiler for, as all the stack, bank switching, etc, needs to be accounted for or created by the compiler.

    The PIC18 series was introduced as "Optimized for C", and Microchip released C18 with it.

    If you are using something along the lines of Boost C or Mikro C, then you won't see much of a difference between PIC18 and the earlier series. If you are using assembly, you will see a huge difference, programming wise, between the two families.

    Advanced peripherals such as USB and Ethernet are generally included in many of the PIC18 series, as coding assembly for routines that intricate is a bit of a nightmare.

    Assembly is easier in the PIC18, but there are more instructions. The banks are "easier", which is what most people get caught up on. My advice is that if you have problems staying in the right "bank", you will get much better results using a compiler (C or BASIC) instead.

    That said, the PIC10/12/16 series are FAR from "Obsolete". There are a huge number of applications where a 6-18 pin uC is exactly what is needed. As long as you stick with a compiler like Mikro C or Boost C, changing the target is nearly "transparent", so the earlier series are just as simple to code for, generally.
     
  4. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    The 18F series also include onboard debug circuitry for ICD units like PICKIT 2/3 and ICD 3. Most of 16F ICs do not have that property. If you are a hobbyist. Cost is not that important. So go for 18F series MCUs. It will be a more pleasant ride
     
  5. wannaBinventor

    Thread Starter Member

    Apr 8, 2010
    179
    4
    Thanks for the replies guys.

    When you say limited bank switching, what do you mean exactly? Under what conditions are you switching banks if not all the time like on the 16F?

     
  6. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    4,887
    1,014
    My question too. I have been using the 18F for a year now and I have never had to bank switch using C.

    Perhaps maybe in assembler or for some special functions.
     
    blueroomelectronics likes this.
  7. wannaBinventor

    Thread Starter Member

    Apr 8, 2010
    179
    4

    I think in C the compiler takes care of all bank switching.
     
  8. blueroomelectronics

    AAC Fanatic!

    Jul 22, 2007
    1,758
    98
    C takes care of the bank switching for you, assembly does not.
    18F code size is smaller and more efficient than 16F.
    The awesome Swordfish BASIC compiler is only for the 18F
    C18 is for the 18F and a free student version can be downloaded.

    I've worked with PIC for over 30yrs, the older PICs are a little cheaper but only marginally.

    In the end pick whatever works for you, or get both and see what you prefer.

    Edit: ahh enhanced core (I missed that) 16F core, much nicer than the older core. Good choice for assembly, sort of like 18F lite.
     
    Last edited: Jan 9, 2011
Loading...