Hubbry Logo
search
logo
2253217

PIC microcontrollers

logo
Community Hub0 Subscribers
Read side by side
from Wikipedia
PIC microcontrollers in DIP and QFN packages
16-bit 28-pin PDIP PIC24 microcontroller next to a metric ruler
Die of a PIC12C508 8-bit, fully static, EEPROM/EPROM/ROM-based CMOS microcontroller manufactured by Microchip Technology using a 1200 nanometre process
Die of a PIC16C505 CMOS ROM-based 8-bit microcontroller manufactured by Microchip Technology using a 1200 nanometre process

PIC (usually pronounced as /pɪk/) is a family of microcontrollers made by Microchip Technology, derived from the PIC1640[1][2] originally developed by General Instrument's Microelectronics Division. The name PIC initially referred to Peripheral Interface Controller,[3] and was subsequently expanded for a short time to include Programmable Intelligent Computer,[4] though the name PIC is no longer used as an acronym for any term. The first parts of the family were available in 1976; by 2013 the company had shipped more than twelve billion individual parts, used in a wide variety of embedded systems.[5]

The PIC was originally designed as a peripheral for the General Instrument CP1600, the first commercially available single-chip 16-bit microprocessor. To limit the number of pins required, the CP1600 had a complex highly-multiplexed bus which was difficult to interface with, so in addition to a variety of special-purpose peripherals, General Instrument made the programmable PIC1640 as an all-purpose peripheral. With its own small RAM, ROM and a simple CPU for controlling the transfers, it could connect the CP1600 bus to virtually any existing 8-bit peripheral. While this offered considerable power, GI's marketing was limited and the CP1600 was not a success. However, GI had also made the PIC1650, a standalone PIC1640 with additional general-purpose I/O in place of the CP1600 interface. When the company spun off their chip division to form Microchip in 1985, sales of the CP1600 were all but dead, but the PIC1650 and successors had formed a major market of their own, and they became one of the new company's primary products.[6]

Early models only had mask ROM for code storage, but with its spinoff it was soon upgraded to use EPROM and then EEPROM, which made it possible for end-users to program the devices in their own facilities. All current models use flash memory for program storage, and newer models allow the PIC to reprogram itself. Since then the line has seen significant change; memory is now available in 8-bit, 16-bit, and, in latest models, 32-bit wide. Program instructions vary in bit-count by family of PIC, and may be 12, 14, 16, or 24 bits long. The instruction set also varies by model, with more powerful chips adding instructions for digital signal processing functions. The hardware implementations of PIC devices range from 6-pin SMD, 8-pin DIP chips up to 144-pin SMD chips, with discrete I/O pins, ADC and DAC modules, and communications ports such as UART, I2C, CAN, and even USB. Low-power and high-speed variations exist for many types.

The manufacturer supplies computer software for development known as MPLAB X, assemblers and C/C++ compilers, and programmer/debugger hardware under the MPLAB and PICKit series. Third party and some open-source tools are also available. Some parts have in-circuit programming capability; low-cost development programmers are available as well as high-volume production programmers.

PIC devices are popular with both industrial developers and hobbyists due to their low cost, wide availability, large user base, an extensive collection of application notes, availability of low cost or free development tools, serial programming, and re-programmable flash-memory capability.

History

[edit]

Original concept

[edit]
Various older (EPROM) PIC microcontrollers

The original PIC was intended to be used with General Instrument's new CP1600 16-bit central processing unit (CPU). In order to fit 16-bit data and address buses into a then-standard 40-pin dual inline package (DIP) chip, the two buses shared the same set of 16 connection pins. In order to communicate with the CPU, devices had to watch other pins on the CPU to determine if the information on the bus was an address or data. Since only one of these was being presented at a time, the devices had to watch the bus to go into address mode, see if that address was part of its memory mapped input/output range, "latch" that address and then wait for the data mode to turn on and then read the value. Additionally, the CP1600 used several external pins to select which device it was attempting to talk to, further complicating the interfacing.

As interfacing devices to the CP1600 could be complex, GI also released the 164x series of support chips with all of the required circuitry built-in. These included keyboard drivers, cassette deck interfaces for storage, and a host of similar systems. For more complex systems, GI introduced the 1640 "Programmable Interface Controller" in 1975. The idea was that a device would use the PIC to handle all the interfacing with the host computer's CP1600, but also use its own internal processor to handle the actual device it was connected to. For instance, a floppy disk drive could be implemented with a PIC talking to the CPU on one side and the floppy disk controller on the other. In keeping with this idea, what would today be known as a microcontroller, the PIC included a small amount of read-only memory (ROM) that would be written with the user's device controller code, and a separate random access memory (RAM) for buffering and working with data. These were connected separately, making the PIC a Harvard architecture system with code and data being stored and managed on separate internal pathways.

In theory, the combination of CP1600 CPU and PIC1640 device controllers provided a very high-performance device control system, one that was similar in power and performance to the channel I/O controllers seen on mainframe computers. In the floppy controller example, for instance, a single PIC could control the drive, provide a reasonable amount of buffering to improve performance, and then transfer data to and from the host computer using direct memory access (DMA) or through relatively simple code in the CPU. The downside to this approach was cost; while the PIC was not necessary for low-speed devices like a keyboard, many tasks would require one or more PICs to build out a complete system.

While the design concept had a number of attractive features, General Instrument never strongly marketed the CP1600, preferring to deal only with large customers and ignoring the low-end market. This resulted in very little uptake of the system, with the Intellivision being the only really widespread use with about three million units. However, GI had introduced a standalone model PIC1650[7] in 1976, designed for use without a CP1600. Although not as powerful as the Intel MCS-48 introduced the same year, it was cheaper, and it found a market.[6] Follow-ons included the PIC1670, with instructions widened from 12 to 13 bits to provide twice the address space (64 bytes of RAM and 1024 words of ROM).[8] When GI spun off its chip division to form Microchip Technology in 1985, production of the CP1600 ended. By this time, however, the PIC1650 had developed a large market of customers using it for a wide variety of roles, and the PIC went on to become one of the new company's primary products.[6]

After the CP1600

[edit]
PIC1655 from General Instrument

In 1985, General Instrument sold their microelectronics division and the new owners cancelled almost everything which by this time was mostly out-of-date. The PIC, however, was upgraded with an internal EPROM to produce a programmable channel I/O controller. At the same time Plessey in the UK released NMOS processors numbered PIC1650 and PIC1655 based on the GI design, using the same instruction sets, either user mask programmable or versions pre-programmed for auto-diallers and keyboard interfaces.[9]

In 1998 Microchip introduced the PIC16F84, a flash programmable and erasable version of its successful serial programmable PIC16C84. In 2001, Microchip introduced more flash programmable devices, with full production commencing in 2002.[10]

Today, a huge variety of PICs are available with various on-board peripherals (serial communication modules, UARTs, motor control kernels, etc.) and program memory from 256 words to 64K words and more. A "word" is one assembly language instruction, varying in length from 8 to 16 bits, depending on the specific PIC microcontroller series.

While PIC and PICmicro are now registered trademarks of Microchip Technology, the prefix ″PIC″ is no longer used as an acronym for any term. It is generally thought that PIC stands for "Programmable Intelligent Computer", General Instruments' prefix in 1977 for the PIC1640 and PIC1650 family of microcomputers,[4] replacing the 1976 original meaning "Programmable Interface Controller" for the PIC1640 that was designed specifically to work in combination with the CP1600 microcomputer.[3] The "PIC Series Microcomputers" by General Instrument were a series of Metal-Oxide Semiconductor Large-Scale Integration (MOS/LSI) 8-bit microcomputers containing ROM, RAM, a CPU, and 8-bit input/output (I/O) registers for interfacing. At its time, this technology combined the advantages of MOS circuits with Large-Scale Integration, allowing for the creation of complex integrated circuits with high transistor density.[4]

The Microchip 16C84 (PIC16x84), introduced in 1993, was the first[11] Microchip CPU with on-chip EEPROM memory.

By 2013, Microchip was shipping over one billion PIC microcontrollers every year.[5][dubiousdiscuss]

Device families

[edit]

PIC micro chips are designed with a Harvard architecture, and are offered in various device families. The baseline and mid-range families use 8-bit wide data memory, and the high-end families use 16-bit data memory. The latest series, PIC32MZ, is a 32-bit MIPS-based microcontroller. Instruction word sizes are 12 bits (PIC10 and PIC12), 14 bits (PIC16) and 24 bits (PIC24 and dsPIC). The binary representations of the machine instructions vary by family and are shown in PIC instruction listings.

Within these families, devices may be designated PICnnCxxx (CMOS) or PICnnFxxx (Flash). "C" devices are generally classified as "Not suitable for new development" (not actively promoted by Microchip). The program memory of "C" devices is variously described as OTP, ROM, or EEPROM. As of October 2016, the only OTP product classified as "In production" is the pic16HV540. "C" devices with quartz windows (for UV erasure) are in general no longer available.

PIC10 and PIC12

[edit]

These devices feature a 12-bit wide code memory, a 32-byte register file, and a tiny two level deep call stack. They are represented by the PIC10 series, as well as by some PIC12 and PIC16 devices. Baseline devices are available in 6-pin to 40-pin packages.

Generally the first 7 to 9 bytes of the register file are special-purpose registers, and the remaining bytes are general purpose RAM. Pointers are implemented using a register pair: after writing an address to the FSR (file select register), the INDF (indirect f) register becomes an alias for the addressed register. If banked RAM is implemented, the bank number is selected by the high 3 bits of the FSR. This affects register numbers 16–31; registers 0–15 are global and not affected by the bank select bits.

Because of the very limited register space (5 bits), 4 rarely read registers were not assigned addresses, but written by special instructions (OPTION and TRIS).

The ROM address space is 512 and may only specify addresses in the first half of each 512-word page. That is, the CALL instruction specifies the low 9 bits of the address, but only the low 8 bits of that address are a parameter of the instruction, while the 9th bit (bit 8) is implicitly specified as 0 by the CALL instruction itself.

Lookup tables are implemented using a computed GOTO (assignment to PCL register) into a table of RETLW instructions. RETLW performs a subroutine return and simultaneously loads the W register with an 8-bit immediate constant that is part of the instruction.

This "baseline core" does not support interrupts; all I/O must be polled. There are some "enhanced baseline" variants with interrupt support and a four-level call stack.

PIC10F32x devices feature a mid-range 14-bit wide code memory of 256 or 512 words, a 64-byte SRAM register file, and an 8-level deep hardware stack. These devices are available in 6-pin SMD and 8-pin DIP packages (with two pins unused). One input only and three I/O pins are available. A complex set of interrupts are available. Clocks are an internal calibrated high-frequency oscillator of 16 MHz with a choice of selectable speeds via software and a 31 kHz low-power source.

PIC16

[edit]
Microchip PIC16C58A
PIC16LF870 in SOIC Socket

These devices feature a 14-bit wide code memory, and an improved 8-level deep call stack. The instruction set differs very little from the baseline devices, but the two additional opcode bits allow 128 registers and 2048 words of code to be directly addressed. There are a few additional miscellaneous instructions, and two additional 8-bit literal instructions, add and subtract. The mid-range core is available in the majority of devices labeled PIC12 and PIC16.

The first 32 bytes of the register space are allocated to special-purpose registers; the remaining 96 bytes are used for general-purpose RAM. If banked RAM is used, the high 16 registers (0x70–0x7F) are global, as are a few of the most important special-purpose registers, including the STATUS register, which holds the RAM bank select bits. (The other global registers are FSR and INDF, the low 8 bits of the program counter PCL, the PC high preload register PCLATH, and the master interrupt control register INTCON.)

The PCLATH register supplies high-order instruction address bits when the 8 bits supplied by a write to the PCL register, or the 11 bits supplied by a GOTO or CALL instruction, are not sufficient to address the available ROM space.

PIC17

[edit]

The PIC17 series never became popular and has been superseded by the PIC18 architecture (however, see clones below). The PIC17 series is not recommended for new designs, and availability may be limited to users.

Improvements over earlier cores are 16-bit wide opcodes (allowing many new instructions), and a 16-level deep call stack. PIC17 devices were produced in packages from 40 to 68 pins.

The PIC17 series introduced a number of important new features:[12]

  • a memory mapped accumulator
  • read access to code memory (table reads)
  • direct register-to-register moves (prior cores needed to move registers through the accumulator)
  • an external program memory interface to expand the code space
  • an 8-bit × 8-bit hardware multiplier
  • a second indirect register pair
  • auto-increment/auto-decrement addressing controlled by control bits in a status register (ALUSTA)

A significant limitation was that RAM space was limited to 256 bytes (26 bytes of special function registers, and 232 bytes of general-purpose RAM), with awkward bank-switching in the models that supported more.

PIC18

[edit]
PIC18F45K20

In 2000, Microchip introduced the PIC18 architecture. Unlike the PIC17 series, it has proven to be very popular, with a large number of device variants presently in manufacture. In contrast to earlier devices, which were more often than not programmed in assembly language, C has become the predominant development language.[13]

The PIC18 series inherits most of the features and instructions of the PIC17 series, while adding a number of important new features:

  • call stack is 21 bits wide and much deeper (31 levels deep)
  • the call stack may be read and written (TOSU:TOSH:TOSL registers)
  • conditional branch instructions
  • indexed addressing mode (PLUSW)
  • the FSR registers are extended to 12 bits, allowing them to linearly address the entire data address space
  • the addition of another FSR register (bringing the number up to 3)

The RAM space is 12 bits, addressed using a 4-bit bank select register (BSR) and an 8-bit offset in each instruction. An additional "access" bit in each instruction selects between bank 0 (a=0) and the bank selected by the BSR (a=1).

A 1-level stack is also available for the STATUS, WREG and BSR registers. They are saved on every interrupt, and may be restored on return. If interrupts are disabled, they may also be used on subroutine call/return by setting the s bit (appending ", FAST" to the instruction).

The auto increment/decrement feature was improved by removing the control bits and adding four new indirect registers per FSR. Depending on which indirect file register is being accessed, it is possible to postdecrement, postincrement, or preincrement FSR; or form the effective address by adding W to FSR.

In more advanced PIC18 devices, an "extended mode" is available which makes the addressing even more favorable to compiled code:

  • a new offset addressing mode; some addresses which were relative to the access bank are now interpreted relative to the FSR2 register
  • the addition of several new instructions, notably for manipulating the FSR registers.

PIC18 devices are still developed (2021) and fitted with CIP (Core Independent Peripherals)

PIC24 and dsPIC

[edit]

In 2001, Microchip introduced the dsPIC series of chips,[14] which entered mass production in late 2004. They are Microchip's first inherently 16-bit microcontrollers. PIC24 devices are designed as general purpose microcontrollers. dsPIC devices include digital signal processing capabilities in addition.

Although still similar to earlier PIC architectures, there are significant enhancements:[15]

  • All registers are 16 bits wide
  • Program counter is 22 bits (bits 22:1; bit 0 is always 0)
  • Instructions are 24 bits wide
  • Data address space expanded to 64 KiB
  • First 2 KiB is reserved for peripheral control registers
  • Data bank switching is not required unless RAM exceeds 62 KiB
  • "f operand" direct addressing extended to 13 bits (8 KiB)
  • 16 W registers available for register-register operations.
    (But operations on f operands always reference W0.)
  • Instructions come in byte and (16-bit) word forms
  • Stack is in RAM (with W15 as stack pointer); there is no hardware stack
  • W14 is the frame pointer
  • Data stored in ROM may be accessed directly ("Program Space Visibility")
  • Vectored interrupts for different interrupt sources

Some features are:

dsPICs can be programmed in C using Microchip's XC16 compiler (formerly called C30), which is a variant of GCC.

Instruction ROM is 24 bits wide. Software can access ROM in 16-bit words, where even words hold the least significant 16 bits of each instruction, and odd words hold the most significant 8 bits. The high half of odd words reads as zero. The program counter is 23 bits wide, but the least significant bit is always 0, so there are 22 modifiable bits.

Instructions come in two main varieties, with most important operations (add, xor, shifts, etc.) allowing both forms:

  • The first is like the classic PIC instructions, with an operation between a specified f register (i.e. the first 8K of RAM) and a single accumulator W0, with a destination select bit selecting which is updated with the result. (The W registers are memory-mapped. so the f operand may be any W register.)
  • The second form is more conventional, allowing three operands, which may be any of 16 W registers. The destination and one of the sources also support addressing modes, allowing the operand to be in memory pointed to by a W register.

PIC32M MIPS-based line

[edit]

Microchip's PIC32M products use the PIC trademark, but have a completely different architecture, and are described here only briefly.

PIC32MX

[edit]
PIC32MX430F064H

In November 2007, Microchip introduced the PIC32MX family of 32-bit microcontrollers, based on the MIPS32 M4K Core.[16] The device can be programmed using the Microchip MPLAB C Compiler for PIC32 MCUs, a variant of the GCC compiler. The first 18 models currently in production (PIC32MX3xx and PIC32MX4xx) are pin to pin compatible and share the same peripherals set with the PIC24FxxGA0xx family of (16-bit) devices, allowing the use of common libraries, software and hardware tools. Today, starting at 28 pin in small QFN packages up to high performance devices with Ethernet, CAN and USB OTG, full family range of mid-range 32-bit microcontrollers are available.

The PIC32 architecture brought a number of new features to Microchip portfolio, including:

  • The highest execution speed 80 MIPS (120+[17] Dhrystone MIPS @ 80 MHz)
  • The largest flash memory: 512 kB
  • One instruction per clock cycle execution
  • The first cached processor
  • Allows execution from RAM
  • Full Speed Host/Dual Role and OTG USB capabilities
  • Full JTAG and 2-wire programming and debugging
  • Real-time trace

PIC32MZ

[edit]

In November 2013, Microchip introduced the PIC32MZ series of microcontrollers, based on the MIPS M14K core. The PIC32MZ series include:[18][19]

  • 252 MHz core speed, 415 DMIPS
  • Up to 2 MB Flash and 512 KB RAM
  • New peripherals including high-speed USB, crypto engine and SQI

In 2015, Microchip released the PIC32MZ EF family, using the updated MIPS M5150 Warrior M-class processor.[20][21]

In 2017, Microchip introduced the PIC32MZ DA Family, featuring an integrated graphics controller, graphics processor and 32MB of DDR2 DRAM.[22][23]

PIC32MM

[edit]

In June 2016, Microchip introduced the PIC32MM family, specialized for low-power and low-cost applications.[24] The PIC32MM features core-independent peripherals, sleep modes down to 500 nA, and 4 x 4 mm packages.[25] The PIC32MM microcontrollers use the MIPS Technologies M4K, a 32-bit MIPS32 processor. They are meant for very low power consumption and limited to 25 MHz. Their key advantage is to support the 16-bit instructions of MIPS, making program size much more compact (about 40%)

PIC32MK

[edit]

Microchip introduced the PIC32MK family in 2017, specialized for motor control, industrial control, Industrial Internet of Things (IIoT) and multi-channel CAN applications.[26]

PIC32C Arm-based line

[edit]

Microchip's PIC32C products also use the PIC trademark, but similarly have a completely different architecture. PIC32C products employ the Arm processor architecture, including various lines using Cortex-M0+, M4, M7, M23, and M33 cores. They are offered in addition to the Arm-based SAM series of MCUs which Microchip inherited from its acquisition of Atmel.[27]

PIC64

[edit]

Microchip's PIC64 products use the PIC trademark, but have a completely different architecture, and are described here only briefly.

In July 2024, Microchip introduced the PIC64 series of high-performance multi-core microprocessors. The series will initially use the RISC-V instruction set, however Microchip is also planning versions with ARM Cortex-A cores.[28] The PIC64 series will include the PIC64GX line, which focuses on intelligent edge applications, and the PIC64-HPSC line, which is radiation-hardened and focuses on spaceflight applications.[29][30]

Core architecture

[edit]

The PIC architecture (excluding the unrelated PIC32 and PIC64) is a one-operand accumulator machine like the PDP-8 or the Apollo Guidance Computer. Its characteristics are:

  • One accumulator (W0), which is an implied operand of almost every instruction.
  • A small number of fixed-length instructions, with mostly fixed timing (2 clock cycles, or 4 clock cycles in 8-bit models).
  • A small amount of addressable data space (32, 128, or 256 bytes, depending on the family), extended through banking
  • Separate code and data spaces (Harvard architecture).
  • Instruction memory is wider than data memory, allowing immediate constants within an instruction. (This is a major difference from the other early accumulator machines mentioned above.)
  • The second operand is a memory location or an immediate constant.
  • There are no other addressing modes, although an indirect address mode can be emulated using the indirect register(s).
  • Data-space mapped CPU, port, and peripheral registers
    • ALU status flags are mapped into the data space
    • The program counter is also mapped into the data space and writeable (this is used to implement indirect jumps).
  • A hardware stack for storing return addresses
  • There are only unconditional branch instructions
  • Conditional execution is achieved via conditional skip instructions, which conditionally nullify the following instruction.

There is no distinction between memory space and register space because the RAM serves the job of both memory and registers, and the RAM is usually just referred to as "the register file" or simply as "the registers".

Data space (RAM)

[edit]

PICs have a set of registers that function as general-purpose RAM. Special-purpose control registers for on-chip hardware resources are also mapped into the data space. The addressability of memory varies depending on device series, and all PIC device types have some banking mechanism to extend addressing to additional memory (but some device models have only one bank implemented). Later series of devices feature move instructions, which can cover the whole addressable space, independent of the selected bank. In earlier devices, any register move must be achieved through the accumulator.

To implement indirect addressing, a "file select register" (FSR) and "indirect register" (INDF) are used. A register number is written to the FSR, after which reads from or writes to INDF will actually be from or to the register pointed to by FSR. Later devices extended this concept with post- and pre- increment/decrement for greater efficiency in accessing sequentially stored data. This also allows FSR to be treated almost like a stack pointer (SP).

External data memory is not directly addressable except in some PIC18 devices with high pin count. However, general I/O ports can be used to implement a parallel bus or a serial interface for accessing external memory and other peripherals (using subroutines), with the caveat that such programmed memory access is (of course) much slower than access to the native memory of the PIC MCU.

Code space

[edit]

The code space is generally implemented as on-chip ROM, EPROM or flash ROM. In general, there is no provision for storing code in external memory due to the lack of an external memory interface. The exceptions are PIC17 and select high pin count PIC18 devices.[31]

Word size

[edit]

All PICs handle (and address) data in 8-bit chunks. However, the unit of addressability of the code space is not generally the same as the data space. For example, PICs in the baseline (PIC12) and mid-range (PIC16) families have program memory addressable in the same wordsize as the instruction width, i.e. 12 or 14 bits respectively. In contrast, in the PIC18 series, the program memory is addressed in 8-bit increments (bytes), which differs from the instruction width of 16 bits.

In order to be clear, the program memory capacity is usually stated in number of (single-word) instructions, rather than in bytes.

Stacks

[edit]

PICs have a hardware call stack, which is used to save return addresses. The hardware stack is not software-accessible on earlier devices, but this changed with the PIC18 series devices.

Hardware support for a general-purpose parameter stack was lacking in early series, but this greatly improved in the PIC18 series, making the PIC18 series architecture more friendly to high-level language compilers.

Instruction set

[edit]

PIC instruction sets vary from about 35 instructions for the low-end PICs to over 80 instructions for the high-end PICs. The instruction set includes instructions to perform a variety of operations on registers directly, on the accumulator and a literal constant, or on the accumulator and a register, as well as for conditional execution, and program branching.

A few operations, such as bit setting and testing, can be performed on any numbered register, but 2-input arithmetic operations always involve W (the accumulator), writing the result back to either W or the other operand register. To load a constant, it is necessary to load it into W before it can be moved into another register. On the older cores, all register moves needed to pass through W, but this changed on the "high-end" cores.

PIC cores have skip instructions, which are used for conditional execution and branching. The skip instructions are "skip if bit set" and "skip if bit not set". Because cores before PIC18 had only unconditional branch instructions, conditional jumps are implemented by a conditional skip (with the opposite condition) followed by an unconditional branch. Skips are also of utility for conditional execution of any immediate single following instruction. It is possible to skip skip instructions. For example, the instruction sequence "skip if A; skip if B; C" will execute C if A is true or if B is false.

The PIC18 series implemented shadow registers: these are registers which save several important registers during an interrupt, providing hardware support for automatically saving processor state when servicing interrupts.

In general, PIC instructions fall into five classes:

  • Operation on working register (WREG) with 8-bit immediate ("literal") operand. E.g. movlw (move literal to WREG), andlw (AND literal with WREG). One instruction peculiar to the PIC is retlw, load immediate into WREG and return, which is used with computed branches to produce lookup tables.
  • Operation with WREG and indexed register. The result can be written to either the working register (e.g. addwf reg,w). or the selected register (e.g. addwf reg,f).
  • Bit operations. These take a register number and a bit number, and perform one of 4 actions: set or clear a bit, and test and skip on set/clear. The latter are used to perform conditional branches. The usual ALU status flags are available in a numbered register so operations such as "branch on carry clear" are possible.
  • Control transfers. Other than the skip instructions previously mentioned, there are only two: goto and call.
  • A few miscellaneous zero-operand instructions, such as return from subroutine, and sleep to enter low-power mode.

Performance

[edit]

The architectural decisions are directed at the maximization of speed-to-cost ratio. The PIC architecture was among the first scalar CPU designs[citation needed] and is still among the simplest and cheapest. The Harvard architecture, in which instructions and data come from separate sources, simplifies timing and microcircuit design greatly, and this benefits clock speed, price, and power consumption.

The PIC instruction set is suited to implementation of fast lookup tables in the program space. Such lookups take one instruction and two instruction cycles. Many functions can be modeled in this way. Optimization is facilitated by the relatively large program space of the PIC (e.g. 4096 × 14-bit words on the 16F690) and by the design of the instruction set, which allows embedded constants. For example, a branch instruction's target may be indexed by W, and execute a "RETLW", which does as it is named – return with literal in W.

Interrupt latency is constant at three instruction cycles. External interrupts have to be synchronized with the four-clock instruction cycle, otherwise there can be a one instruction cycle jitter. Internal interrupts are already synchronized. The constant interrupt latency allows PICs to achieve interrupt-driven low-jitter timing sequences. An example of this is a video sync pulse generator. This is no longer true in the newest PIC models, because they have a synchronous interrupt latency of three or four cycles.

Advantages

[edit]
  • Small instruction set to learn
  • RISC architecture
  • Built-in oscillator with selectable speeds
  • Easy entry level, in-circuit programming plus in-circuit debugging PICkit units available for less than $50
  • Inexpensive microcontrollers
  • Wide range of interfaces including I²C, SPI, USB, UART, A/D, programmable comparators, PWM, LIN, CAN, PSP, and Ethernet[32]
  • Availability of processors in DIL package makes them easy to handle for hobby use.

Limitations

[edit]
  • One accumulator
  • Register-bank switching is required to access the entire RAM of many devices
  • Operations and registers are not orthogonal; some instructions can address RAM and/or immediate constants, while others can use the accumulator only.

The following stack limitations have been addressed in the PIC18 series, but still apply to earlier cores:

With paged program memory, there are two page sizes to worry about: one for CALL and GOTO and another for computed GOTO (typically used for table lookups). For example, on PIC16, CALL and GOTO have 11 bits of addressing, so the page size is 2048 instruction words. For computed GOTOs, where you add to PCL, the page size is 256 instruction words. In both cases, the upper address bits are provided by the PCLATH register. This register must be changed every time control transfers between pages. PCLATH must also be preserved by any interrupt handler.[33]

Compiler development

[edit]

While several commercial compilers are available, in 2008, Microchip released their own C compilers, C18 and C30, for the line of 18F 24F and 30/33F processors.

As of 2013, Microchip offers their XC series of compilers, for use with MPLAB X. Microchip will eventually phase out its older compilers, such as C18, and recommends using their XC series compilers for new designs.[34]

The RISC instruction set of the PIC assembly language code can make the overall flow difficult to comprehend. Judicious use of simple macros can increase the readability of PIC assembly language. For example, the original Parallax PIC assembler ("SPASM") has macros, which hide W and make the PIC look like a two-address machine. It has macro instructions like mov b, a (move the data from address a to address b) and add b, a (add data from address a to data in address b). It also hides the skip instructions by providing three-operand branch macro instructions, such as cjne a, b, dest (compare a with b and jump to dest if they are not equal).

Hardware features

[edit]

PIC devices generally feature:

  • Flash memory (program memory, programmed using MPLAB devices)
  • SRAM (data memory)
  • EEPROM (programmable at run-time)
  • Sleep mode (power savings)
  • Watchdog timer
  • Various crystal or RC oscillator configurations, or an external clock

Variants

[edit]

Within a series, there are still many device variants depending on what hardware resources the chip features:

  • General purpose I/O pins
  • Internal clock oscillators
  • 8/16/32 bit timers
  • Synchronous/Asynchronous Serial Interface USART
  • MSSP Peripheral for I²C and SPI communications
  • Capture/Compare and PWM modules
  • Analog-to-digital converters (up to ~1.0 Msps)
  • USB, Ethernet, CAN interfacing support
  • External memory interface
  • Integrated analog RF front ends (PIC16F639, and rfPIC).
  • KEELOQ Rolling code encryption peripheral (encode/decode)
  • And many more
[edit]

The first generation of PICs with EPROM storage have been almost completely replaced by chips with flash memory. Likewise, the original 12-bit instruction set of the PIC1650 and its direct descendants has been superseded by 14-bit and 16-bit instruction sets. Microchip still sells OTP (one-time-programmable) and windowed (UV-erasable) versions of some of its EPROM based PICs for legacy support or volume orders. The Microchip website lists PICs that are not electrically erasable as OTP. UV erasable windowed versions of these chips can be ordered.

Part number

[edit]

The F in a PICMicro part number generally indicates the PICmicro uses flash memory and can be erased electronically. Conversely, a C generally means it can only be erased by exposing the die to ultraviolet light (which is only possible if a windowed package style is used). An exception to this rule is the PIC16C84, which uses EEPROM and is therefore electrically erasable.

An L in the name indicates the part will run at a lower voltage, often with frequency limits imposed.[35] Parts designed specifically for low voltage operation, within a strict range of 3 – 3.6 volts, are marked with a J in the part number. These parts are also uniquely I/O tolerant as they will accept up to 5 V as inputs.[35]

Development tools

[edit]

Microchip provides a freeware IDE package called MPLAB X, which includes an assembler, linker, software simulator, and debugger. They also sell C compilers for the PIC10, PIC12, PIC16, PIC18, PIC24, PIC32 and dsPIC, which integrate cleanly with MPLAB X. Free versions of the C compilers are also available with all features. But for the free versions, optimizations will be disabled after 60 days.[36]

Several third parties develop C language compilers for PICs, many of which integrate to MPLAB and/or feature their own IDE. A fully featured compiler for the PICBASIC language to program PIC microcontrollers is available from meLabs, Inc. Mikroelektronika offers PIC compilers in C, BASIC and Pascal programming languages.

A graphical programming language, Flowcode, exists capable of programming 8- and 16-bit PIC devices and generating PIC-compatible C code. It exists in numerous versions from a free demonstration to a more complete professional edition.

The Proteus Design Suite is able to simulate many of the popular 8 and 16-bit PIC devices along with other circuitry that is connected to the PIC on the schematic. The program to be simulated can be developed within Proteus itself, MPLAB or any other development tool.[37]

The standalone FORTH system FlashForth incorporating an interpreter, compiler, assembler and multitasker, provides a comprehensive solution for writing and debugging complex real-time applications. The system, in its entirety, including the compiler, is executing on the microcontroller. A computer with a terminal emulator is used for communicating with FF via a serial or USB link.[38]

Device programmers

[edit]
This is a 2003 era programmer for the Microchip "PIC" family of microcontrollers. It connects by RS 232 cable to a PC compatible running development software. In 2003 this unit cost $300 Canadian (about $200 US at the time).

Devices called "programmers" are traditionally used to get program code into the target PIC. Most PICs that Microchip currently sells feature ICSP (in-circuit serial programming) and/or LVP (low-voltage programming) capabilities, allowing the PIC to be programmed while it is sitting in the target circuit.

Microchip offers programmers/debuggers under the MPLAB and PICKit series. MPLAB ICD5 and MPLAB REAL ICE are the current programmers and debuggers for professional engineering, while PICKit 5 is a low-cost programmer / debugger line for hobbyists and students.

Bootloading

[edit]

Many of the higher end flash based PICs can also self-program (write to their own program memory), a process known as bootloading. Demo boards are available with a small factory-programmed bootloader that can be used to load user programs over an interface such as RS-232 or USB, thus obviating the need for a programmer device.

Alternatively there is bootloader firmware available that the user can load onto the PIC using ICSP. After programming the bootloader onto the PIC, the user can then reprogram the device using RS232 or USB, in conjunction with specialized computer software.

The advantages of a bootloader over ICSP is faster programming speeds, immediate program execution following programming, and the ability to both debug and program using the same cable.

Third party

[edit]

There are many programmers for PIC microcontrollers, ranging from the extremely simple designs which rely on ICSP to allow direct download of code from a host computer, to intelligent programmers that can verify the device at several supply voltages. Many of these complex programmers use a pre-programmed PIC themselves to send the programming commands to the PIC that is to be programmed. The intelligent type of programmer is needed to program earlier PIC models (mostly EPROM type) which do not support in-circuit programming.

Third party programmers range from plans to build your own, to self-assembly kits and fully tested ready-to-go units. Some are simple designs which require a PC to do the low-level programming signalling (these typically connect to the serial or parallel port and consist of a few simple components), while others have the programming logic built into them (these typically use a serial or USB connection, are usually faster, and are often built using PICs themselves for control).

Debugging

[edit]

In-circuit debugging

[edit]

All newer PIC devices feature an ICD (in-circuit debugging) interface, built into the CPU core, that allows for interactive debugging of the program in conjunction with MPLAB IDE. MPLAB ICD and MPLAB REAL ICE debuggers can communicate with this interface using the ICSP interface.

This debugging system comes at a price however, namely limited breakpoint count (1 on older devices, 3 on newer devices), loss of some I/O (with the exception of some surface mount 44-pin PICs which have dedicated lines for debugging) and loss of some on-chip features.

Some devices do not have on-chip debug support, due to cost or lack of pins. Some larger chips also have no debug module. To debug these devices, a special -ICD version of the chip mounted on a daughter board which provides dedicated ports is required. Some of these debug chips are able to operate as more than one type of chip by the use of selectable jumpers on the daughter board. This allows broadly identical architectures that do not feature all the on-chip peripheral devices to be replaced by a single -ICD chip. For example: the 16F690-ICD will function as one of six different parts, each of which features none, some or all of five on-chip peripherals.[39]

In-circuit emulators

[edit]

Microchip offers three full in-circuit emulators: the MPLAB ICE2000 (parallel interface, a USB converter is available); the newer MPLAB ICE4000 (USB 2.0 connection); and most recently, the REAL ICE (USB 2.0 connection). All such tools are typically used in conjunction with MPLAB IDE for source-level interactive debugging of code running on the target.

Operating systems

[edit]

PIC projects may utilize real-time operating systems such as FreeRTOS, AVIX RTOS, uRTOS, Salvo RTOS or other similar libraries for task scheduling and prioritization.

An open source project by Serge Vakulenko adapts 2.11BSD to the PIC32 architecture, under the name RetroBSD. This brings a familiar Unix-like operating system, including an onboard development environment, to the microcontroller, within the constraints of the onboard hardware.[40]

Clones

[edit]

Parallax

[edit]

Parallax produced a series of PICmicro-like microcontrollers known as the Parallax SX. It is currently discontinued. Designed to be architecturally similar to the PIC microcontrollers used in the original versions of the BASIC Stamp, SX microcontrollers replaced the PIC in several subsequent versions of that product.

Parallax's SX are 8-bit RISC microcontrollers, using a 12-bit instruction word, which run fast at 75 MHz (75 MIPS). They include up to 4096 12-bit words of flash memory and up to 262 bytes of random access memory, an eight bit counter and other support logic. There are software library modules to emulate I²C and SPI interfaces, UARTs, frequency generators, measurement counters and PWM and sigma-delta A/D converters. Other interfaces are relatively easy to write, and existing modules can be modified to get new features.

PKK Milandr

[edit]
1886VE2U

Russian PKK Milandr produces microcontrollers using the PIC17 architecture as the 1886 series.[41] [42] [43] [44] Program memory consists of up to 64kB Flash memory in the 1886VE2U (Russian: 1886ВЕ2У) or 8kB EEPROM in the 1886VE5U (1886ВЕ5У). The 1886VE5U (1886ВЕ5У) through 1886VE7U (1886ВЕ7У) are specified for the military temperature range of -60 °C to +125 °C. Hardware interfaces in the various parts include USB, CAN, I2C, SPI, as well as A/D and D/A converters. The 1886VE3U (1886ВЕ3У) contains a hardware accelerator for cryptographic functions according to GOST 28147-89. There are even radiation-hardened chips with the designations 1886VE8U (1886ВЕ8У) and 1886VE10U (1886ВЕ10У).[45]

ELAN Microelectronics

[edit]

ELAN Microelectronics Corp. in Taiwan make a line of microcontrollers based on the PIC16 architecture, with 13-bit instructions and a smaller (6-bit) RAM address space.[46]

Holtek Semiconductor

[edit]

Holtek Semiconductor make a large number of very cheap microcontrollers[47] (as low as 8.5 cents in quantity[48]) with a 14-bit instruction set strikingly similar to the PIC16.

Hycon

[edit]

Hycon Technology, a Taiwanese manufacturer of mixed-signal chips for portable electronics (multimeters, kitchen scales, etc.), has a proprietary H08 microcontroller series with a 16-bit instruction word very similar to the PIC18 family. (No relation to the Hitachi/Renesas H8 microcontrollers.) The H08A[49] is most like the PIC18; the H08B[50] is a subset.[51]

Although the available instructions are almost identical, their encoding is different, as is the memory map and peripherals. For example, the PIC18 allows direct access to RAM at 0x000–0x07F or special function registers at 0xF80–0xFFF by sign-extending an 8-bit address. The H08 places special function registers at 0x000–0x07F and global RAM at 0x080–0x0FF, zero-extending the address.

Other manufacturers in Asia

[edit]

Many ultra-low-cost OTP microcontrollers from Asian manufacturers, found in low-cost consumer electronics are based on the PIC architecture or modified form. Most clones only target the baseline parts (PIC16C5x/PIC12C50x). With any patents on the basic architecture long since expired, Microchip has attempted to sue some manufacturers on copyright grounds,[52][53] without success.[54][55][better source needed]

See also

[edit]

References

[edit]

Further reading

[edit]
[edit]
Revisions and contributorsEdit on WikipediaRead on Wikipedia
from Grokipedia
PIC microcontrollers are a family of reduced instruction set computing (RISC) microcontrollers ranging from 8-bit to 64-bit, developed and manufactured by Microchip Technology, designed for embedded control applications requiring low power consumption, cost-effectiveness, and reliability.[1] These devices employ a Harvard architecture, separating program memory from data memory to enable efficient parallel access, and support a compact instruction set of 35 to 75 instructions depending on the core variant.[1] Key features include integrated peripherals such as analog-to-digital converters (up to 12-bit resolution), timers, communication interfaces (e.g., UART, SPI, I2C), and low-power modes achieving sleep currents below 50 nA, making them suitable for battery-operated devices.[1] With memory options up to 128 KB of Flash program memory, 4 KB of RAM, and 1 KB of EEPROM in 8-bit variants (higher in advanced families), PIC microcontrollers are widely used in consumer electronics, automotive systems, industrial controls, medical equipment, and IoT nodes.[1] The origins of the PIC architecture date back to 1975, when General Instrument developed the first PIC microcontroller as an 8-bit core to manage input/output tasks for larger central processing units like the CP1600 microprocessor.[2] Microchip Technology, founded in 1989 by former General Instrument engineers, acquired and expanded the PIC line, focusing initially on 8-bit implementations for broader accessibility.[3] A pivotal advancement came in 1993 with the introduction of the PIC16C84, the first commercially successful PIC device to incorporate electrically erasable programmable read-only memory (EEPROM), allowing in-circuit reprogramming without ultraviolet erasure, which revolutionized embedded development by reducing costs to under $5 per unit and enabling rapid prototyping.[3] PIC microcontrollers are categorized into several core architectures to meet diverse performance needs: the Baseline core (12-bit instruction word, up to 4 MIPS) for simple, low-cost applications; the Mid-Range core (14-bit instruction word, up to 5 MIPS) for balanced functionality; the Enhanced Mid-Range core, which improves performance while maintaining compatibility; and the PIC18 High-Performance core (16-bit instruction word, up to 16 MIPS) for more demanding tasks, with higher-bit families like PIC24, PIC32, and PIC64 offering advanced capabilities.[1] Billions of units have shipped since 1990, establishing PIC as the leading 8-bit microcontroller platform, supported by an extensive ecosystem including the MPLAB IDE, compilers, and in-circuit serial programming (ICSP) for seamless development.[1] Applications span from remote controls and smart cards to advanced systems like unmanned aerial vehicles and medical diagnostics, underscoring their enduring impact on embedded systems design.[3]

History

Origins in the CP1600 era

In the mid-1970s, General Instrument introduced the CP1600, the first commercially available single-chip 16-bit microprocessor, developed in collaboration with Honeywell and released in 1975. The CP1600 found early applications in programmable TV game systems, where it served as the central processor for handling game logic, but its limited input/output (I/O) capabilities necessitated additional dedicated chips for interfacing with displays, controls, and other peripherals. This limitation became particularly evident in the burgeoning consumer electronics market, especially video games, where custom mask-programmed logic chips were commonly used for fixed-function tasks but lacked flexibility for design iterations or field updates.[4] To address these challenges, a team at General Instrument's Microelectronics Division proposed in 1976 the development of a ROM-based controller chip that could replace rigid mask-programmed logic with programmable functionality, enabling more adaptable designs for TV games and process-control systems. This initiative aimed to create a low-cost, general-purpose peripheral that expanded the CP1600's I/O while minimizing external components. The result was the PIC1650, the first in the PIC (initially standing for Peripheral Interface Controller) family, introduced later that year as an 8-bit microcontroller with a Harvard architecture featuring separate program and data memory spaces. It supported 12-bit instructions, a 512 × 12-bit program ROM, 32 × 8-bit RAM registers, a two-level hardware stack, and 40 instructions, including direct bit manipulation for efficient I/O handling—all optimized for single-cycle execution in most cases. The chip's 40-pin package included 32 programmable I/O lines organized into four 8-bit ports, operating at 5V with a single-pin oscillator circuit for simplified integration.[4][5] Key innovations in the PIC1650 included its general-register architecture, which allowed flexible data handling without the constraints of accumulator-only designs prevalent in contemporaries like the Intel 8048, and its emphasis on embedded control rather than general computing. Early versions used mask ROM for program storage, but subsequent variants incorporated ultraviolet-erasable EPROM (e.g., the PIC1650A), enabling field reprogramming and prototyping—a significant advance for consumer product development where design changes were frequent. These features reduced system complexity and cost, as the PIC1650 required minimal external support circuitry compared to discrete logic solutions.[4][6] The PIC1650's initial applications centered on consumer electronics, particularly video games, where it interfaced with the CP1600 (or its variant, the CP1610) to manage graphics, sound, and user inputs. Notable early adoption included the Mattel Intellivision console released in 1979, which used the PIC1650 alongside the CP1610 for game processing, demonstrating its role in enabling programmable, multi-game systems. Other uses extended to industrial controls like motor drives in drill presses and household appliances such as microwave ovens and washing machines, highlighting its versatility in replacing electromechanical relays with digital logic. This foundational design laid the groundwork for the PIC family's evolution into standalone microcontrollers.[4][5]

Evolution and commercialization

In 1989, Microchip Technology was established when a group of venture capitalists acquired the semiconductor division of General Instrument, which included the rights to the PIC microcontroller technology originally developed as an internal project.[4] This acquisition marked the transition of PIC from a niche embedded component within General Instrument's offerings to a dedicated commercial product line under independent ownership.[4] Microchip's first major commercial release came in 1990 with the PIC16C5x series, comprising EPROM-based 8-bit microcontrollers designed for low-cost, high-performance applications.[7] These devices, featured prominently in Microchip's 1990 data book, represented the initial widespread commercialization of PIC technology outside its origins at General Instrument, targeting embedded control in consumer electronics and industrial systems.[7] During the 1990s, Microchip advanced PIC programmability by shifting to flash memory, culminating in the introduction of the PIC16F84 in late 1995 or early 1996, which allowed for easier in-circuit reprogramming compared to earlier EPROM and OTP variants.[8] This innovation significantly boosted adoption in prototyping and production, as the PIC16F84's 1 KB flash program memory and integrated EEPROM enabled rapid development cycles without specialized erasure equipment.[8] Key milestones in this era included the 1996 launch of the PIC12C508, Microchip's smallest PIC to date with just 8 pins and 0.75 KB program memory, expanding the line into ultra-compact applications like remote controls and sensors.[9] Microchip went public in 1993 via an initial public offering, providing capital for expansion and fueling the growth of the PIC portfolio.[10] By the early 2000s, the company had developed ongoing expansions into 16-bit and 32-bit architectures, such as the PIC24 and PIC32 families, to address more complex embedded systems. In 2016, Microchip acquired Atmel for $3.56 billion, incorporating the competing AVR microcontroller line and strengthening its position in the 8-bit market while highlighting PIC's enduring competitiveness.[11] As of 2025, Microchip's PIC lineup has grown to encompass a wide range of variants across 8-, 16-, and 32-bit families, supporting diverse applications from IoT devices to automotive controls.[12] Recent developments include the 2024 announcement of the PIC64 family, integrating RISC-V cores for high-performance space applications, such as NASA's High-Performance Spaceflight Computing platform, enabling radiation-tolerant processing up to 100 times more capable than prior generations.[13] In October 2025, Microchip introduced the PIC32-BZ6 MCU platform, a highly integrated single-chip wireless solution designed for advanced connectivity, touch, and motor control in smart home, automotive, and industrial applications.[14] This evolution underscores PIC's adaptation to emerging demands in autonomous systems and edge computing.[15]

Device families

PIC10 and PIC12 families

The PIC10 and PIC12 families represent Microchip Technology's entry-level 8-bit microcontroller offerings, optimized for ultra-compact designs with minimal pin counts and resource requirements, making them ideal for basic digital control in cost-sensitive embedded applications. These families employ a reduced instruction set computing (RISC) architecture with Harvard memory separation, enabling efficient execution for simple tasks such as logic sequencing and sensor interfacing. Introduced as part of Microchip's expansion into low-pin-count devices, the PIC12 series debuted in 1996 with the PIC12C508, an 8-pin one-time programmable (OTP) microcontroller featuring a 33-instruction set and 512 words of program memory.[9] Subsequent flash-based variants extended capabilities while maintaining the core's simplicity.[16] At their core, PIC10 and PIC12 devices utilize an 8-bit data path with 12-bit wide instructions (extending to 14-bit in select enhanced models), supporting up to 2 KB of program memory and 128 bytes of RAM across the family.[17][16] The architecture includes a 2-level deep stack for subroutine calls and direct/relative addressing modes, with all instructions executing in a single cycle except branches, achieving up to 4 MHz operation. Key peripherals are limited to essentials like an 8-bit Timer0 with prescaler and basic I/O ports, emphasizing low overhead for power-constrained environments. Program memory options span OTP for high-volume production, flash for reprogrammability, and EEPROM for data retention, allowing flexibility in development and deployment.[18][16] Distinguishing features include an integrated precision internal oscillator (typically 4 MHz with ±1% calibration) that eliminates external components, reducing system cost and size.[17] Low-power modes are a hallmark, with sleep current consumption below 1 µA (as low as 100 nA at 2 V), enabling extended battery life in intermittent-operation scenarios.[17] Additional safeguards such as power-on reset (POR), watchdog timer (WDT), and brown-out reset (BOR) ensure reliable operation across voltage ranges of 2.0–5.5 V and temperatures from -40°C to +125°C in extended variants.[16] In-circuit serial programming (ICSP) facilitates rapid prototyping and field updates.[18] These families find widespread use in battery-powered sensors, consumer toys, and basic household appliances where simplicity and efficiency outweigh the need for advanced peripherals.[19] The PIC10F subfamily targets ultra-low-cost applications with 6-pin SOT-23 packaging and as few as 256 words of flash memory, exemplified by devices like the PIC10F200/204 for disposable electronics.[17] In contrast, the PIC12F series offers 8-pin configurations with additional I/O (up to 6 bidirectional pins) and expanded features, such as the PIC12F675 with an analog comparator for sensor signal processing.[20] Recent enhancements, including improved BOR thresholds in models like the PIC10F322, maintain relevance for modern low-power designs through 2025.[21]

PIC16 family

The PIC16 family represents Microchip Technology's mid-range 8-bit microcontroller series, initially launched in the early 1990s with the EPROM-based PIC16C5x devices, which provided a compact, low-cost solution for embedded control applications. These early models featured a simplified RISC architecture suitable for basic I/O and timing tasks, with production availability announced by December 1992. The family evolved significantly in the late 1990s through the introduction of Flash-programmable variants, such as the PIC16F84 in 1997, which added electrically erasable memory for easier in-circuit reprogramming and broader adoption in prototyping and production. This transition from PIC16Cxx (EPROM/ROM) to PIC16Fxx (Flash/EEPROM) marked a key advancement, enabling field updates and reducing development costs while maintaining compatibility with the core mid-range instruction set.[22][23][24] At its core, the PIC16 family employs an 8-bit Harvard architecture with 14-bit wide instructions, supporting 35 single-word instructions that execute in a single cycle (except branches, which require two cycles) for efficient performance up to 20 MHz. Memory configurations vary across devices but scale up to 56 KB of Flash program memory, 4 KB of RAM (organized in banks for general-purpose registers and special function registers), and 256 bytes of data EEPROM for non-volatile storage, with endurance ratings of 100–1,000 erase/write cycles for Flash and up to 10 million for EEPROM.[25] This balance of resources suits cost-sensitive designs without overwhelming complexity, distinguishing the series from higher-end families.[24] Peripherals in the PIC16 family emphasize versatility for analog and digital interfacing, including up to five timers (such as 8-bit Timer0, 16-bit Timer1, and 8-bit Timer2) for precise timing and event generation, an 8-channel 10-bit analog-to-digital converter (ADC) with conversion times as low as 1.6 µs, and communication interfaces like UART for asynchronous serial data, SSP for SPI and I²C protocols, and PWM modules via CCP (Capture/Compare/PWM) units for signal modulation. These features enable seamless integration in systems requiring sensor data acquisition and bus communication without external components. Power management is a hallmark, with core-independent peripherals that operate autonomously during sleep modes, achieving ultra-low consumption below 100 nA in devices like the PIC16F1xxx series, supported by features such as Power-on Reset, Brown-out Reset, and a Watchdog Timer for reliable low-power operation across 1.8–5.5 V supplies.[24][26] Common applications for the PIC16 family include motor control systems leveraging PWM for speed regulation, IoT sensor nodes utilizing low-power modes and ADCs for data collection, and medical devices for precise timing and analog monitoring, where the series' reliability and peripheral integration reduce system size and cost. As of 2025, updates like the PIC16F175x series enhance industrial sensor applications with improved analog performance, including multiple op-amps and comparators for signal conditioning in automation environments.[27]

PIC17 family

The PIC17 family, introduced in the mid-1990s as the PIC17C4x series, was developed by Microchip Technology to meet the demands of embedded applications requiring greater program memory capacity and execution speed than the contemporaneous PIC16 family.[28] This series extended the PICmicro RISC architecture with a 16-bit instruction word size while retaining an 8-bit core, enabling single-cycle execution for most operations at clock speeds up to 33 MHz (121 ns instruction cycle).[29] Designed primarily for high-memory needs, it supported up to 64K × 16 words of program memory (internal or external EPROM/ROM/OTP) and 232 to 902 bytes of RAM, depending on the device variant such as the PIC17C42 or PIC17C44.[29] A key enhancement in the PIC17 family was its 16-level deep hardware stack, which provided deeper call nesting and interrupt handling compared to the eight-level stack in the PIC16 family, facilitating more complex software structures without overflow risks.[29] The instruction set comprised 58 commands, including specialized table read (TBLRD) and table write (TBLWT) operations that leveraged dedicated table pointer registers (TBLPTR, TBLPTRU) for direct access to program memory as data tables.[29] This architecture eliminated the banking constraints common in lower-memory PIC variants by supporting a linear 16-bit program counter and up to 20-bit addressing in extended modes, streamlining data lookup and manipulation in memory-intensive tasks.[28] Additional hardware features included an optional 8×8 multiplier, up to four timers, and peripherals like USART and SSP for serial communication.[29] The PIC17 family was particularly suited for applications in process control, data acquisition, motor control, instrumentation, and telecommunications, where its expanded memory and vectored interrupt system enabled reliable real-time operation and interfacing with analog peripherals such as 16-channel 10-bit ADCs.[29] Despite these advantages, the family was largely superseded by the more versatile PIC18 series in the early 2000s, with production discontinued by the 2010s as Microchip shifted focus to flash-based devices with enhanced peripherals.[30] Legacy systems continue to employ PIC17 devices, and Microchip provides migration guidelines to PIC18 for updates, emphasizing compatibility in core architecture and assembly code portability.

PIC18 family

The PIC18 family represents Microchip Technology's enhanced high-end 8-bit microcontroller series, introduced in 2000 with the PIC18F subfamily to address more demanding embedded applications requiring greater performance and flexibility compared to earlier PIC16 devices.[31] These microcontrollers feature a 16-bit instruction width supporting 77 instructions, enabling efficient code execution while maintaining compatibility with PIC16 source code.[31] Memory capacities have evolved, with modern variants offering up to 128 KB of Flash program memory for storing firmware and up to 8 KB of RAM for data handling, allowing for complex algorithms in resource-constrained environments.[32] Key core enhancements in the PIC18 family include linear program memory addressing up to 2 MB and data memory addressing up to 64 KB in advanced configurations, facilitating straightforward access without banking limitations common in prior families.[31] The architecture incorporates a 31-level deep hardware stack for improved subroutine handling and supports multiple interrupt sources with configurable priority levels, enabling responsive real-time operations.[31] Additionally, self-programmable Flash memory via In-Circuit Serial Programming (ICSP) allows for field updates and bootloader implementations without external programmers.[31] The family integrates a range of peripherals tailored for connectivity and signal processing, including 12-bit Analog-to-Digital Converters (ADCs) for precise sensor measurements and Direct Memory Access (DMA) controllers—up to eight in recent models—for efficient data transfers independent of the CPU.[33] Optional interfaces such as USB for device connectivity, Ethernet for networked applications via dedicated models like the PIC18F97J60, and CAN 2.0B or CAN FD for automotive buses enhance communication capabilities.[34][33] Core-independent peripherals, including timers that operate autonomously to manage timing tasks like PWM generation, reduce CPU overhead and power consumption.[35] In 2023, Microchip expanded the lineup with the PIC18-Q24 subfamily, introducing Multi-Voltage I/O (MVIO) for interfacing with devices at different logic levels (1.8V to 5.5V), Programming and Debugging Interface Disable (PDID) for enhanced code security against unauthorized access, and a fast 12-bit ADCC with integrated computation for accelerated signal processing.[36] These microcontrollers are widely applied in automotive systems for engine control and sensor monitoring, industrial automation for motor drives and PLCs, and secure IoT devices requiring robust protection and connectivity.[36][33] Power efficiency remains a hallmark, with nanoWatt XLP technology in 2025-era models enabling sleep currents as low as 20 nA and active operation down to 100 µA/MHz, supporting battery-powered and energy-harvesting designs.[37]

PIC24 and dsPIC families

The PIC24 family of 16-bit microcontrollers and the dsPIC family of digital signal controllers were introduced by Microchip Technology in 2005 to address applications requiring higher performance than 8-bit PIC devices, with the PIC24F subfamily targeting general-purpose computing and the dsPIC30F/33F subfamilies incorporating DSP extensions for signal processing tasks.[38] These families share a compatible architecture, enabling code portability across devices while offering scalability in memory and peripherals for embedded control systems.[39] At the core, both families feature a 16-bit CPU with 24-bit wide instructions, supporting up to 83 instructions including arithmetic, logic, and control operations for efficient program execution.[39] Memory configurations vary by device, with maximum program flash up to 512 KB and data RAM up to 52 KB in high-end variants like the dsPIC33EP512MU810, allowing for complex firmware in resource-constrained environments. The architecture emphasizes Harvard-style memory separation for simultaneous program and data access, enhancing throughput in real-time applications.[39] The dsPIC family extends the PIC24 core with dedicated DSP capabilities, including two 40-bit saturating accumulators for extended precision arithmetic and a 40-bit bidirectional barrel shifter that performs multi-bit shifts in a single cycle to accelerate operations like normalization.[40] These are complemented by dual-address multiply-accumulate (MAC) instructions, enabling efficient implementation of digital filters, fast Fourier transforms (FFTs), and other signal processing algorithms with minimal cycles.[41] For instance, the 17x17-bit multiplier combined with the accumulators supports high-speed convolution, making dsPIC suitable for time-critical DSP workloads without external coprocessors.[42] Integrated peripherals in the PIC24 and dsPIC families include high-speed PWM modules with up to 16 channels for precise motor control and power switching, quadrature encoder interfaces (QEI) for position sensing in drives, and enhanced CAN (ECAN) modules for robust communication in networked systems.[43] Select devices also feature 10/100 Ethernet MAC for connectivity and low-power modes such as deep sleep with sub-100 nA consumption in variants like the PIC24F KL series, supporting battery-operated designs.[39] These families find widespread use in motor drives for precise speed and torque control, digital power conversion in switch-mode supplies, and audio processing for noise cancellation and equalization.[43][44] In 2025, trends emphasize their role in electric vehicle (EV) controls, particularly with dsPIC33C devices enabling brushless DC (BLDC) motor management for efficient powertrains and thermal systems amid rising automotive electrification demands.[45]

32-bit PIC32 families

The 32-bit PIC32 family, introduced by Microchip Technology, represents a significant advancement in the PIC microcontroller lineup, targeting demanding embedded applications requiring higher processing power than the 8-bit and 16-bit families. The initial MIPS-based PIC32M series debuted in November 2007 with the PIC32MX subfamily, offering up to 120 MHz clock speeds, up to 512 KB of flash memory, and integrated peripherals such as Ethernet (in select models) and USB for connectivity in industrial and consumer devices.[46][47] These devices leverage the MIPS32 M4K core to deliver 1.5 DMIPS/MHz performance, enabling efficient handling of complex tasks like data processing and interface management. Within the MIPS-based lineup, variants cater to diverse needs: the PIC32MX serves as an entry-level option with balanced performance and cost for general embedded control; the PIC32MZ provides high-performance capabilities, including a double-precision floating-point unit (FPU) for computational-intensive applications, operating up to 252 MHz with up to 2 MB flash; while the PIC32MM and PIC32MK emphasize low- and ultra-low-power operation, with clock speeds up to 25 MHz and 120 MHz respectively, and flash sizes ranging from 64 KB to 1 MB, ideal for battery-powered IoT nodes.[48][49][50] Key features across the family include peripheral pin select (PPS) for flexible I/O mapping, support for multiple cores in select high-end models, and compatibility with real-time operating systems (RTOS) like FreeRTOS for multitasking environments.[51] In 2018, Microchip expanded the PIC32 portfolio with ARM-based PIC32C devices, incorporating Cortex-M0+ and Cortex-M4 cores running up to 120 MHz, alongside advanced security features such as Arm TrustZone for protected execution environments in secure IoT applications.[52] These ARM variants maintain PIC compatibility in peripherals while adding low-power modes and enhanced analog integration, bridging the gap between traditional PIC ecosystems and the broader Arm developer community.[53] Recent developments in 2025 include the PIC32MZ2025 series, which introduces enhanced graphics processing units (GPUs) and AI acceleration capabilities, supporting up to 200 MHz operation, 2 MB flash, and integrated 32 MB DDR2 DRAM for sophisticated human-machine interfaces.[54] These updates enable advanced features like 2D graphics acceleration and cryptographic engines, positioning the family for next-generation applications including graphical user interfaces (GUIs), wireless connectivity modules, and industrial gateways.[55]

64-bit PIC64 family

The PIC64 family represents Microchip Technology's entry into 64-bit microprocessing, announced in 2024 to address demanding applications in industrial, aerospace, and edge computing sectors. Built on a 64-bit RISC-V architecture, the family includes multicore configurations ranging from quad to octa-core setups, with clock speeds up to 1 GHz, enabling high-performance computing while maintaining compatibility with Microchip's established ecosystem. The initial members, such as the PIC64-GX series launched in July 2024, feature four U54 64-bit RISC-V cores operating at 625 MHz, integrated with 2 MB of flexible L2 cache and support for DDR4/LPDDR4 memory controllers handling up to 64 MB of external DDR. Subsequent expansions, including the PIC64-HX in October 2024 and PIC64-HPSC in July 2024, scale to eight SiFive Intelligence X280 cores at 1 GHz, incorporating additional monitor cores for enhanced reliability, totaling up to 8+2 cores in some configurations.[56][57][15][58][13][59] Key specifications across the family emphasize integrated AI/ML accelerators delivering up to 2 TOPS (INT8) or 1 TFLOPS (bfloat16) for efficient edge inference, alongside post-quantum cryptography compliant with FIPS 203 and FIPS 204 standards for defense-grade security. The PIC64-HPSC variant introduces radiation tolerance rated at 100 krad total ionizing dose (TID), with radiation-hardened options for deep-space missions, ensuring fault-tolerant operation in harsh environments through features like deterministic real-time execution and anti-tamper mechanisms. Additional capabilities include video processing pipelines for multimedia applications and support for multi-gigabit Ethernet up to 10 Gbps with Time-Sensitive Networking (TSN), facilitating low-latency data handling. The PIC64-GX targets industrial uses with asymmetric multiprocessing (AMP) for real-time tasks, while the HPSC and HX variants prioritize scalability and power efficiency in aerospace and medical systems. Pin compatibility with Microchip's PolarFire SoC FPGAs allows seamless integration for hybrid designs.[13][59][15][58][56][57] Applications for the PIC64 family span satellites and low-Earth orbit (LEO) constellations, autonomous vehicles, and edge AI deployments, where high compute density meets reliability needs. The ecosystem leverages the MPLAB Harmony v3 framework for modular firmware development, supporting Linux, RTOS like Zephyr, and hypervisors such as Xen, alongside evaluation kits like the PIC64GX Curiosity for rapid prototyping. As of 2025, the family is in early production phases, with samples available to select partners and a focus on bolstering security features and Ethernet connectivity for broader adoption in mission-critical systems.[13][59][56][57][15][58][60]

Core architecture

Memory organization

PIC microcontrollers utilize a modified Harvard architecture, which separates program memory and data memory onto distinct buses to enable simultaneous access and improve performance over von Neumann designs. This R&M (Read-Modify-Write) variant allows for efficient instruction fetching and data manipulation without bus contention in most operations.[61] The program memory space primarily consists of non-volatile Flash or ROM, dedicated to storing executable code, constants, and bootloaders. Instruction widths vary across families, with baseline cores using 12-bit instructions, mid-range 14-bit, PIC18 employing 16-bit, PIC24/dsPIC 24-bit, and PIC32 32-bit formats. Addressable program space reaches up to 2 Mbytes in the PIC18 family via a 21-bit program counter, while PIC32 devices support up to 512 Kbytes of physical Flash within a 4 Gbyte virtual address space; the emerging PIC64 family extends this to larger scales with 64-bit addressing for high-performance applications. Boot blocks in Flash reserve space for in-application programming and firmware updates, configurable via device-specific fuses.[62][63][57] Data memory is segregated into volatile RAM for runtime variables and non-volatile EEPROM for persistent storage, with special function registers (SFRs) embedded in the RAM space to control peripherals and core operations. In 8-bit families like PIC16 and PIC18, RAM is organized into banks—typically 8 banks of 256 bytes each—for a total addressable space up to 2 Kbytes, though enhanced PIC18 devices provide up to 4 Kbytes of unified SRAM; access often requires bank switching via the bank select register (BSR), mitigated by a direct access bank in enhanced cores. EEPROM offers up to 1 Kbyte of byte-addressable, non-volatile storage for configuration data, enduring thousands of write cycles.[64][31][65] Enhanced cores in PIC18 and later families support Flash self-write capabilities, enabling runtime modifications to program memory without external programmers, using table read/write instructions for in-circuit updates. Linear addressing modes in PIC18 and enhanced 8-bit devices eliminate traditional banking limitations, providing contiguous access to the full data space up to 4 Kbytes via extended file select registers. In 32-bit and 64-bit PIC families, memory organization shifts toward unified virtual addressing with memory-mapped peripheral libraries, integrating SFR-like registers into a flat 4 Gbyte space for simplified software development and DMA operations.[31][66][63]

Instruction set and word size

The PIC microcontroller families employ a range of instruction set architectures (ISAs) tailored to their bit widths, evolving from compact reduced instruction set computing (RISC) designs in the 8-bit variants to more advanced 32- and 64-bit ISAs based on established cores. The 8-bit families, including PIC10/12, PIC16, and PIC18, use Harvard architectures with fixed-length instructions optimized for low-power embedded applications, featuring orthogonal operations that simplify programming while limiting complexity. These ISAs prioritize arithmetic, logic, bit manipulation, and control flow instructions without native floating-point support, relying instead on software emulation for such operations when needed.[17][67][68] In the baseline 8-bit PIC10 and PIC12 families, instructions are 12 bits wide, comprising 33 single-word, single-cycle operations that execute in a highly orthogonal manner. This compact ISA includes byte-oriented arithmetic and logic unit (ALU) instructions such as ADDWF (add working register to file register) and SUBWF (subtract working register from file register), bit-oriented operations like BCF (bit clear file) and BSF (bit set file) for direct manipulation of register bits, conditional branches (e.g., BTFSC for bit test file, skip if clear), and table read instructions like TBLRD (table read) for accessing program memory data. The limited opcode space supports literals up to 8 bits and file register addresses up to 5 bits, enabling efficient code density for simple control tasks.[17] The mid-range PIC16 family extends this to 14-bit instructions with 35 operations, maintaining RISC principles while adding literal and control instructions for broader functionality. Core ALU operations mirror the baseline (e.g., ADDWF, SUBWF), supplemented by bit manipulations (BCF, BSF), unconditional branches (GOTO), subroutine calls (CALL), and table reads (TBLRD, TBLWT for write). This ISA introduces 8-bit immediate literals in instructions like ADDLW (add literal to working register) and supports up to 11-bit addresses for program memory jumps, facilitating larger code spaces without increasing instruction width significantly. Assembly syntax follows a mnemonic format (e.g., "ADDWF f,d" where f is the file register and d specifies destination), integrated seamlessly with C compilers like XC8, which generate optimized machine code.[67] The enhanced 8-bit PIC18 family uses 16-bit instructions across 77 operations, most single-word but with some multi-word variants like MOVFF (move file to file) requiring two words. It expands ALU capabilities with instructions such as ADDFSR (add file to special register) and SUBFSR, bit operations (BCF, BSF, BTG for bit toggle), conditional branches (BRA for relative branch), and table reads (TBLRD, TBLWT). The ISA introduces an extended set for certain devices, adding eight more instructions like POPF (pop file) for stack efficiency, while retaining no hardware floating-point unit in the base design. This structure supports 12-bit literals and 12-bit addresses, with assembly directives in tools like MPASM assembler and C compilation via XC8 for high-level integration.[68]
FamilyInstruction WidthNumber of InstructionsKey Features
PIC10/1212 bits33Orthogonal RISC, single-cycle execution, 8-bit literals
PIC1614 bits35Added literals/control ops, 11-bit addresses
PIC1816 bits77Multi-word support, extended set option, 12-bit literals
The 16-bit PIC24 and dsPIC families adopt 24-bit instructions with 83 core MCU operations, augmented by DSP extensions (e.g., 22 additional instructions like MAC for multiply-accumulate and MPY for multiply) in dsPIC variants for signal processing. ALU instructions include ADD (add registers), SUB (subtract), bit operations (BCLR, BSET, BTG), branches (BRA, BEQ for branch if equal), and table reads (TBLRD, TBLWT). The ISA uses 16-bit working registers (W0-W15) with optional byte modes, supporting up to 16-bit literals and 23-bit addresses; assembly uses mnemonics like "ADD Wd,Ws" and integrates with XC16 C compiler for efficient code generation.[69] For 32-bit processing, the PIC32 families implement the MIPS32 Release 2 ISA with 32-bit instructions, incorporating PIC-specific extensions for microcontroller peripherals. This load/store architecture features ALU operations (ADD, SUB, ADDU, SUBU for signed/unsigned), bit manipulations (e.g., AND, OR, XOR on registers), conditional branches (BEQ, BNE), and data movement (LW for load word, SW for store word), with no base floating-point but optional coprocessor support. It uses 32 general-purpose registers and supports MIPS16e mode for 16-bit compressed instructions to reduce code size; assembly follows MIPS syntax (e.g., "add $t0, $t1, $t2"), compiled via XC32 for C/C++ development.[70] The 64-bit PIC64 family, introduced in July 2024 for high-performance applications, employs the RISC-V ISA with 64-bit instructions across quad-core configurations. Core operations encompass ALU instructions (ADD, SUB for 64-bit integers), bit manipulations (AND, OR, XOR), branches (BEQ, BNE with PC-relative offsets), and load/store (LD, SD for 64-bit data), extending the modular RISC-V base with custom extensions for security and determinism. It supports vector units in some variants for parallel processing, using 32-bit or 64-bit registers depending on the RV64GC profile; assembly adheres to RISC-V conventions (e.g., "add x5, x6, x7"), integrated with XC32 or emerging RISC-V toolchains for C programming.[71]

Execution model and performance

The execution model of PIC microcontrollers revolves around a Harvard architecture with separate program and data memory spaces, enabling efficient handling of subroutines and interrupts through dedicated stack mechanisms. In 8-bit families, a hardware stack is employed for subroutine calls and interrupts, storing return addresses automatically upon CALL or interrupt entry and retrieving them on RETURN or RETFIE instructions. Baseline and mid-range PIC10, PIC12, and PIC16 devices feature an 8-level deep hardware stack, while enhanced mid-range PIC16 and PIC18 families expand this to 16 or 31 levels, respectively, to support deeper nesting without overflow resets in typical embedded applications.[72] For 16-bit PIC24 and dsPIC families, as well as 32-bit and 64-bit PIC32 and PIC64 families, a software stack is utilized, managed via dedicated registers such as W15 in PIC24/dsPIC or register 29 (sp) in PIC32, allowing flexible allocation in data memory for subroutine parameters, local variables, and return addresses during calls.[73][74] This shift to software stacks in higher-bit families accommodates more complex recursion and context saving, though it requires compiler-managed overflow protection. Interrupt handling in PIC microcontrollers supports vectored and prioritized execution to ensure timely responses in real-time systems. Early 8-bit baseline and mid-range cores use a single interrupt vector at 0x0004, with no inherent priority, requiring software polling of flags within a shared ISR. Enhanced PIC18 cores introduce vectored interrupts via an optional Vectored Interrupt Controller (VIC), mapping up to 70 sources to specific vectors, and support two priority levels (high and low) configurable through the IPEN bit and IPR registers, allowing high-priority interrupts to preempt low ones using shadow registers for fast context switching.[72][75] In 16-bit PIC24 and dsPIC families, interrupts offer 8 user-selectable priority levels (1-7), with traps at levels 8-15, enabling nested handling across up to 118 sources via IPC registers.[76] The 32-bit PIC32 families extend this to 7 priority levels with 4 sub-priorities and up to 256 vectored sources in multi-vector mode, while the 64-bit PIC64 maintains advanced prioritization across its multi-core setup for high-throughput applications.[77] Performance in PIC microcontrollers is characterized by clock speeds, efficiency metrics, and architectural optimizations tailored to embedded constraints. 8-bit families operate at base frequencies of 4-8 MHz, scaling to 64 MHz in high-end PIC18 variants, delivering approximately 1 MIPS/MHz (million instructions per second per MHz of oscillator frequency) through a 2-stage pipeline that fetches and executes instructions in overlapping cycles, though branches incur a 2-cycle penalty.[72] 16-bit PIC24 and dsPIC cores achieve up to 70 MIPS at 70 MHz via a similar 2-stage pipeline, emphasizing deterministic execution for DSP tasks. 32-bit PIC32 devices reach 200-252 MHz with 5-stage pipelines yielding 1.56-1.75 DMIPS/MHz, while the superscalar 64-bit PIC64, with dual-issue capabilities across 8 cores, delivers up to 26,000 DMIPS at 1,000 MHz, prioritizing parallel processing in multi-threaded environments.[78][79][80] Benchmarks highlight trade-offs in execution efficiency and power consumption. For instance, PIC32MM devices score 3.17 CoreMark/MHz at 25 MHz, reflecting compact microMIPS instruction encoding for reduced code size and energy use in battery-powered IoT nodes.[81] Higher-end PIC32MZ variants achieve up to 415 DMIPS at 252 MHz while consuming under 1 W in active modes, balancing computational demands with low-power sleep states (e.g., 100 µA/MHz run current), making them suitable for industrial controls where sustained performance must not compromise longevity.[82] These metrics underscore the families' progression from simple polling loops in 8-bit cores to vectored, prioritized dispatching in advanced models, optimizing latency in interrupt-heavy applications without excessive power draw.

Hardware features

Peripherals and interfaces

PIC microcontrollers integrate a variety of peripherals and interfaces to support connectivity, signal processing, and control functions across different families, enabling efficient embedded system designs without external components. These peripherals range from basic digital I/O to advanced analog and communication modules, with core-independent options in modern devices that operate autonomously to reduce power consumption and CPU overhead.[83] Timers and counters in PIC microcontrollers provide essential timing and event-counting capabilities, available in 8-bit, 16-bit, and 32-bit configurations depending on the family. For instance, the 8-bit PIC families feature Timer0 as an 8-bit timer/counter with options for internal clock or external pulse counting, while PIC18 devices include 16-bit Timer1/3/5 modules supporting capture/compare modes for measuring pulse widths and generating PWM signals. Higher-end PIC24 and PIC32 families extend to 32-bit timers for precise, long-duration timing. Many recent PIC MCUs incorporate core-independent timers that continue operating in low-power modes like sleep, allowing asynchronous event handling such as periodic wake-ups or PWM generation without CPU intervention.[84][85] Communication peripherals facilitate interfacing with external devices and networks, with support for both synchronous and asynchronous protocols. Universal Asynchronous Receiver/Transmitter (UART) modules enable serial communication for debugging and simple data exchange, often supporting LIN protocols in automotive applications. Serial Peripheral Interface (SPI) provides high-speed, full-duplex synchronous communication for short-distance peripherals like sensors and displays, while Inter-Integrated Circuit (I2C) allows multi-master/multi-slave bus operations for low-speed device control. In higher-end families such as PIC18 and PIC32, additional interfaces like Controller Area Network (CAN) for robust automotive networking and LIN for cost-sensitive vehicle subsystems are integrated, with Ethernet and USB available in 32-bit PIC32 devices for internet connectivity and host/device roles.[86][87] Analog peripherals handle signal acquisition and generation, crucial for sensor-based applications. Analog-to-Digital Converters (ADCs) in PIC microcontrollers typically offer 10-bit resolution with sampling rates up to 100 ksps in PIC18 families, and 12-bit options in advanced PIC16 and PIC24 devices for higher precision; features like successive approximation and input multiplexing support multiple channels. Digital-to-Analog Converters (DACs) provide 8-bit or 10-bit output for waveform generation, often buffered for driving loads. Complementary modules include comparators for threshold detection and operational amplifiers for signal conditioning, integrated in families like PIC16F for compact analog front-ends.[88][89] For motor control and digital signal processing, PIC microcontrollers include dedicated modules like Pulse-Width Modulation (PWM) generators with up to 16-bit resolution in dsPIC and PIC32 families, enabling precise speed and torque control in brushless DC or stepper motors. Quadrature encoder interfaces capture position and direction from rotary encoders, supporting closed-loop feedback. Configurable Logic Cells (CLCs) allow custom combinational and sequential logic implementation directly on-chip, acting as core-independent glue logic for event routing and state machines without firmware overhead.[90][91] Family-specific enhancements include Multi-Voltage I/O (MVIO) in the PIC18-Q24 series, which permits select pins to operate at voltages from 1.8V to 5.5V independently of the core supply, eliminating external level shifters for mixed-voltage interfacing. In 32-bit PIC32 families, high-speed USB 2.0 support enables up to 480 Mbps data rates in device, host, or OTG modes, suitable for applications like data acquisition and human-interface devices.[36][92]

Power management and packaging

PIC microcontrollers support a wide operating voltage range, typically from 1.8 V to 5.5 V, enabling compatibility with various power supplies in low-voltage applications such as battery-powered devices.[18] Low-voltage variants, like those in the PIC18LF family, extend down to 2.0 V while maintaining full functionality, whereas standard devices may require a minimum of 4.2 V for certain high-performance modes.[93] This flexibility allows designers to optimize for energy efficiency without sacrificing performance. Power management features include multiple low-power modes to minimize consumption during idle periods. Sleep mode halts the CPU and most peripherals, achieving typical currents as low as 0.1 µA at 2.0 V, with some extreme low-power configurations reaching below 20 nA in deep sleep for extended battery life.[18] Idle and doze modes provide intermediate options, where the CPU is clocked slower or paused while peripherals remain active, consuming around 5.8 µA.[93] Brown-out reset (BOR) circuitry monitors supply voltage and triggers a reset if it falls below programmable thresholds (e.g., 2.00 V to 4.82 V), preventing erratic operation during power glitches.[93] Clock management contributes to power optimization through selectable sources. Internal RC oscillators provide frequencies up to 8 MHz with factory calibration, suitable for low-power applications without external components.[93] External crystal options support precise timing from 0.2 MHz to 25 MHz, while phase-locked loops (PLLs) multiply base frequencies—such as 4x on an 8 MHz internal source—to achieve effective system clocks up to 48 MHz for higher performance when needed.[93] In low-power scenarios, the oscillator can downshift to 31 kHz for minimal draw. Packaging options for PIC microcontrollers range from compact surface-mount to through-hole formats, accommodating pin counts from 6 to 100. Common types include DIP for prototyping, SOIC and SSOP for space-constrained boards, QFN for thermal efficiency, and TQFP or BGA for higher-density designs with up to 176 pins in advanced families.[1] All packages have been lead-free and RoHS-compliant since January 2006, using matte tin plating for environmental compatibility and solderability.[94] Trends emphasize low-power variants like the PIC10 and PIC12 families, optimized for battery-operated sensors with standby currents under 100 nA and operating voltages starting at 2.0 V.[18] Automotive-grade devices meet AEC-Q100 standards, supporting extended temperature ranges from -40°C to 125°C (Grade 1) or up to 150°C (Grade 0) for under-hood reliability.[95] Part numbering follows a structured scheme indicating family, features, pin count, temperature range, and package. For example, PIC18F26K22-I/SP denotes the PIC18 family (18), Flash program memory (F), 28 pins (26), enhanced features (K22), industrial temperature (I), and SPDIP package (SP).[1] Security features in PIC microcontrollers have evolved to address code protection and unauthorized access, with early implementations like CodeGuard introduced in the PIC24 and dsPIC families. CodeGuard provides memory segmentation into Boot, Secure, and General segments with tiered privilege levels and access controls, enabling secure sharing of resources such as memory, interrupts, and peripherals among multiple parties on a single chip.[96] In more recent PIC18-Q24 devices, the Peripheral Debug Interface Disable (PDID) enhances security by allowing permanent disabling of debug interfaces post-programming, preventing external probing of internal states. Immutable bootloaders further reinforce this by using hardware-enforced read-only sections that verify bootloader integrity before allowing application code execution, a design common in secure IoT applications. Cryptographic capabilities have been integrated into higher-end families to support secure communications and data protection. The PIC32 series incorporates hardware accelerators for AES encryption and true random number generators (RNG), enabling efficient implementation of standards like AES-128/256 for symmetric cryptography. These features reduce software overhead, allowing real-time encryption in resource-constrained environments. The emerging PIC64 family extends this with post-quantum cryptography support, including lattice-based algorithms resistant to quantum attacks, alongside secure boot processes that authenticate firmware using digital signatures before loading. Secure boot in these devices chains cryptographic verification from the bootloader through application stages, mitigating supply chain risks. Hardware trends in PIC microcontrollers reflect adaptations to specialized applications and emerging technologies. For space applications, the PIC64 incorporates radiation-hardened (rad-hard) designs tolerant to total ionizing dose levels exceeding 100 krad, using silicon-on-insulator processes to maintain reliability in harsh radiation environments. Multi-voltage I/O capabilities allow seamless interfacing with 1.8V to 5V domains, reducing level-shifting needs in mixed-voltage systems. Variant trends emphasize domain-specific optimizations, balancing cost, reliability, and performance. Automotive-grade PIC devices achieve AEC-Q100 qualification, enduring temperatures from -40°C to 125°C and electromagnetic interference, as seen in motor control applications. High-temperature variants extend operational ranges up to 150°C for downhole oil and gas sensing, employing specialized packaging to prevent thermal degradation. Low-cost one-time programmable (OTP) options provide economical non-volatile memory for high-volume production, contrasting with reprogrammable flash variants that offer flexibility for prototyping and field updates. Looking toward 2025, PIC microcontroller trends prioritize IoT security enhancements, including integrated secure elements for key storage and over-the-air update verification to counter evolving cyber threats. Energy harvesting peripherals, such as ultra-low-power DC-DC converters and solar input managers, are increasingly standard, enabling battery-less operation in remote sensors.

Development and programming tools

Integrated development environments

MPLAB X IDE serves as Microchip's primary integrated development environment for PIC microcontroller software development, offering a free, cross-platform tool that supports all PIC families through a configurable interface for project management, code editing, and build processes.[97] It includes an integrated simulator and debugger, enabling developers to test and refine code without hardware, with features like real-time variable monitoring and breakpoint management.[98] The IDE's extensible architecture allows plugin integration, facilitating seamless workflow from design to deployment across 8-bit, 16-bit, and 32/64-bit PIC devices.[99] Microchip provides optimized compilers within the MPLAB XC family to generate efficient code for PIC targets: XC8 for 8-bit PIC and AVR microcontrollers, emphasizing compact and fast execution; XC16 for 16-bit PIC and dsPIC devices, supporting ANSI C with device-specific optimizations; and XC32 for 32-bit and 64-bit PIC microcontrollers, compatible with MIPS, ARM Cortex-M, and RISC-V cores used in PIC32 and SAM families.[100] These compilers integrate directly into MPLAB X IDE, offering features like MISRA C compliance checking and code size/performance analysis to ensure reliable embedded applications.[101] Key features enhance productivity, including the MPLAB Code Configurator (MCC), a graphical tool that automates peripheral setup by generating initialization code and drivers for PIC devices, reducing manual register configuration.[102] For 32/64-bit PIC microcontrollers, the MPLAB Harmony v3 framework provides a modular software stack with reusable libraries for drivers, middleware, and RTOS integration, promoting scalable firmware development.[60] These tools integrate with the IDE's debugging capabilities, allowing in-circuit emulation and simulation for iterative testing.[98] Third-party options include IAR Embedded Workbench, which supports ARM-based PIC32 variants with advanced optimization and static analysis, and Arm Keil MDK, offering comprehensive toolchain for Cortex-M cores in PIC32 and SAM devices.[52] Both provide alternatives for developers seeking specialized features beyond Microchip's ecosystem. In February 2025 updates, MPLAB X IDE version 6.25 introduced the MPLAB AI Coding Assistant, a free AI-powered extension for Visual Studio Code integration that generates code snippets, autocompletes functions, and offers real-time suggestions tailored to PIC development.[103] The MPLAB Analysis Tool Suite provides code coverage analysis and MISRA C compliance checking integrated into the IDE.[104]

Programmers and bootloaders

Programming PIC microcontrollers typically involves hardware tools that interface with the device's In-Circuit Serial Programming (ICSP) pins to load firmware during development or production. Microchip Technology provides official low-cost programmers such as the MPLAB PICkit 4, which uses a high-speed USB 2.0 interface and supports target voltages from 1.2 V to 5.5 V, enabling programming of PIC, AVR, SAM, and dsPIC devices with up to 50 mA power delivery.[105] Similarly, the MPLAB Snap offers a compact, affordable alternative with the same voltage range and USB connectivity, suitable for prototyping and compatible with the MPLAB X Integrated Development Environment.[106] For high-volume production, Microchip's Prime8 production programmer features eight high-speed ICSP jacks for gang programming of multiple devices simultaneously.[107] The legacy PRO MATE II device programmer supports serial programming for mid-volume runs of PIC microcontrollers.[108] These production tools integrate with ICSP protocols, allowing in-circuit updates without removing devices from the board, which streamlines manufacturing workflows.[109] Bootloaders embedded in many PIC devices facilitate field updates without dedicated hardware programmers, using built-in peripherals like UART, I2C, or USB for firmware transfer. Microchip's bootloader generation tools support creating custom firmware for PIC18 and PIC32 families, including USB HID protocols for seamless PC integration on PIC18 devices.[110] For example, PIC18 microcontrollers can employ UART-based bootloaders for serial updates, while PIC32 variants leverage USB for HID-class communication during over-the-air (OTA) scenarios.[110] The primary protocol for these operations is ICSP, a four-wire serial interface (VPP/MCLR, VDD, VSS, PGD, PGC) that enables programming while the device remains in-circuit. Low-Voltage Programming (LVP) mode, controlled by the LVP configuration bit, allows entry into programming state using logic-level signals on the PGM pin (typically RB3) instead of high-voltage pulses, simplifying connections and reducing hardware requirements when enabled.[109] Disabling LVP requires high-voltage entry to set the bit to '0', ensuring security in deployed systems.[111] As of 2025, trends in IoT applications emphasize wireless OTA updates for PIC32 microcontrollers, leveraging secure bootloaders to enable remote firmware upgrades over Wi-Fi or Bluetooth, enhancing device longevity and feature deployment in connected ecosystems.[112] Microchip's solutions integrate cryptographic verification in these bootloaders, supporting PIC32MZ W1 family devices for seamless IoT provisioning.[113]

Debugging and testing

In-circuit debugging

In-circuit debugging (ICD) for PIC microcontrollers enables real-time code execution analysis and modification directly on the target hardware without device removal, leveraging the device's on-chip debug module and a debug executive—a small firmware loaded into protected memory space. This mode communicates via the In-Circuit Serial Programming (ICSP) interface, utilizing dedicated pins such as PGD for serial data, PGC for clock, VDD for power sensing, VSS for ground, and MCLR/VPP for reset, typically connected through a 6- or 8-pin header.[114] The debug executive handles commands from external tools, facilitating seamless integration with the application circuit while minimizing interference.[115] Key debugging capabilities include breakpoints and watchpoints. Hardware breakpoints, limited by the microcontroller's resources (e.g., up to four on select PIC18 devices), halt execution at specific addresses without altering code, while software breakpoints insert temporary NOP instructions in flash memory, offering unlimited use but potentially reducing flash endurance over repeated programming cycles. Watchpoints monitor data memory, file registers, or variables for changes, triggering halts or logging without stopping the processor. These features support PIC10, PIC12, PIC16, PIC18, and dsPIC families, with enhanced support for PIC18 and above.[114][116] MPLAB ICD 4 and the newer MPLAB ICD 5 serve as primary tools, integrating with MPLAB X IDE for comprehensive control; the ICD 5 adds faster USB connectivity and larger buffers for extended sessions. Debugging is largely non-intrusive, with no cycle stealing during run mode, allowing full-speed execution up to the device's rated frequency (e.g., 64 MHz on high-end PIC18). Developers can inspect variables in real-time via register and memory windows, step through code, and monitor peripherals, including options to freeze timers, UARTs, or ADCs upon breakpoint for state preservation—particularly useful on PIC18 and dsPIC33 devices. Instrumented trace on PIC18+ captures execution history, program counter values, and data accesses for post-analysis, aiding in complex issue diagnosis.[114][117][115] For 32-bit PIC32 and 64-bit PIC64 families, debugging typically uses JTAG or serial wire debug interfaces with tools like MPLAB PICkit 5 or MPLAB REAL ICE, integrated in MPLAB X IDE. As of November 2025, PIC64-HPSC supports multi-core RISC-V debugging via GCC/LLVM toolchains and OS-aware features in MPLAB X IDE for symmetric/asymmetric multiprocessing.[59] Despite these advantages, ICD imposes limitations, such as dedicating ICSP pins, which reduces available general-purpose I/O (typically 2-3 pins affected). In low-power applications, debug overhead can disrupt sleep or idle modes, as the debug executive may consume additional current (up to several mA) or require the device to remain in active states; external power supplies are often needed for targets below 1.2V. Production code must disable debug features via configuration bits to avoid security risks and reclaim memory.[114][116]

Emulation and simulation

Emulation and simulation tools for PIC microcontrollers enable developers to test and verify code and system behavior in virtual environments, reducing the need for physical hardware during early development stages. These tools range from software-based simulators that model microcontroller operation at the instruction level to hardware emulators that provide near-real-time execution with advanced tracing capabilities. By simulating peripherals, interrupts, and external stimuli, they facilitate debugging, performance analysis, and virtual prototyping without risking damage to target devices or incurring hardware costs.[118] The MPLAB SIM simulator, integrated within the MPLAB X IDE, offers cycle-accurate simulation across all PIC microcontroller families, executing code on instruction cycle boundaries to mimic real hardware timing precisely. It supports peripheral modeling for components like timers, UARTs, and ADCs, allowing developers to observe interactions without physical connections. Key features include stimulus injection, where users can apply manual, cyclic, sequential, or conditional signals to pins and registers to simulate external events such as voltage changes or sensor inputs. Additionally, the simulator provides performance profiling through register logging and execution traces, enabling analysis of code efficiency, stimulus execution summaries, and timing metrics to optimize applications.[119][120][99][121] Hardware emulation for PIC microcontrollers, particularly for 16-bit PIC24 and 32-bit PIC32 families, is exemplified by the MPLAB REAL ICE in-circuit emulator, which functions similarly to legacy tools like SoftICE by enabling full-speed, non-intrusive execution of user code. This emulator connects via a debug header and supports high-speed debugging up to the device's maximum clock rate, with features like data capture, logic triggers, and trace capabilities akin to a built-in logic analyzer for monitoring signals, breakpoints, and state changes over extended sessions. It allows for complex trigger setups based on address, data, or external inputs, facilitating deep analysis of real-time behaviors in emulated environments up to 10 feet from the host PC.[122][123][124] Third-party tools like Proteus VSM from Labcenter Electronics extend PIC simulation to virtual prototyping of entire systems, combining fast microcontroller simulation with mixed-mode SPICE for analog and digital circuits. Proteus supports PIC families through compiled firmware integration, allowing real-time interaction between simulated PIC code and virtual peripherals or external components on a schematic. This enables comprehensive system-level testing, such as validating I/O interactions or power supply responses, without hardware assembly.[125][126][127] For advanced applications, the MPLAB Mindi Analog Simulator complements PIC development by modeling analog circuits associated with microcontroller interfaces, using SPICE or piecewise linear models to predict behaviors like filter responses or amplifier performance before integration. It runs locally on PCs and supports PIC-specific libraries for quick schematic-to-simulation workflows. For dsPIC digital signal controllers, co-simulation with MATLAB/Simulink is available via MPLAB Device Blocks, which enable model-based design, algorithm verification, and automatic code generation for embedded deployment, bridging high-level simulation with PIC hardware.[128][129][130][131][132] These tools integrate seamlessly with MPLAB X IDE for streamlined workflows from simulation to deployment.[97]

Software ecosystem

Compilers and operating systems

The MPLAB XC compilers, developed by Microchip Technology, provide optimized C/C++ compilation support tailored to PIC microcontroller architectures. The XC8 compiler targets 8-bit PIC devices, offering optimization levels up to 3 for balancing code size and execution speed, which enables efficient resource utilization in memory-constrained applications. For 16-bit PIC and dsPIC devices, the XC16 compiler delivers ANSI C compliance with enhancements for digital signal processing tasks. The XC32 compiler, built on GCC infrastructure, supports 32-bit PIC microcontrollers including MIPS-based PIC32 families, facilitating portable code development across core variants with features like inline assembly and interrupt handling optimizations. Open-source alternatives include the Small Device C Compiler (SDCC), which supports C programming for various PIC families.[100][133] Microchip's software ecosystem includes comprehensive libraries for peripheral management and connectivity. The Peripheral Library (PLIB) offers driver functions for modules such as timers, ADCs, and UARTs across PIC families, simplifying hardware abstraction in firmware development. For USB applications, the Microchip Libraries for Applications (MLA) and MPLAB Harmony frameworks provide a modular USB stack supporting device and host modes on PIC18, PIC24, and PIC32 devices. Ethernet-enabled PIC32 microcontrollers utilize the TCP/IP stack within MLA or Harmony, enabling lightweight protocol implementations like HTTP and UDP for networked embedded systems.[134][135][136] Operating systems for PIC microcontrollers vary by architecture and complexity. Eight-bit PIC devices predominantly operate in bare-metal environments, leveraging direct register access for real-time control in simple applications. For 32-bit PIC32 MIPS-based devices, FreeRTOS provides a lightweight real-time kernel with task management and interrupt support, while MQX RTOS offers scalable multitasking for industrial applications. ARM Cortex-M-based PIC32 variants, such as the PIC32CK series, support Zephyr RTOS, which includes modular drivers and networking stacks suitable for IoT deployments. FreeRTOS integrated with Arm TrustZone on PIC32CK devices enables hardware-enforced secure/non-secure world partitioning for enhanced security.[137][138][139] The broader software ecosystem integrates these elements through MPLAB Harmony, a configuration-driven framework for 32-bit PIC devices that generates initialized code for peripherals, middleware, and RTOS via graphical tools in MPLAB X IDE. Harmony supports cross-platform development with drivers compatible for Windows and Linux host environments, streamlining deployment from prototyping to production. As of March 2025, MPLAB X IDE v6.25 includes updates supporting these features. The MPLAB ML Development Suite provides AI/ML libraries optimized for PIC32 devices, including support for tensor operations and neural network inference engines, enabling edge computing capabilities without external processors.[60][97][140]

Third-party clones and derivatives

Several third-party manufacturers have developed clones and derivatives of PIC microcontrollers, primarily to offer cost-effective alternatives, regional availability, or enhanced performance while maintaining compatibility with the original PIC instruction sets and pinouts. These clones emerged particularly in the 1990s and 2000s, targeting markets where Microchip's PICs were popular but supply or pricing posed challenges. They typically replicate the Harvard architecture and RISC-like instruction sets of early PIC families, such as the 12-bit, 14-bit, or 16-bit variants, but may include modifications like higher clock speeds or updated memory types. The Parallax SX series, originally designed by Scenix (later Ubicom) and marketed by Parallax, represents an early high-performance PIC derivative. It uses a 12-bit instruction set compatible with the PIC16C5x family but achieves execution speeds up to 75 MHz through a 2-cycle instruction pipeline and optimized core, making it suitable for real-time control applications like robotics and communications.[141] The SX microcontrollers, available in 18- to 48-pin packages, were produced until the mid-2000s and supported PIC assemblers with minor adaptations. Russian firm Milandr (part of the PKK Milandr group) produces the 1886VE series, which directly clones the PIC17C756A from Microchip's 16-bit enhanced PIC family. These devices retain the PIC17's vectored interrupts and table-based operations but incorporate modern Flash program memory (up to 32 KB), replacing the original's EPROM for easier reprogramming. Targeted at industrial and military applications in Eastern Europe and Asia, the K1886VE operates at 33 MHz.[142] Taiwan-based ELAN Microelectronics offers the EM78P series with a 13-bit instruction set similar to and compatible with the PIC12C5xx and PIC16C5x baselines. For instance, the EM78P156 is pin- and function-compatible with the PIC16C54/55/56, supporting OTP or Mask ROM memory up to 1 KB and basic peripherals like timers and I/O ports. These low-cost devices (often under $0.50 in volume) are widely used in consumer electronics, toys, and remote controls, with ELAN providing application notes for direct PIC code migration.[143] Holtek Semiconductor, another Taiwanese company, manufactures the HT48 series of 8-bit RISC microcontrollers with an instruction set supporting assembly language similar to PIC, including 14- or 15-bit words for operations like bit manipulation and indirect addressing. Models like the HT48R002 feature up to 4 KB program memory, 96 bytes RAM, and integrated peripherals such as PWM and A/D converters, optimized for battery-powered appliances and sensors. Their assembly language is highly similar to PIC's, enabling code portability with minimal changes.[144] Lesser-known Asian firms have contributed to a broader ecosystem of PIC derivatives, though many are now obsolete or niche. These third-party products have sustained legacy PIC designs in cost-sensitive regions but face challenges from modern ARM-based alternatives.

References

User Avatar
No comments yet.