Documente Academic
Documente Profesional
Documente Cultură
1. Base-Line
2. Mide-Line Identification d’un PIC:
3. High-End
Type
Mémoire pro
F: Flash
C: EPROM ou EEPROM
CR: PROM
Brochage du circuit
RA1
RA2 1 18
RA0
RA3 2 17
OSC1/CLKIN
RA4/ T0CKI 3 16
OSC2/CLKOUT
PIC 16 F 84
MCLR 4 15
VDD
VSS 5 14
Registre 3
1
2 Compteur Mémoire
Mémoire programme RAM
Programme
5
4
6 Registre
Pointeur de pile 8 7
Registre d’instructions 9
Système d’horloge
Organisation de la mémoires programme
Organisation de la mémoire de données et le registres SFR
Jeu d’instructions
1. L’instruction « MOVLW » syntaxe MOVLW k ≈ w←k=0x25
25
W 0 0 1 0 0 1 0 1
2. L’instruction « MOVF » syntaxe MOVF f, d ≈ (f)→d
Si f =25 avec l’adresse 0x10
Emplacement f
Début
movlw 0x12; commentaire
movwf registre;……….
goto début
5. L’instruction « INCF » syntaxe INC f , d ≈ (f) +1→d
Si f= 0x10
00 00 00 11 00 00 00 10
+1
0 0 0 1
0 0
1 0
1 0
1 0
1
-1
7. L’instruction « ADDLW » syntaxe ADDLW val ≈ (w)+val→w
Reg W 0 0 0 1 0 0 0 0
ADDLW
val 0 0 0 0 0 0 1 1
0 0 0 1 0 0 1 1
8. L’instruction « ADDWF» syntaxe ADDWF f , d ≈ (w)+(f)→d
Si w=0x10 et si f = 0x3
Reg W 0 0 0 1 0 0 0 0
ADDWF
F adr 0x15 0 0 0 0 0 0 1 1
d 0 0 0 1 0 0 1 1
9. L’instruction « SUBLW» syntaxe SUBLW val ≈ val-(w)→w
val 0 0 0 1 0 0 0 0
SUBLW
Reg W 0 0 0 0 0 0 1 1
Reg W 0 0 0 0 1 1 0 1
10.L’instruction « SUBWF» syntaxe SUBWF f , d ≈ (f )– (w)→d
Emplacement f 0 0 0 1 0 0 0 0
SUBWF
Reg W 0 0 0 0 0 0 1 1
d 0 0 0 0 1 1 0 1
11.L’instruction « ANDLW» syntaxe ANDLW val ≈ (w) & val→w
Re W 0 0 0 1 0 0 0 0
ANDLW
val 0 0 0 0 0 0 1 1
W 0 0 0 1 0 0 1 1
12.L’instruction « ANDWF» syntaxe ANDWF f , d ≈ (w) and (f)→d
Si w=0x3 et si f = 0x10
Re W 0 0 0 1 0 0 0 0
ANDWF
Emplacement f 0 0 0 0 0 0 1 1
d 0 0 0 1 0 0 1 1
13.L’instruction « IORLW» syntaxe IORLW val ≈ (w) OR val→W
val 0 0 0 1 0 1 0 0
IORLW
Reg W 0 0 0 0 0 1 1 1
w 0 0 0 1 0 1 1 1
14.L’instruction « IORWF» syntaxe IORWF f , d ≈ (w) OR (f)→d
Si w=0x7 et si f= 0x14
Emplacement f 0 0 0 1 0 1 0 0
IORWF
Reg W 0 0 0 0 0 1 1 1
d 0 0 0 1 0 1 1 1
15.L’instruction « XORLW» syntaxe XORLW val ≈ (w) XOR val→w
val 0 0 0 1 0 1 0 0
XORLW
Reg W 0 1 0 0 0 1 1 1
w 0 1 0 1 0 0 0 0
16.L’instruction « XORWF» syntaxe XORWF f , d ≈ (w) XOR (f)→d
Si w=0x47 et si f= 0x14
Emplacement f 0 0 0 1 0 1 0 0
XORWF
Reg W 0 1 0 0 0 1 1 1
d 0 1 0 1 0 0 1 0
17.L’instruction « BSF» syntaxe BSF f , bm ≈ bn …. bm ….b0
Reg f
(1)
D0
0101100
ULN2003
En vue de la commande d’un M P à P
D0
0101100
ULN2003