Академический Документы
Профессиональный Документы
Культура Документы
PIC16F84 (18pin)
Standard Circuit
+5V +5V
20MHz +5V
18 17 16 15 14 13 12 11 10
L E D x10
10KΩ 10KΩ R R R R R R
A A B B B B
1 0 7 6 5 4
+5V +5V
PIC16F84
R R R R R R R
A A A B B B B
2 3 4 0 1 2 3
1 2 3 4 5 6 7 8 9
10KΩ
Inside PIC
Program
Address
Program データバス
Program
Memory Counter
(14bit) 13 8
Mux
I/O pins
I/O
Port
Control Unit
ALU
Reset W register
Inside PIC
Program
Address
Program データバス
Program
Memory Counter
(14bit) 13 8
Mux
I/O pins
I/O
Port
Control Unit
ALU
Reset W register
Input & Output Port
(PIC16F84)
RA4
RA3
RA2
RA1
5th File Register RA0
Input
PORTA b7 b6 b5 b4 b3 b2 b1 b0 or
I/O Port Output
(0 or 5V)
RB7
RB6
RB5
RB4
RB3
RB2
6th File Register RB1
RB0
PORTB b7 b6 b5 b4 b3 b2 b1 b0
I/O Port
Inside PIC
Program
Address
Program データバス
Program
Memory Counter
(14bit) 13 8
Mux
I/O pins
I/O
Port
Control Unit
ALU
Reset W register
oscillator & Clock
1 command is
Addr. Program Memory
executed by
4 clocks(1 sycle) 00 01010101010101
01 10101010101010
02 00110011001100
03 10100010100010
04 :
: :
: :
Control UNIT
Reset
How PIC works
Program Memory File Register
(Assemble Lang.) (addr. variable, contents)
0 MOVLW D'15' 00 INDF 00000000
01 TMR0 00000000
1 MOVWF hensu
02 PCL 00000000
2 MOVF PORTA, W 03 STATUS 00000000
04 FSR 00000000
3 ADDWF hensu, W
05 PORTA 00000000
4 MOVWF PORTB 06 PORTB 00000000
: : :
0C hensu 00000000
0D 00000000
ALU
00000000
W Regster
Program Memory
Action
Program
11000000001111
00000010001100
0 Addr.
1
Data Bus 8 0
0
00100000000101 2
00011100001100 3 Program
00000010000110 4 File Register
Counter
00000000
MUX
I/O Pins
ALU
I/O Port
00000000 W regster
Program Memory
Action
Program
11000000001111 0 Addr.
00000010001100 1
Data Bus 8 1
0
00100000000101 2
00011100001100 3 Program
00000010000110 4 File Register
Counter
00000000
MUX
I/O Pins
ALU
I/O Port
00000000 W regster
MOVLW D '15' Action
Program Memory
Program
11000000001111
00000010001100
0 Addr.
1
Data Bus 8 2
0
00100000000101 2
00011100001100 3 Program
00000010000110 4 File Register
Counter
00000000
MUX
I/O Pins
ALU
I/O Port
00000000 W regster
MOVLW D '15' Action
Program Memory
Program
11000000001111
00000010001100
0 Addr.
1
Data Bus 8 3
0
00100000000101 2
00011100001100 3 Program
00000010000110 4 File Register
Counter
00001111
MUX
I/O Pins
ALU
I/O Port
00001111 W regster
Program Memory
Action
Program
11000000001111
00000010001100
0 Addr.
1
Data Bus 8 4
1
00100000000101 2
00011100001100 3 Program
00000010000110 4 File Register
Counter
00001111
MUX
I/O Pins
ALU
I/O Port
00001111 W regster
MOVWF hensu Action
Program Memory
Program
11000000001111
00000010001100
0 Addr.
1
Data Bus 8 5
1
00100000000101 2
00011100001100 3 Program
00000010000110 4 File Register
Counter
00001111
MUX
I/O Pins
ALU
I/O Port
00001111 W regster
MOVWF hensu Action
Program Memory
Program
11000000001111
00000010001100
0 Addr.
1
Data Bus 8 6
1
00100000000101 2
00011100001100 3 Program
00000010000110 4 File Register
Counter
00001111
MUX
I/O Pins
ALU
I/O Port
00001111 W regster
Program Memory
Action
Program
11000000001111
00000010001100
0 Addr.
1
Data Bus 8 7
2
00100000000101 2
00011100001100 3 Program
00000010000110 4 File Register
Counter
00001111
MUX
I/O Pins
ALU
I/O Port
00001111 W regster
MOVF PORTA,W Action
Program Memory
Program
11000000001111
00000010001100
0 Addr.
1
Data Bus 8 8
2
00100000000101 2
00011100001100 3 Program
00000010000110 4 File Register
Counter
00001111
MUX
I/O Pins
ALU
I/O Port
00001111 W regster
MOVF PORTA,W Action
Program Memory
Program
11000000001111
00000010001100
0 Addr.
1
Data Bus 8 9
2
00100000000101 2
00011100001100 3 Program
00000010000110 4 File Register
Counter
00001111 PORTA
MUX
I/O Pins
ALU
I/O Port
00001111 W regster
MOVF PORTA,W Action
Program Memory
Program
11000000001111
00000010001100
0 Addr.
1
Data Bus 8 10
2
00100000000101 2
00011100001100 3 Program
00000010000110 4 File Register
Counter
00000001
MUX
I/O Pins
ALU
I/O Port
00000001 W regster
Program Memory
Action
Program
11000000001111
00000010001100
0 Addr.
1
Data Bus 8 11
3
00100000000101 2
00011100001100 3 Program
00000010000110 4 File Register
Counter
00000001
MUX
I/O Pins
ALU
I/O Port
00000001 W regster
ADDWF hensu,W Action
Program Memory
Program
11000000001111
00000010001100
0 Addr.
1
Data Bus 8 12
3
00100000000101 2
00011100001100 3 Program
00000010000110 4 File Register
Counter
00000001
MUX
I/O Pins
ALU
I/O Port
00000001 W regster
ADDWF hensu,W Action
Program Memory
Program
11000000001111
00000010001100
0 Addr.
1
Data Bus 8 13
3
00100000000101 2
00011100001100 3 Program
00000010000110 4 File Register
Counter
00001111
MUX
I/O Pins
ALU
I/O Port
00000001 W regster
ADDWF hensu,W Action
Program Memory
Program
11000000001111
00000010001100
0 Addr.
1
Data Bus 8 14
3
00100000000101 2
00011100001100 3 Program
00000010000110 4 File Register
Counter
00001111
00000001 MUX
I/O Pins
ALU
I/O Port
00010000 W regster
Program Memory
Action
Program
11000000001111
00000010001100
0 Addr.
1
Data Bus 8 15
4
00100000000101 2
00011100001100 3 Program
00000010000110 4 File Register
Counter
00001111
MUX
I/O Pins
ALU
I/O Port
00010000 W regster
MOVWF PORTB Action
Program Memory
Program
11000000001111
00000010001100
0 Addr.
1
Data Bus 8 16
4
00100000000101 2
00011100001100 3 Program
00000010000110 4 File Register
Counter
00001111
MUX
I/O Pins
ALU
I/O Port
00010000 W regster
MOVWF PORTB Action
Program Memory
Program
11000000001111
00000010001100
0 Addr.
1
Data Bus 8 17
4
00100000000101 2
00011100001100 3 Program
00000010000110 4 File Register
Counter
00001111
MUX
I/O Pins
ALU
I/O Port
00010000 W regster
MOVWF PORTB Action
Program Memory
Program
11000000001111
00000010001100
0 Addr.
1
Data Bus 8 18
4
00100000000101 2
00011100001100 3 Program
00000010000110 4 File Register
Counter
I/O Pins
00001111
MUX
ALU PORTB
I/O Port
00010000 W regster
Program Memory
Action
Program
11000000001111
00000010001100
0 Addr.
1
Data Bus 8 19
5
00100000000101 2
00011100001100 3 Program
00000010000110 4 ファイルレジスタ
File Register
Counter
00001111
MUX
I/O Pins
ALU
I/O Port
00010000 W regster
Summary
Program Memory File Register
(Assemble Lang.) (addr. variable, contents)
0 MOVLW D'15' 00 INDF 00000000
01 TMR0 00000000
1 MOVWF hensu
02 PCL 00000000
2 MOVF PORTA, W 03 STATUS 00000000
04 FSR 00000000
3 ADDWF hensu, W
05 PORTA 00000000
4 MOVWF PORTB 06 PORTB 00000000
: : :
0C hensu 00000000
0D 00000000
ALU
00000000
W Regster