Peripheral Interface Microcontroller, Best For DIY Projects
Peripheral Interface Controller(PIC) is a microcontroller from Microchip Technology. It is a Reduced Instruction Set Computer(RISC) that has been developed to achieve good performance from the use of a small optimized set of instructions. It comes in many different packagings that suit several simple and complex applications.
PIC microcontrollers were first manufactured by General Instrument under the brand name PICmicro. The original expansion was Programmable Intelligent Computer. It was built with an intention to offload I/O tasks from a 16-bit CP1600 CPU. Although PIC predates the RISC computers the 8-bit PIC microcontroller first developed and RISC computers share many features. PIC microcontrollers grew in popularity with Microchip Technology introducing cheaper PIC microcontrollers with EEPROM.
PIC Development Board
A microcontroller is a small computer that has a processor core, memory and programmable input/output peripherals in a single integrated circuit. Microcontrollers are used to design embedded systems. The microprocessors used to design general purpose systems needs separate circuits for memory and peripherals. They can perform many complex tasks using a large set of instructions while microcontrollers perform simpler tasks using significantly smaller set of instructions.
PIC microcontrollers have modified Harvard achitecture. It has separate memory spaces for storing data and programs. This allows simultaneous transfer of both data and instructions. The buses carrying data and instructions are different in widths. Data buses are generally 8-bit wide while instruction buses are 14- or 16-bit wide. The instruction buses carry the data and the instruction telling the CPU what to do with the data and thus needing a greater width. The It shares the RISC design characteristic of small number of instructions executed in small number of cycles.
Programs in PIC are permanently stored in Read Only Memory(ROM) using FLASH technology. The contents of the ROM can be changed by providing a special programming voltage making PIC reusable. The task of programming the PIC is accomplished with the help of certain hardware and software depending on the mode of programming. PIC supports various modes of programming like In-Circuit Self Programming, Self Programming, and Quick Turn Programming.
The PIC data memory is a Random Access Memory(RAM) that has two sets of directly accessed registers. The registers are Special Function Registers(SFRs) and General Purpose Registers(GPRs). The SFRs are used for controlling internal device operations and the GPRs act as general purpose RAM. The Special Function Registers are internally connected to the internal circuits of PIC microcontroller. General purpose registers on the other hand are assigned functions by te programmer. They store data and results during any operation when their addresses are specified and functions properly assigned.
EEPROM Data Memory
During operation certain results are generated that are to be stored permanently. The data stored in RAM is lost after the PIC is powered off. In many applications the previous results are required for performing certain operations. EEPROM helps in storing such results permanently.
Programs often contain subroutines and interrupts that requires the regular process of execution to be stopped. After the current instruction is executed the regular execution is to be resumed. To enable this functionality a part of RAM is used a stack memory. The address of the next instruction to be performed in the regular execution is pushed into the stack memory. The stack is cleared when regular execution resumes. PIC stack memory is cyclic in nature.
The set of instructions that a microcontroller can understand is called its instruction set. PIC microcontrollers are Reduced Instruction Set Computers(RISC) and therefore have very small instruction sets. PIC instructions can be on working registers, working registers and indexed registers, bit operations, control operations and some miscellaneous operations. The 8-bit PIC devices have very small instruction set but higher devices perform more complex tasks using much more number of instruction.
PIC microcontrollers support three types of serial communication – Inter Integrated Circuit(I2C), Serial Peripheral Interface
(SPI) and Universal Sychronous Asynchronous Receiver/Transmitter USART. I2C is used for communication between a master microcontroller and several slaves which may include another microcontroller. It is established with only two lines – one carrying data and the other the synchronizing clock.
SPI is used when higher Baud rate than I2C and full duplex communication is required. SPI is established with four lines – two of them for sending and receiving data, one for synchronizing clock and the other for selecting device. USART is an asynchronous communication that maintains synchronization by transmitting and receiving in the same frequency over the same data line. It has very low Baud rate.
The makers of PIC microcontrollers offers an IDE called MPLABX written on java which is a cross platform software available for computers running Microsoft Windows, Gnu/Linux and OS X. It has support for programming and debugging all PIC devices. PIC devices support in-circuit programming and debuggung. Third party software are also available for the same. Programmming is heavily based on C-lamguage and several C-compliers are supported by both MPLAB X and the third party applications.
Analog To Digital Converter(ADC)
PIC microcontrollers have I/O pins that support analog I/O signals using built-in ADCs. The number of analog pins vary with each model but the ADC generates a 10-bit binary after conversion. The result is stored in ADRESL and ADRESH registers. The reference voltage used for comparison can be programmed and the quality of conversion determined.
The PIC microcontrollers are optimized for various applications and thus have many advantages.
- Fewer instructions
- Low cost
- Flexibility in interfaces and packagings
- Built-in oscillators and ADCs
Use of register banking and only one accumulator are considered to be limitations of PIC microcontrollers along with the lack of orthogonality in instruction set.
PIC microcontrollers find extensive applications in the field of robotics where several analog and digital sensors are required to be operated and serial communication needs to be established. Several applications outside robotics related to data acquisition and other fields are also found of PIC microcontrollers.