PIC microcontrollers
PIC is a family of microcontrollers made by Microchip Technology, derived from the PIC1640 originally developed by General Instrument's Microelectronics Division. The name PIC initially referred to Peripheral Interface Controller, and was subsequently expanded for a short time to include Programmable Intelligent Computer, 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.
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.
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
Original concept
The original PIC was intended to be used with General Instrument's new CP1600 16-bit central processing unit. In order to fit 16-bit data and address buses into a then-standard 40-pin dual inline package 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 that would be written with the user's device controller code, and a separate random access memory 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 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 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. Follow-ons included the PIC1670, with instructions widened from 12 to 13 bits to provide twice the address space. 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.
After the CP1600
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.
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.
Today, a huge variety of PICs are available with various on-board peripherals 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, replacing the 1976 original meaning "Programmable Interface Controller" for the PIC1640 that was designed specifically to work in combination with the CP1600 microcomputer. The "PIC Series Microcomputers" by General Instrument were a series of Metal-Oxide Semiconductor Large-Scale Integration 8-bit microcomputers containing ROM, RAM, a CPU, and 8-bit input/output 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.
The Microchip 16C84, introduced in 1993, was the first Microchip CPU with on-chip EEPROM memory.
By 2013, Microchip was shipping over one billion PIC microcontrollers every year.
Device families
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, 14 bits and 24 bits. 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 or PICnnFxxx. "C" devices are generally classified as "Not suitable for new development". 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 are in general no longer available.
PIC10 and PIC12
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, the INDF 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, 4 rarely read registers were not assigned addresses, but written by special instructions.
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 is implicitly specified as 0 by the CALL instruction itself.
Lookup tables are implemented using a computed
GOTO 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. 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.