Our Batteries
Industrial LiFePO4 Power Systems
  • Forklift Batteries
  • Golf Cart Batteries
  • AGV & AMR Batteries
  • Pallet Jack Batteries
  • LFP Cells
  • Custom & Charging
48hr US Shipping
2-Year Warranty
US Technical Support
Request a Quote
About
Solutions Contact Request a Quote

Choosing between the PIC16 and PIC18 families

The PIC16 and PIC18 are Microchip’s two families of 8-bit microcontroller for general work. A design settled on a PIC chooses between them by the size of its program and the load its core has to carry. The pick sets the cost of the part and the room the design has to grow into. This is the line that runs between the two families, and a job lands on one side of it.

The PIC16, the smaller core

A pinout diagram of the 18-pin PIC16F62x microcontroller
A pinout diagram of the 18-pin PIC16F62x family, each pin labelled with its port bit and the functions multiplexed onto it, among them the analog inputs, the comparators, the oscillator, and the serial pins. A labelled schematic of the pinout. Image: JimyXT, CC BY-SA 4.0.

The PIC16 is the mid-range of Microchip’s 8-bit line, its core suited to small, low-cost jobs. The classic part runs a fourteen-bit instruction word through a set of around thirty-five instructions. A single working register holds the data the core acts on. The data memory sits in banks the program switches between, a bank-select step the code carries each time it reaches across the boundary. An eight-level hardware stack holds the return addresses for nested calls. Indirect addressing runs through a file-select register and its indirect file, the path the core walks a RAM buffer along. An interrupt on the classic core lands on a single vector, the code reading the flags to find what raised it. A watchdog timer, a brown-out reset, and an internal oscillator sit on the chip, the housekeeping that lets a small controller run untended. A small core makes a small die at low cost. The PIC16 fills high-volume work on that low price, a few cents a part the thing that wins it the design. The classic mid-range parts have shipped for decades and sit in countless designs, the core a known quantity to a generation of firmware engineers.

Microchip drew a second PIC16 core, the enhanced mid-range, for the parts named PIC16F1. It lifts the instruction set to around forty-nine and deepens the stack to sixteen levels. The data memory opens to a flatter layout a C compiler reaches with less banking, the linear access and the table reads taking work off the programmer. In-circuit debug came onto the core itself on these parts, a developer stepping through code on the chip with no separate emulator. The enhanced core saves the working context on an interrupt by itself, the registers a routine has to protect kept by hardware now, the hand-written save no longer needed. The instruction set added the table reads that fetch constant data from program memory and the indirect branches a C compiler leans on. Peripheral pin select arrived on these parts as well, the on-chip functions routed to the pins a board layout wants. The enhanced PIC16 carries the family up the range of jobs it can hold, a low-cost part with a core that handles a program a classic mid-range would have strained on.

The modern PIC16 carries a set of core-independent peripherals, blocks that run a task with no work from the core. A configurable logic cell, a numerically controlled oscillator, a CRC-and-scan unit, a signal modulator, peripheral pin select, a complementary waveform generator, each handling its job with no call on the processor. A timer that resets itself on an input, a logic function wired in hardware and left to run, these lift load off a small core and let it hold a job that once needed a bigger one. The peripheral pin select lets a designer move a function to the pin a board layout wants, a freedom that used to cost a rework. A configurable logic cell wired to a timer builds a small state machine that runs with the core asleep, the kind of glue logic that once took a separate chip. The family spreads from eight-pin parts up to sixty-four, a designer taking the pin count a board has room for. The PIC16 sits today on the low-cost, low-pin work, a sensor read, a motor driven, a panel of buttons watched, the job of a small controller done for a few cents.

The PIC18, the larger core

A PIC18F4550 microcontroller in a 40-pin dual in-line package
A PIC18F4550 in a 40-pin dual in-line package, set beside the socket it programs in. The 40 pins carry the wider port set and the heavier peripherals of the larger 8-bit core, a USB engine among them on this part. Image: Rakesh Mondal, CC BY-SA 3.0.

The PIC18 is the top of Microchip’s 8-bit line, a core for larger programs written in C. It carries a sixteen-bit instruction word and a set of around seventy-seven instructions, the wider word holding richer operations in a single step. The core runs up to about sixteen million instructions a second at its rated clock. The design of the part looks toward a compiler from the start, the instruction set shaped around the operations a C compiler emits. A move that carries data straight from one memory spot to another, a handle on a pointer, a scale on an index, each sits in the set because a compiler needs it. The generated code comes out shorter. The PIC18 runs a two-level priority interrupt, a high priority that takes the core ahead of a low one. A design with a fast event beside a slow one sorts the two by priority, the poll loop no longer the only path to a quick response.

An eight-by-eight hardware multiplier sits in the PIC18 core, a multiply finished in a single cycle. A multiply that would take many cycles as a software routine lands in one, the cycles and the code both short. The hardware stack runs thirty-one levels deep across the family, some parts reaching a hundred and twenty-eight. The core opens that stack to software, the deeper call chains a large C program builds reachable without a workaround. An access bank gives the core a fast window onto the working variables and the special-function registers, the common path through the code kept quick.

The PIC18 addresses its memory in a flat, linear map, the program space reaching into the megabytes and the data space into tens of kilobytes, the layout flat enough that little bank switching is needed. A C compiler lays a large program across that space with little of the paging work the older cores asked for. A program that has grown to tens of kilobytes of code stays readable to the compiler and quick on the core, the linear reach carrying it. A part in the family runs to a hundred and twenty-eight kilobytes of flash and past it, the room a large application and its data tables ask for. A table of constants, a font, a calibration curve, sits in the program flash, the core reading it straight from there. A big PIC application written in C runs leaner on a PIC18, the core and the memory working together.

The PIC18 families carry the heavier peripherals an 8-bit design reaches for. A CAN controller for a vehicle bus, a USB engine for a device port, more serial channels, more timers, the same core-independent peripherals the enhanced PIC16 carries. A design that needs a bus stack or a USB endpoint on an 8-bit part finds it in the PIC18 line. The core holds the headroom to run that stack and the application code beside it, a job that would crowd a smaller part. Many PIC18 parts run to five volts, a help in a noisy industrial rail or a motor design. The newer PIC18-Q families pair the core with a deep set of the core-independent peripherals, the analog and the digital blocks a modern 8-bit design leans on. A part with op-amps, comparators, and a twelve-bit converter on chip pulls a board’s analog front end onto the controller, a few outboard parts saved.

Where the line falls

The line is not a single number.

The size of the program sets the choice first. A job that fits in a few kilobytes of code, a handful of pins, a simple loop, sits well inside what a PIC16 holds. The lower cost of the part is the gain on that fit. A program that climbs past the PIC16’s memory, that fills the banks and runs into the limits of the fourteen-bit core, has reached the point the PIC18 answers. The ranges of the two families overlap in the middle, a job near the edge run on either part depending on whether the cost or the room weighs more in the design. A designer reads the program against the memory of the part and the reach of the core, the fit of the two the thing that settles it. A part bought with far more memory than the program needs is money spent on headroom a design never uses. A part chosen a size too small leaves no room for the field updates a product takes over its life, a tight fit at the start a cost paid later. A thermostat with a small control loop, a display, and a few buttons fits a PIC16 and ships at the lower cost, the kind of job the family fits. A reader leaves a margin of flash and RAM above the first build, room for the features a product adds over its life. The pick is made once and lived with for the production run, the cost of a wrong size paid on every unit or in a redesign mid-life.

The work the core does is the second signal. A control loop that runs real arithmetic, a digital filter, a PID term, a fixed-point scale, runs the multiplier on the PIC18 in a single cycle, the loop kept short and the code with it. A design heavy in math leans toward the PIC18 for the multiplier alone, the cycles saved on every pass through the loop adding up where the loop runs fast. A brushless motor drive that runs its commutation math each cycle is a PIC18 job, the multiplier paying off in the inner loop. A job that does little past moving bits and reading inputs asks nothing of a multiplier. The PIC16 carries it at the lower cost.

The way the program is written points the same way. A large body of C compiles tighter on the PIC18, the core shaped to the operations a compiler emits, the memory flat under it. A team that writes in C and watches its code size finds the PIC18 makes leaner use of the flash on a big program. A small program in C fits either part. The gain of the PIC18 shows on a program grown into the tens of kilobytes, the place the flat memory and the wide core pay back on the compiler’s output. A team measures its build against the flash of the part it sits on, a program filling the part to its edges the sign to move up a size.

Cost and pin count pull toward the PIC16. A design built down to a price, made in the millions, counts every cent of the part. The PIC16 holds that line on the smallest of the jobs. A board with room for only a few pins, a part that has to sit in a small package, finds the PIC16 in the small sizes the family offers wide. A job the PIC16 can hold stays on it to save the cost. The bigger core waits for the work that genuinely needs it.

Power and the low-power parts

The choice of family meets the choice of power early. Microchip offers many parts in an F version and an LF version of the same die. A design on a five-volt rail takes the F part, the headroom and the drive it needs. A design on a coin cell takes the LF part, its floor down in the low single volts. The split runs across both the PIC16 and the PIC18, the power choice made alongside the core choice. A low operating voltage and a small sleep current weigh on a battery design as much as the size of the program. A reader picks the LF part on a coin cell from the first sketch, the low voltage floor designed in from the start.

The low-power parts carry sleep modes that pull the current down to nanoamps between tasks. A part spends the gap between tasks in sleep, waking on a timer or a pin to do its work. A sensor that reports once a minute spends almost all its life asleep, the battery lasting years on the right part. The eXtreme Low Power line holds the sleep current low enough that the leakage of the part sets the battery life, the work it does a small part of the draw.

The core-independent peripherals carry the low-power story further. A peripheral that runs a task with the core asleep keeps the average current low, the processor woken only when a result is ready. A logic cell counting pulses, a timer measuring a gap, a converter sampling on a schedule, each runs in sleep and wakes the core at the end. The work gets done with the costly part of the chip switched off, the power budget won in the peripherals around the core.

One toolchain, an easy move

The two families share one toolchain. MPLAB X is the IDE for both. The XC8 compiler builds C for both. One programmer flashes either part. The Code Configurator writes the setup code for a peripheral from a few settings, the same tool across the 8-bit line. A simulator and a debugger in MPLAB X run a design before the silicon lands, the same windows open for either family. A team that knows the PIC16 carries that knowledge straight to the PIC18, the registers and the peripherals named in the same style across the line. The learning a shop spends on one family is not spent again on the other, a saving that counts as much as the price of the part.

A design moves between the families with less work than a move to another vendor asks. C code written for one core compiles for the other, the peripheral registers close enough that the port stays light. Some parts share a pinout across the families, a board laid out for one able to take the other in the same footprint. A design that starts on a PIC16 can step up to a PIC18 later without leaving Microchip’s tools or its part numbers, the upgrade a recompile and a new part, no fresh start needed. A prototype begun on the larger part can move down to a PIC16 for production once the code size is known, the cost trimmed at the end. The shared tools make that move a matter of a recompile and a board spin, the firmware and the team’s habits carried across unchanged.

Sourcing both families

Both families are stocked deep and held in production for years. Microchip carries its 8-bit lines for years and names long production runs for them, the horizon a product with a decade of life needs. The vendor holds parts under a continuity program for the long industrial and automotive lives that need them, a part still bought ten years on. A part comes in the temperature grades those markets ask for, the industrial and the extended ranges stocked beside the commercial. A part chosen from either family today has a path to the same part, or a near sibling, years on. A distributor stocks the common PIC16 and PIC18 parts deep, the volume of the families keeping them on the shelf through the swings that empty other bins.

The families spread across a wide set of packages and memory sizes. A part comes in the pin count and the flash a design asks for, the same core offered in a small package or a large one. A buyer who stays inside one family, and inside one vendor, keeps the second source and the upgrade path within reach. A design that picks a PIC16 or a PIC18 picks a part with a long road of compatible siblings ahead of it, a thing a sourcing plan values as much as the price on the first order. A part grown scarce in one package often has the same die in another a board can take, the family wide enough to route around a single shortage.

Common questions about choosing a PIC family

Is the PIC18 better than the PIC16?

Neither leads on its own. When a job is small and built down to a cost, the PIC16 fits it at the lower price. When a program grows large, or leans on arithmetic, the PIC18 carries it on a wider core. The size of the program and the load on the core set the pick.

Can I move code from a PIC16 to a PIC18?

Yes. C code compiles for both cores. The peripheral registers are named in the same style, so the port stays light. The two families share MPLAB X and the XC8 compiler. Some parts share a pinout, so a design can step up without leaving Microchip’s tools or its part numbers.

Does the PIC16 still make sense for new designs?

Yes. The enhanced mid-range PIC16F1 core, with its deeper stack, flatter memory, and core-independent peripherals, holds a wide range of low-cost, low-pin work. A small, cost-driven job in high volume sits well on a PIC16, the few cents a part saves counting across a long production run.

What does the PIC18 add?

The PIC18 carries a sixteen-bit instruction word, a single-cycle hardware multiplier, a deeper software-accessible stack, linear memory addressing into the megabytes, and heavier peripherals such as CAN and USB. These suit larger programs written in C and designs that run real arithmetic in a tight loop.

Which family is cheaper?

The PIC16 holds the lower cost for an equivalent small job, the smaller die and the lower pin count behind the price. The gap closes on a larger job, where a PIC16 needs the memory and the peripherals a PIC18 already carries. The exact price sits with the specific part and the order volume, a figure a distributor quote settles.

Do the PIC16 and PIC18 use the same compiler?

Yes. The XC8 compiler builds C for both 8-bit families. MPLAB X is the IDE for both. A team writes, debugs, and flashes either part with one set of tools, the time spent learning one family carried straight to the other.

Scroll to Top