Вы находитесь на странице: 1из 21

Chapitre 3 Architecture logicielle du PIC 16F84

EXERCICE 3.2
Expliquer le schéma de la figure suivante :
Programme
principal

INST 1 Soubroutine
INST 2 Label : INST 1’
INST 3 PC INST 2’
… INST 3’
13
PC CALL Label ; …
13 13
@ INST n+1 @ …
INST n+2 PC …..
RETURN ;

13
@ INST n+1

12 PILE (LIFO) 0

 Définir une interruption ?


 D'un point de vue logiciel, que fait généralement un microcontrôleur lorsqu'il détecte un
signal ‘evenement’ ?
 Pourquoi un microcontrôleur se sert-il de la PILE lorsqu'une interruption se produit
Systèmes à Microcontrôleurs

provenant d'un périphérique externe ?


 Combien de sources différentes peuvent interrompre le PIC 16F84 ?
 Etudier le processus d’exécution d’une interruption dans le cas du PIC 16F84. Discuter…
 EXERCICE 3.3
Expliquer avec des exemples les modes d’adressage offerts par le PIC 16F84.
Commenter…

Dr. A. SOUKKOU 104


Chapitre 3 Architecture logicielle du PIC 16F84

EXERCICE 3.4
Répondres aux questions suivantes
suivantes:
1. What does the word "literal" mean?
A number
A value such as 0C3h
A hexadecimal value
A number loaded into W
2. Write the instruction to put 4Ch into W:
MOVWF 4Ch;
4Ch
MOVLW 4Ch;
4Ch
MOLVW 4Ch;
4Ch
MOVWL 4Ch;
4Ch
3. Write the instruction to move 4Ch from W to file 1B:
MOVLW 1Bh;
1Bh
Systèmes à Microcontrôleurs

MOLVW 4Ch, 1;
MOVLW 4Ch;
4Ch
MOVWF 1Bh;
1Bh
4. Write the instruction to move 4Ch from file 1B to W:
MOVF 1Bh, 0;
MOVWF 4Ch, 1;

Dr. A. SOUKKOU 105


Chapitre 3 Architecture logicielle du PIC 16F84

MOVWF 1Bh, 1;
MOVF 1B, 1;
5. Write the instruction to clear the value 4Ch in file 1B:
CLRF 4Ch;
CLRF 1Bh, 0;
CLRF 4Ch, 0;
CLRF 1Bh;
6. Write the instruction to move 4Ch from file 1A to file 1B:
MOVF 1B, 1;
MOVF 1C, 0;
MOVWF 1B, 1;
no instruction exists;
7. Write the instruction to decrement file 1B:
DECFSZ 1B, 0;
DECF 1B, 0;
DECFSZ 1B, 1;
DECF 1B, 1;
8. After the instruction: BCF 06,3 the file will contain:
0101 0000;
1111 1010;
1111 1000;
1010 1010;
9. The TRIS file is loaded with 0011 1011. Name the output line(s) created by this value.
RB0, RB1, RB3, RB4, RB5
RB1, RB2, RB4, RB5, RB6.
None of the above
10. A LED is connected to the 3rd lowest output. Write the instruction to activate the LED:
BSF 06, 3;
Systèmes à Microcontrôleurs

BSF 06, 2;
BSF 06, 4;
11. File 1B holds the value 0000 1100. After the following instruction: BSF 1B,6 the file will
contain:
0010 0011;
0010 1100;

Dr. A. SOUKKOU 106


Chapitre 3 Architecture logicielle du PIC 16F84

0100 1100;
0010 0000;
12. Write the instructions to make bit 3 of TRIS 06 an INPUT:
MOVLW 03; and MOVWF 06;
MOVLW 04; and MOVWF 06;
MOVLW 08; and MOVWF 06;
13. For any file, what is the maximum hex value it can contain?
128;
FF;
256h;
255h;
14. Write the instructions to make bit 3 of the input/output file HIGH:
MOVLW 03;
BSF 06, 3;
MOVWF 06;
MOVWF 06;
MOVLW 11;
15. What value will be contained in file 1B after the instruction: BSF 1B,4:
0000 1000;

0000 1111;
0000 0100;
Unknown;
16. Write the two instructions to carry out the following: Put 8E into file 1C
MOVWF 8Eh; and MOVWF 1Ch;
MOVLW 8Eh; and MOVWF 1Ch;
MOVLW 8Eh; and MOVLW 1Ch;
MOVWF 8Eh; and MOVLW 1Ch;
Systèmes à Microcontrôleurs

17. A file containing 0000 1001 is AND with 1100 1010. The result is:
0000 1001;
1000 1000;
0000 1000;
1100 1000;
18. Write the "bit set file" instruction for bit 5 of file 06:
BSF 05, 6;

Dr. A. SOUKKOU 107


Chapitre 3 Architecture logicielle du PIC 16F84

BSF 06, 5;
BSF 05;
BSF 06;
19. A file containing 0110 1001 is XORed with 1100 1001. The result is:
0110 1001;
1001 0110;
1010 0000;
0001 1111;
20. The result of BCF 1B, 3; is:
0000 0000;
1111 1100;
1111 1111;
None of the above;

Systèmes à Microcontrôleurs

Dr. A. SOUKKOU 108


CHAPITRE 4

Programmation assembleur du
PIC 16F84

Вам также может понравиться