Professional Documents
Culture Documents
4th Lecture Pic16
4th Lecture Pic16
MICROCONTROLLER SYSTEM
L4: PIC16 ARCHITECTURE 1
L4: Lesson outcome
- Introduction
- The PIC16 Basic Features
- PIC16 Internal Components
- CPU
- Control Unit
- ALU Unit
- Program Memory
- Data Memory
3
Introduction
•Consumption: 220uA
(2.0V, 4MHz), 11uA (2.0
V,
32 KHz) 50nA (stand-by mode)
•Power-Saving Sleep Mode
•Brown-out Reset (BOR) with
software control option
The PIC16F887 Basic Features
6
The PIC16F887 Basic Features
•A/D converter:
• 14-channels
• 10-bit resolution
•3 independent timers/counters
•Watch-dog timer
•Analogue comparator module with
• Two analogue comparators
• Fixed voltage reference (0.6V)
• Programmable on-chip voltage reference
•PWM output steering control
•Enhanced USART module
• Supports RS-485, RS-232 and LIN2.0
• Auto-Baud Detect
•Master Synchronous Serial Port (MSSP)
• supports SPI and I2C mode
7
PIC16 Internal Components
8
PIC16 Instructions Set
PIC16 Internal Components
CPU
v RISC gives the PIC16F887 two great advantages: The CPU
only recognizes 35 simple instructions.
v Just to mention that in order to program other
microcontrollers in assembly language it is necessary to
know more than 200 instructions by heart.
v The execution time is the same for almost all instructions,
and lasts for 2 clock cycles.
v The oscillator frequency is stabilized by a quartz crystal.
v The execution time of jump and branch instructions is 2 clock
cycles.
v It means that if the microcontroller’s operating speed is
20MHz, the execution time of each instruction will be 200nS,
i.e. the program will execute 5 million instructions per
second!
1
0
PIC16 Internal Components
Control Unit: Program Memory
v Microcontrollers used for prototyping and short production
runs use flash memory to store the program.
v The PIC 16 program consists of a list of 14-bit binary codes, each
containing the instruction and operand (data) in one operation
code.
v The program starts at address zero and the instructions are
executed in turn unless a branch instruction or an external ‘interrupt’
occurs.
v Usually, the last instruction causes a loop back to repeat the control
sequence.
v The capacity of the program memory block is one of the most
significant features of each PIC, varying from 1024 to 8096
instructions in the 16 series.
1
1
PIC16 Internal Components
Control Unit:
1
2
PIC16 Internal Components
Control Unit:
1
3
PIC16 Internal Components
1
4
PIC16 Internal Components
Control Unit:
Program Counter
14
PIC16 Internal Components
1
6
PIC16 Internal Components
1
7
PIC16 Internal Components
1
9
PIC16 Internal Components
2
0
PIC16 Internal Components
ALU
PIC16 Internal Components
ALU
21
PIC16 Internal Components
ALU
22
PIC16 Internal Components
ALU
24
2
5
PIC16 Internal Components
ALU
2
6
PIC16 Internal Components
ALU
26
PIC16 Internal Components
ALU
27
PIC16 Internal Components
ALU: STATUS REGISTER
28
PIC16 Internal Components
ALU: STATUS REGISTER 29
PIC16 Internal Components
Program memory
v Program memory contains the
programs that are written by the user.
v The program counter (PC) executes
these stored commands one by one.
v Usually PIC16 devices have a 13 bit
wide program counter that is capable
of addressing 8K× 14 bit program
memory space.
v This memory is primarily used for
storing the programs that are written
(burned) to be used by the PIC.
3
1
PIC16 Internal Components
3
4
Pinout description
3
6
Pinout description
3
7
Pinout description
3
8
Pinout description
3
9
Pinout description
Thank you
www.ump.edu.my 40