Professional Documents
Culture Documents
Harvard von-Neumann
Program
Data Program and
CPU CPU
Memory Memory Data
Memory
Feature of 16F877
8 kB of FLASH Program Memory.
256 bytes of EEPROM Data Memory.
33 input or output pins.
20 MHz operating speed(200 ns instruction
cycle)
High performance RISC CPU.
PIC 16F877 2
Feature of 16F877
Only 35 simple word instructions.
Power on Reset (POR).
Power-Up Timer (PWRT)
Wide operating voltage range (2.0 –
5.56)volts.
Low power consumption .
PIC 16F877 Block Diagram
PIC 16F877 4
CPU
PIC 16F877 12
W Register
Status register is an eight bit register that contains the arithmetic status of the arithmetic
logic unit (ALU), the reset status and the bank select bits for the data memory. The detailed
explanation of status register is given below.
Carry bit(C)
When two 8-bit operands are added ,a 9 bits result occurs,Because the result of addition may
exceeds 256(FFH).
The 9th bit is copied in the Carry bit.
Bit 0 (C): Carry/borrow bit (ADDWF, ADDLW, SUBLW, SUBWF instructions)
1 = A carry-out from the Most Significant bit of the result occurred
0 = No carry-out from the Most Significant bit of the result occurred.
PIC 16F877
14
Digit carry(DC)
PIC 16F877 15
Zero(Z)
11 = Bank 3 (180h-1FFh)
10 = Bank 2 (100h-17Fh)
01 = Bank 1 (80h-FFh)
00 = Bank 0 (00h-7Fh)
PIC 16F877 19
Use of RP1:RP0 bits in direct
addressing mode
PIC 16F877 20
Indirect addressing mode
PIC 16F877
21
Use of IPR bits in indirect
addressing mode
22
PIC 16F877
FSR (File Selection Register)
PIC 16F877 23
PCLATH (Program Counter Latch)
Different from the program counter.
Any write to PCL will cause the contents of PCLATH to be transferred to
the 13 bit PC higher locations.
PIC 16F877 24
Input/output ports
PIC 16F877 25