Title: PIC Microcontroller


  • Microchip was invented the PIC in 1993.
  • The word PIC stands for Peripheral Interface Controller. This was originally designed to help PDP computers monitor their peripheral devices, and is thus referred to as a peripheral interface unit. Compared to other microcontrollers, these microcontrollers can run a program very quickly and comfortably.
  • PIC Microcontroller is based Harvard Architecture.
  • PIC Microcontroller are available are wide between 8 bit to 32 bits.

PIC Family

PIC Microcontrollers from Microchip Company are divided into 4 large families. Each family has a variety of components that provide built-in special features:

  • The first family, PIC10 (10FXXX) - is called Low End.
  • The second family, PIC12 (PIC12FXXX) – is called Mid-Range.
  • The third family is PIC16 (16FXXX).
  • The fourth family is PIC 17/18(18FXXX)
  • The fifth family is PIC32 (32FXXX)

PIC18F Features

  • 40 Pins low Power.
  • Flash Program memory: 32K bytes.
  • EEPROM Data Memory: 256 bytes.
  • SRAM Data Memory: 1536 bytes.
  • Input & Output pins: 36.
  • Timers: One 8 bit / Three 16 bit.
  • A/D Converter: 10 bit Eleven Channels.
  • CAN: CAN 2.0B Specification with transmit & Receive Buffers.
  • PWM: 10-bit two modules.
  • MSSP: SPI & I2C Master & Slave support.
  • Enhanced USART: Addressable with RS-485, RS232 & LIN Support.
  • External Oscillator: up to 40MHz.
  • Internal Oscillator: 4MHz.

PIC Microcontrollers Architecture

The PIC microcontroller are based on RISC architecture. The memory of PIC architecture is follows the Harvard pattern of separate memories for program and data, with separate buses.

1. Memory Structure

The PIC architecture consists of two memories: Program memory and Data memory.

Read Only Memory (ROM)

Read only memory is the place where our program gets stored. Its decides the maximum size of our program, and it is also called as program memory. When the MCU is under operation, the program stored in the ROM is executed as per each instruction cycle. This memory unit can be used only while programming the PIC, during execution it becomes a read only memory. This is a 32K memory space. It is used to store 13-bit instructions or the program code. The program counter register that holds the address of the program memory accesses the program memory data.

Electrically Erasable Programmable Read Only Memory (EEPROM)

EEPROM is another type of Memory Unit. In this memory unit values can be stored during program execution. The values stored here are only Electrically Erasable that is these values will be retained in the PIC even when the Power is turned off. They can be used as small memory space to store the executed values however, the memory space will be very less in turns of KB. The contents into EEPROM can be read from or written to, using special function registers like EECON1, EECON, etc.

Data Memory

The data memory consists of the 1536 bytes of RAM and 256 bytes of EEPROM. The 1536 bytes of RAM consists of multiple banks. Each bank consists of general-purpose registers and special function registers. The special function registers consist of control registers to control different operations of the chip resources like Timers, Analog to Digital Converters, Serial ports, I/O ports, etc. For example, the TRISA register whose pins can be configured/ change into the analog the input operations of the port A. The general-purpose registers consist of registers that are used to store temporary data and processing results of the data. These general-purpose registers are each 8-bit registers.

2. I/O Ports

PIC16 series consists of five ports, such as Port A, Port B, Port C, Port D, and Port E.

  • Port A: It is a 8-bit port, which can be used as an input or output port based on the status of the TRISA register, and it’s also consist the Analog Channels.
  • Port B: It is an 8-bit port, which can be used as both an input and output port. 4 of its bits, when used as input, can be changed upon interrupt signals.
  • Port C: It is an 8-bit port whose operation (input or output) is determined by the status of the TRISC register, and it also configure to UART, SPI &I2C.
  • Port D: It is an 8-bit port, which apart from being an I/O port, is determined by the status of the TRISD register.
  • Port E: A 3-bit port serves the additional function of the control signals to the A/D converter.

3. Oscillators

Oscillators is used for timing generation. PIC microcontrollers consist of external oscillators like crystals or RC oscillators. In the case of crystal oscillators, the crystal are connected between two oscillator pins, and the value of the capacitor connected to each pin determines the mode of operation of the oscillator. The different modes are low-power mode, crystal mode, and the high- speed mode. In the case of RC oscillators, the value of the Resistor and Capacitor determines the clock frequency. The clock frequency ranges from 4MHz to 20MHz.

4. Timers

PIC microcontrollers consist of four timers, out of which the Timer 2 are 8-bit timers and the rest of all timer is a 16-bit timer, which can also be used as a counter.

5. A/D Converter

The PIC Microcontroller consists of 11-channels, 10-bit Analog to Digital Converter. The operation of the A/D converter is controlled by these special function registers: ADCON0, ADCON1 and ADCON2. The lower bits of the converter are stored in ADRESL (8 bits), and the upper bits are stored in the ADRESH register. It requires an analog reference voltage of 5V for its operation.

6. CCP module:

A CCP module works in the following three modes: Capture Mode: This mode captures the time of arrival of a signal, or in other words, captures the value of the Timer1/Timer3 when the CCP pin goes high. Compare Mode: It acts as an analog comparator that generates an output when the timer1 value reaches a certain reference value. PWM Mode: It provides pulse width modulated output with a 10-bit resolution and programmable duty cycle.


Rise of Electric Vehicles

Changing Electric Vehicles with Embedded Systems: A Profound Jump into their Importance

Electric Vehicles (EVs) have arisen as a distinct advantage in the auto business, offering a supportable option in contrast to conventional gas-powered motor vehicles. The outcome of EVs, in any case goes past proficient powertrains and battery innovation; it vigorously depends on the coordination of state-of-the-art embedded systems. In this far-reaching article, we ...Read More

Gap Between Embedded and IOT Programming

Difference Between Embedded System Programming & IOT Programming

Embedded system introduction : An embedded system implies a PC structure expected to do unambiguous jobs inside a greater structure or thing. It is a mix of hardware and programming parts that collaborate to give committed helpfulness. ...Read More

Importance of Embedded Systems in Automotive Industry

Use of Embedded Systems in Automotive Industry

Embedded structures expect a huge part in the auto business, engaging various capacities and features inside present-day vehicles. The following are a couple of basic reasons for embedded structures in the vehicle business: Engine Control Unit (ECU):...Read More

Impact of Embedded Systems

The Vital Role of Embedded Systems in Electric Vehicles

The automotive industry is experiencing a seismic shift as electric vehicles (EVs) become the dominant focal point in the mission for sustainable transportation arrangements. Past the electrification of powertrains, embedded systems are emerging ...Read More