The basics of Peripheral Interface Controller have already been explained in recent posts. To know more about them, click on the links below.
TAKE A LOOK : PERIPHERAL INTERFACE CONTROLLER (PIC)
Overview of PIC 16F877
PIC 16F877 is one of the most advanced microcontroller from Microchip. This controller is widely used for experimental and modern applications because of its low price, wide range of applications, high quality, and ease of availability. It is ideal for applications such as machine control applications, measurement devices, study purpose, and so on. Â The PIC 16F877 features all the components which modern microcontrollers normally have. The figure of a PIC16F877 chip is shown below.
Features of PIC16F877
The PIC16FXX series has more advanced and developed features when compared to its previous series. The important features of PIC16F877 series is given below.
oÂ Â High performance RISC CPU.
oÂ Â ONLY 35 simple word instructions.
oÂ Â All single cycle instructions except for program branches which are two cycles.
oÂ Â Operating speed: clock input (200MHz), instruction cycle (200nS).
oÂ Â Up to 368Ã—8bit of RAM (data memory), 256Ã—8 of EEPROM (data memory), 8kÃ—14 of flash memory.
oÂ Â Pin out compatible to PIC 16C74B, PIC 16C76, PIC 16C77.
oÂ Â Eight level deep hardware stack.
oÂ Â Interrupt capability (up to 14 sources).
oÂ Â Different types of addressing modes (direct, Indirect, relative addressing modes).
oÂ Â Power on Reset (POR).
oÂ Â Power-Up Timer (PWRT) and oscillator start-up timer.
oÂ Â Low power- high speed CMOS flash/EEPROM.
oÂ Â Fully static design.
oÂ Â Wide operating voltage range (2.0 â€“ 5.56)volts.
oÂ Â High sink/source current (25mA).
oÂ Â Commercial, industrial and extended temperature ranges.
oÂ Â Low power consumption (<0.6mA typical @3v-4MHz, 20ÂµA typical @3v-32MHz and <1 A typical standby).
oÂ Â Timer 0: 8 bit timer/counter with pre-scalar.
oÂ Â Timer 1:16 bit timer/counter with pre-scalar.
oÂ Â Timer 2: 8 bit timer/counter with 8 bit period registers with pre-scalar and post-scalar.
oÂ Â Two Capture (16bit/12.5nS), Compare (16 bit/200nS), Pulse Width Modules (10bit).
oÂ Â 10bit multi-channel A/D converter
oÂ Â Synchronous Serial Port (SSP) with SPI (master code) and I2C (master/slave).
oÂ Â Universal Synchronous Asynchronous Receiver Transmitter (USART) with 9 bit address detection.
oÂ Â Parallel Slave Port (PSP) 8 bit wide with external RD, WR and CS controls (40/46pin).
oÂ Â Brown Out circuitry for Brown-Out Reset (BOR).
oÂ Â Maximum operating frequency is 20MHz.
oÂ Â Flash program memory (14 bit words), 8KB.
oÂ Â Data memory (bytes) is 368.
oÂ Â EEPROM data memory (bytes) is 256.
oÂ Â 5 input/output ports.
oÂ Â 3 timers.
oÂ Â 2 CCP modules.
oÂ Â 2 serial communication ports (MSSP, USART).
oÂ Â PSP parallel communication port
oÂ Â 10bit A/D module (8 channels)
oÂ Â 10bit, up to 8 channel A/D converter.
oÂ Â Brown Out Reset function.
oÂ Â Analog comparator module.
oÂ Â 100000 times erase/write cycle enhanced memory.
oÂ Â 1000000 times erase/write cycle data EEPROM memory.
oÂ Â Self programmable under software control.
oÂ Â In-circuit serial programming and in-circuit debugging capability.
oÂ Â Single 5V,DC supply for circuit serial programming
oÂ Â WDT with its own RC oscillator for reliable operation.
oÂ Â Programmable code protection.
oÂ Â Power saving sleep modes.
oÂ Â Selectable oscillator options.
PIC16F877 chip is available in different types of Â packages. According to the type of applications and usage, these packages are differentiated. The pin diagrams of a PIC16F877 chip in different packages is shown in the figure below.
PIC16F877 has 5 basic input/output ports. They are usually denoted by PORT A (R A), PORT B (RB), PORT C (RC), PORT D (RD), and PORT E (RE). These ports are used for input/ output interfacing. In this controller, â€œPORT Aâ€ is only 6 bits wide (RA-0 to RA-7), â€PORT Bâ€ , â€œPORT Câ€,â€PORT Dâ€ are only 8 bits wide (RB-0 to RB-7,RC-0 to RC-7,RD-0 to RD-7), â€PORT Eâ€ has only 3 bit wide (RE-0 to RE-7).
|PORT-A||RA-0 to RA-5||6 bit wide|
|PORT-B||RB-0 to RB-7||8 bit wide|
|PORT-C||RC-0 to RC-7||8 bit wide|
|PORT-D||RD-0 to RD-7||8 bit wide|
|PORT-E||RE-0 to RE-2||3 bit wid|
All these ports are bi-directional. The direction of the port is controlled by using TRIS(X) registers (TRIS A used to set the direction of PORT-A, TRIS B used to set the direction for PORT-B, etc.). Setting a TRIS(X) bit â€˜1â€™ will set the corresponding PORT(X) bit as input. Clearing a TRIS(X) bit â€˜0â€™ will set the corresponding PORT(X) bit as output.
(If we want to set PORT A as an input, just set TRIS(A) bit to logical â€˜1â€™ and want to set PORT B as an output, just set the PORT B bits to logical â€˜0â€™.)
oÂ Â Analog input port (AN0 TO AN7) : these ports are used for interfacing analog inputs.
oÂ Â TX and RX: These are the USART transmission and reception ports.
oÂ Â SCK: these pins are used for giving synchronous serial clock input.
oÂ Â SCL: these pins act as an output for both SPI and I2C modes.
oÂ Â DT: these are synchronous data terminals.
oÂ Â CK: synchronous clock input.
oÂ Â SD0: SPI data output (SPI Mode).
oÂ Â SD1: SPI Data input (SPI mode).
oÂ Â SDA: data input/output in I2C Mode.
oÂ Â CCP1 and CCP2: these are capture/compare/PWM modules.
oÂ Â OSC1: oscillator input/external clock.
oÂ Â OSC2: oscillator output/clock out.
oÂ Â MCLR: master clear pin (Active low reset).
oÂ Â Vpp: programming voltage input.
oÂ Â THV: High voltage test mode controlling.
oÂ Â Vref (+/-): reference voltage.
oÂ Â SS: Slave select for the synchronous serial port.
oÂ Â T0CK1: clock input to TIMER 0.
oÂ Â T1OSO: Timer 1 oscillator output.
oÂ Â T1OS1: Timer 1 oscillator input.
oÂ Â T1CK1: clock input to Timer 1.
oÂ Â PGD: Serial programming data.
oÂ Â PGC: serial programming clock.
oÂ Â PGM: Low Voltage Programming input.
oÂ Â INT: external interrupt.
oÂ Â RD: Read control for parallel slave port.
oÂ Â CS: Select control for parallel slave.
oÂ Â PSP0 to PSP7: Parallel slave port.
oÂ Â VDD: positive supply for logic and input pins.
oÂ Â VSS: Ground reference for logic and input/output pins.
Take a look at the specifications of the PIC 16F87X Series
To know more about the Architecture and Memory Organization of PIC 16F877, click on the link below.
TAKE A LOOK : PIC 16F877 – ARCHITECTURE AND MEMORY ORGANIZATION