SlideShare ist ein Scribd-Unternehmen logo
1 von 33
Notes de cours sur le microcontrôleur PIC16F84 BADR DIDOUH FSTF
PLAN ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
  I.   FAMILLE PIC DE MICROCHIP   Introduction ,[object Object],[object Object],[object Object]
Les différents familles des PICs ,[object Object],[object Object],[object Object],[object Object]
Identification d’une PIC ,[object Object],Catégorie du PIC: PIC Mid-Range Indique une mémoire de type Flash Identification du PIC fréquence d’horloge maximale  (4 Mhz) Le PIC existe aussi en deux versions:  PIC16F 84 : pour une utilisation dans une gamme d'alimentation classique (4.5 à 5.5V).  PIC16LF84: pour une gamme étendue de l'alimentation (2 à 6V).
II. ORGANISATION DU 16F84 Description Générale ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Structure externe ,[object Object],PIN 1: 3ème bit du PORTA PIN 2: 4ème bit du PORTA PIN 3: 5ème bit du PORTA / TOCK PIN 4: RESET  PIN 5: GND PIN 6: 1er bit du PORTB PIN 7: 2ème bit du PORTB PIN 8: 3ème bit du PORTB PIN 9: 4ème bit du PORTB PIN 18: 2ème bit du PORTA PIN 17: 1er bit du PORTA PIN 16:  OSCILLATEUR PIN15:  OSCILLATEUR 2 PIN 14: VCC PIN 13: 8ème bit du PORTB PIN 12: 7ème bit du PORTB PIN 11: 6ème bit du PORTB PIN 10: 5ème bit du PORTB
Structure interne
Organisation de la mémoire ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
la mémoire programme ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
la mémoire RAM ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Time out:débordement du timer DWT Power Down: caractérise l’activité du chien du garde Carry: retenue sur un octet Digit carry: retenue sur un quartet Zéro: résultat nul pour une opération ALU
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
III. LE JEU D’INSTRUCTIONS Mnémoniques ADDWF  f,d ANDWF  f,d CLRF  f CLRW COMF  f,d DECF  f,d DECFSZ  f,d INCF  f,d INCFSZ  f,d IORWF  f,d MOVF  f,d MOVWF  f NOP RLF  f,d RRF  f,d SUBWF  f,d SWAPF  f,d XORWF  f,d Descriptions Additionne W et f AND de W avec f Efface f Efface W Effectue le Complément de f Décrémente f Décrémente f, passe si 0 Incrémente f Incrémente f, passe si 0 OR Inclusif de W avec f Déplace f Déplace W dans f Pas d´opération (No Opération) Rotation gauche à travers la Retenue (Carry) Rotation droite à travers la Retenue (Carry) Soustrait W de f Bascule f sur lui même XOR de W avec f
Opérations sur les Bit Mnémoniques BCF  f,b BSF  f,b BTFSC  f,b BTFSS  f,b Descriptions Met à 0 le bit b de f Met à 1 le bit b de f Test le bit b de f, passe si à 0 Test le bit b de f, passe si à 1 Opérations Littérales et de Contrôles   Mnémoniques ANDLW  k CALL  k CLRWDT  k GOTO  k IORLW  k MOVLW  k OPTION  k RETLW  k SLEEP TRIS  f XORLW  k Descriptions AND d´un Littéral avec W Appel d´une sous-fonction Efface le 'Watchdog Timer' Branchement inconditionnel OR Inclusif d´un Littéral avec W Place un Littéral dans W Charge le registre OPTION Retourne au programme principal, place un Littéral dans W Se met en mode Stand by Charge le registre TRIS XOR d´un Littéral avec/vers W
IV. LES MODES D’ADRESSAGE ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
V. LES INTERRUPTIONS SUR LES PICs ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
VI. FORME GENERALE D’UN PROGRAMME ,[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Configuration du PIC
Structure d’un programme avec interruption ,[object Object],[object Object],[object Object],[object Object],[object Object]
VII. EXEMPLES D’APPLICATIONS
Exemple1: clignotement d'une LED à l'aide du chien de garde.   list p=16f84,f=inhx8m __config  B'11111111110111'  #include "p16f84.inc"     bsf   STATUS,RP0   movlw   B'00001101'   movwf   OPTION_REG   movlw   B'11111110'   movwf   TRISB   bcf   STATUS,RP0 Boucle   sleep   comf   PORTB,1   goto   Boucle   end
Exemple2: clignotement d'une LED en créant des retards dans le PIC. p=16f84,f=inhx8m  __config  B'11111111110001'  #include "p16f84a.inc"  temp1   equ   H'0C‘ temp2   equ   H'0D'    bsf  STATUS,RP0   movlw   B'11111110'   movwf   TRISB   bcf   STATUS,RP0    clrf   temp1   Debut  movlw   D'244'   movwf  temp2   Boucle  nop   decfsz   temp1,1   goto   Boucle     ,[object Object],[object Object],[object Object],[object Object],[object Object]
Exemple3: clignotement d'une LED à l’aide des interruptions du TIMER 0. p=16f84,f=inhx8m  __config  B'11111111110001'  #include "p16f84a.inc"  temps   equ  H'0C'   org  H'00'   goto  Debut   org  H'04'   movlw  D'012'   movwf  TMR0   bcf  INTCON,T0IF   decfsz  temps,1   retfie  comf  PORTB,1   movlw  D'008'   movwf  temps   retfie  Debut   bsf  STATUS,RP0   movlw  B'10000111'   movwf  OPTION_REG   bcf  TRISB,0   bcf  STATUS,RP0   movlw  D'008'   movwf  temps   movlw  B'10100000'   movwf  INTCON   Boucle   goto  Boucle   end
Exemple3: Lecture et écriture dans la mémoire EEPROM du PIC.
list p=16f84,f=inhx8m __config B'11111111110001' include "p16f84.inc"  bsf  STATUS,RP0   movlw  B'11100000'  movwf  TRISA   bcf  OPTION_REG,7   bcf  STATUS,RP0   clrf  PORTA   clrf  EEADR  Boucle   btfss  PORTB,6   call  Enregistre   btfss  PORTB,7   call  Lit   goto  Boucle Enregistre   btfss  PORTB,6   goto  Enregistre   comf  PORTB,0   movwf  EEDATA   movwf  PORTA  call  Ecriture   incf  EEADR,1   return  Lit   btfss  PORTB,7   goto  Lit   call  Lecture  movf  EEDATA,0   movwf  PORTA  incf  EEADR,1   return
;Écriture EEPROM   Ecriture  bsf  STATUS,RP0   clrf  EECON1   bsf  EECON1,WREN   movlw  H'55'   movwf  EECON2   movlw  H'AA'   movwf  EECON2   bsf  EECON1,WR   EcritureFin   btfsc EECON1,WR  goto  EcritureFin   bcf  STATUS,RP0   Return ; Lecture EEPROM Lecture   bsf  STATUS,RP0   bsf  EECON1,RD  bcf  STATUS,RP0   return  ;Écriture des données dans la mémoire EEPROM du ;PIC à l'aide du programmateur   org  H'2100'   de  B'00000001',B'00000010',B'00000100',B'00001000'  de  B'00010000',B'00010000',B'00001000',B'00000100'  de  B'00000010',B'00000001',B'00000000'   end
FIN

Weitere ähnliche Inhalte

Was ist angesagt?

Exercices vhdl
Exercices vhdlExercices vhdl
Exercices vhdlyassinesmz
 
presentation pic 16f84.ppt
presentation pic 16f84.pptpresentation pic 16f84.ppt
presentation pic 16f84.pptsaidmahfoud2
 
Microo exercices 16f877/877A
Microo exercices 16f877/877AMicroo exercices 16f877/877A
Microo exercices 16f877/877Aomar bllaouhamou
 
Examens électronique analogique
Examens électronique analogiqueExamens électronique analogique
Examens électronique analogiqueSalah-Eddine MAAFI
 
Systeme embarque td1
Systeme embarque td1Systeme embarque td1
Systeme embarque td1SinGuy
 
presentation serrure codee
presentation serrure codeepresentation serrure codee
presentation serrure codeeMohammedFassih
 
STM32 F4 (PWM,SPI And ADC Test Examples)
STM32 F4 (PWM,SPI And ADC Test Examples)STM32 F4 (PWM,SPI And ADC Test Examples)
STM32 F4 (PWM,SPI And ADC Test Examples)Aymen Lachkhem
 
Fstm deust mip-e141_cee_chap_v_les filtres passifs
Fstm deust mip-e141_cee_chap_v_les filtres passifsFstm deust mip-e141_cee_chap_v_les filtres passifs
Fstm deust mip-e141_cee_chap_v_les filtres passifsabdennaceur_baghdad
 
Automates programmables industriels
Automates programmables industrielsAutomates programmables industriels
Automates programmables industrielsHafsaELMessaoudi
 
تمارين وحلول خاصة ببرمجة Ladder et instructions automates
تمارين وحلول خاصة ببرمجة Ladder et instructions automatesتمارين وحلول خاصة ببرمجة Ladder et instructions automates
تمارين وحلول خاصة ببرمجة Ladder et instructions automateselectrolouhla
 
Les circuits combinatoires
Les circuits combinatoires Les circuits combinatoires
Les circuits combinatoires wafawafa52
 
ELE2611 Classe 3 - Filtres analogiques linéaires I
ELE2611 Classe 3 - Filtres analogiques linéaires IELE2611 Classe 3 - Filtres analogiques linéaires I
ELE2611 Classe 3 - Filtres analogiques linéaires IJerome LE NY
 
correction examen rattrapage 2012 transmission numérique
correction examen rattrapage 2012 transmission numérique correction examen rattrapage 2012 transmission numérique
correction examen rattrapage 2012 transmission numérique omar bllaouhamou
 
Chapitre ii circuits combinatoires
Chapitre ii circuits combinatoiresChapitre ii circuits combinatoires
Chapitre ii circuits combinatoiresSana Aroussi
 

Was ist angesagt? (20)

Exercices vhdl
Exercices vhdlExercices vhdl
Exercices vhdl
 
Pic 16 f84
Pic 16 f84Pic 16 f84
Pic 16 f84
 
presentation pic 16f84.ppt
presentation pic 16f84.pptpresentation pic 16f84.ppt
presentation pic 16f84.ppt
 
Microo exercices 16f877/877A
Microo exercices 16f877/877AMicroo exercices 16f877/877A
Microo exercices 16f877/877A
 
Examens électronique analogique
Examens électronique analogiqueExamens électronique analogique
Examens électronique analogique
 
Systeme embarque td1
Systeme embarque td1Systeme embarque td1
Systeme embarque td1
 
presentation serrure codee
presentation serrure codeepresentation serrure codee
presentation serrure codee
 
Microcontroleurs
MicrocontroleursMicrocontroleurs
Microcontroleurs
 
Formation stm32
Formation stm32Formation stm32
Formation stm32
 
présentation STM32
présentation STM32présentation STM32
présentation STM32
 
STM32 F4 (PWM,SPI And ADC Test Examples)
STM32 F4 (PWM,SPI And ADC Test Examples)STM32 F4 (PWM,SPI And ADC Test Examples)
STM32 F4 (PWM,SPI And ADC Test Examples)
 
Fstm deust mip-e141_cee_chap_v_les filtres passifs
Fstm deust mip-e141_cee_chap_v_les filtres passifsFstm deust mip-e141_cee_chap_v_les filtres passifs
Fstm deust mip-e141_cee_chap_v_les filtres passifs
 
Ch6 pal fpla
Ch6 pal fplaCh6 pal fpla
Ch6 pal fpla
 
Exercices onduleur
Exercices onduleurExercices onduleur
Exercices onduleur
 
Automates programmables industriels
Automates programmables industrielsAutomates programmables industriels
Automates programmables industriels
 
تمارين وحلول خاصة ببرمجة Ladder et instructions automates
تمارين وحلول خاصة ببرمجة Ladder et instructions automatesتمارين وحلول خاصة ببرمجة Ladder et instructions automates
تمارين وحلول خاصة ببرمجة Ladder et instructions automates
 
Les circuits combinatoires
Les circuits combinatoires Les circuits combinatoires
Les circuits combinatoires
 
ELE2611 Classe 3 - Filtres analogiques linéaires I
ELE2611 Classe 3 - Filtres analogiques linéaires IELE2611 Classe 3 - Filtres analogiques linéaires I
ELE2611 Classe 3 - Filtres analogiques linéaires I
 
correction examen rattrapage 2012 transmission numérique
correction examen rattrapage 2012 transmission numérique correction examen rattrapage 2012 transmission numérique
correction examen rattrapage 2012 transmission numérique
 
Chapitre ii circuits combinatoires
Chapitre ii circuits combinatoiresChapitre ii circuits combinatoires
Chapitre ii circuits combinatoires
 

Andere mochten auch

Micocontroleur16 fxxx (1)
Micocontroleur16 fxxx (1)Micocontroleur16 fxxx (1)
Micocontroleur16 fxxx (1)Karim Touati
 
Programmation des pic_en_c_part1
Programmation des pic_en_c_part1Programmation des pic_en_c_part1
Programmation des pic_en_c_part1oussamada
 
Microcontrôleur PIC Microchip part2/2
Microcontrôleur PIC Microchip part2/2Microcontrôleur PIC Microchip part2/2
Microcontrôleur PIC Microchip part2/2Mohammed Lamghari
 
Le grafcet cours & exercices corrigés
Le grafcet cours & exercices corrigésLe grafcet cours & exercices corrigés
Le grafcet cours & exercices corrigéstoumed
 
Programmation des pic_en_c_part2
Programmation des pic_en_c_part2Programmation des pic_en_c_part2
Programmation des pic_en_c_part2oussamada
 
Chp4 introduction to the pic microcontroller copy
Chp4 introduction to the pic microcontroller   copyChp4 introduction to the pic microcontroller   copy
Chp4 introduction to the pic microcontroller copymkazree
 
Api cours
Api coursApi cours
Api coursBel Ami
 
Ds.2 a.sc.avec corrigé (tm)
Ds.2 a.sc.avec corrigé (tm)Ds.2 a.sc.avec corrigé (tm)
Ds.2 a.sc.avec corrigé (tm)Mohamed Trabelsi
 
Supervision industrielle www.automate pro.blogspot.com
Supervision industrielle www.automate pro.blogspot.comSupervision industrielle www.automate pro.blogspot.com
Supervision industrielle www.automate pro.blogspot.comAdnane Ahmidani
 
Cours microcontroleur 8051 v1.1
Cours microcontroleur 8051 v1.1Cours microcontroleur 8051 v1.1
Cours microcontroleur 8051 v1.1Jack Ilboudo
 
Management of Learner Support Centres in Open and Distance Education
Management of Learner Support Centres in Open and Distance EducationManagement of Learner Support Centres in Open and Distance Education
Management of Learner Support Centres in Open and Distance EducationRamesh C. Sharma
 
Programming pic microcontrollers
Programming pic microcontrollersProgramming pic microcontrollers
Programming pic microcontrollersMAIYO JOSPHAT
 
Conception avec pic
Conception avec pic Conception avec pic
Conception avec pic nawzat
 
Ch2 microcontroller architecture
Ch2 microcontroller architectureCh2 microcontroller architecture
Ch2 microcontroller architectureAhmad Sidik
 
Introduction of microcontroller
Introduction of microcontrollerIntroduction of microcontroller
Introduction of microcontrollerEngineer Maze
 

Andere mochten auch (20)

Pic16f84
Pic16f84Pic16f84
Pic16f84
 
Micocontroleur16 fxxx (1)
Micocontroleur16 fxxx (1)Micocontroleur16 fxxx (1)
Micocontroleur16 fxxx (1)
 
Programmation des pic_en_c_part1
Programmation des pic_en_c_part1Programmation des pic_en_c_part1
Programmation des pic_en_c_part1
 
Microcontrôleur PIC Microchip part2/2
Microcontrôleur PIC Microchip part2/2Microcontrôleur PIC Microchip part2/2
Microcontrôleur PIC Microchip part2/2
 
Le grafcet cours & exercices corrigés
Le grafcet cours & exercices corrigésLe grafcet cours & exercices corrigés
Le grafcet cours & exercices corrigés
 
Programmation des pic_en_c_part2
Programmation des pic_en_c_part2Programmation des pic_en_c_part2
Programmation des pic_en_c_part2
 
La prise de terre
La prise de terreLa prise de terre
La prise de terre
 
Chp4 introduction to the pic microcontroller copy
Chp4 introduction to the pic microcontroller   copyChp4 introduction to the pic microcontroller   copy
Chp4 introduction to the pic microcontroller copy
 
Api cours
Api coursApi cours
Api cours
 
Les systèmes automatisés
Les systèmes automatisésLes systèmes automatisés
Les systèmes automatisés
 
Microcontroleur
MicrocontroleurMicrocontroleur
Microcontroleur
 
Ds.2 a.sc.avec corrigé (tm)
Ds.2 a.sc.avec corrigé (tm)Ds.2 a.sc.avec corrigé (tm)
Ds.2 a.sc.avec corrigé (tm)
 
Le grafcet
Le grafcet Le grafcet
Le grafcet
 
Supervision industrielle www.automate pro.blogspot.com
Supervision industrielle www.automate pro.blogspot.comSupervision industrielle www.automate pro.blogspot.com
Supervision industrielle www.automate pro.blogspot.com
 
Cours microcontroleur 8051 v1.1
Cours microcontroleur 8051 v1.1Cours microcontroleur 8051 v1.1
Cours microcontroleur 8051 v1.1
 
Management of Learner Support Centres in Open and Distance Education
Management of Learner Support Centres in Open and Distance EducationManagement of Learner Support Centres in Open and Distance Education
Management of Learner Support Centres in Open and Distance Education
 
Programming pic microcontrollers
Programming pic microcontrollersProgramming pic microcontrollers
Programming pic microcontrollers
 
Conception avec pic
Conception avec pic Conception avec pic
Conception avec pic
 
Ch2 microcontroller architecture
Ch2 microcontroller architectureCh2 microcontroller architecture
Ch2 microcontroller architecture
 
Introduction of microcontroller
Introduction of microcontrollerIntroduction of microcontroller
Introduction of microcontroller
 

Ähnlich wie Microcontroleur Pic16 F84

Etude-Du-Microcontrleur-Pic16f84-160919133655
Etude-Du-Microcontrleur-Pic16f84-160919133655Etude-Du-Microcontrleur-Pic16f84-160919133655
Etude-Du-Microcontrleur-Pic16f84-160919133655Abdo Brahmi
 
pic16f84-200306072553.pdf
pic16f84-200306072553.pdfpic16f84-200306072553.pdf
pic16f84-200306072553.pdfAbdo Brahmi
 
Microcontroller/microcontroleur/pic.pptx
Microcontroller/microcontroleur/pic.pptxMicrocontroller/microcontroleur/pic.pptx
Microcontroller/microcontroleur/pic.pptxSABIR Hamza
 
Arduino cottenceau1112
Arduino cottenceau1112Arduino cottenceau1112
Arduino cottenceau1112Hafid Moujane
 
Projet boot loader avec le pic16f887_ppt
Projet boot loader avec le pic16f887_pptProjet boot loader avec le pic16f887_ppt
Projet boot loader avec le pic16f887_pptMouhcine Nid Belkacem
 
Exposé Le Microprocesseur
Exposé   Le MicroprocesseurExposé   Le Microprocesseur
Exposé Le MicroprocesseurTheCrazyMan
 
Cours de PIC Généralités.pdf
Cours de PIC Généralités.pdfCours de PIC Généralités.pdf
Cours de PIC Généralités.pdfAliRami3
 
Cours_SAM(M14).ppt
Cours_SAM(M14).pptCours_SAM(M14).ppt
Cours_SAM(M14).pptAbdo Brahmi
 
Cours_SAM(M14).ppt
Cours_SAM(M14).pptCours_SAM(M14).ppt
Cours_SAM(M14).pptAbdo Brahmi
 
FDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
FDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDFDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
FDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDmohamedsaidi212001
 
pres_chapter5 (5).pptx
pres_chapter5 (5).pptxpres_chapter5 (5).pptx
pres_chapter5 (5).pptxAbdo Brahmi
 
8. introduction a larchitecture arm
8. introduction a larchitecture arm8. introduction a larchitecture arm
8. introduction a larchitecture armAbdelwahab Wahib
 
Altera nios ii embedded evaluation kit
Altera nios ii embedded evaluation kitAltera nios ii embedded evaluation kit
Altera nios ii embedded evaluation kitWassim Smati
 
Altera nios ii embedded evaluation kit
Altera nios ii embedded evaluation kitAltera nios ii embedded evaluation kit
Altera nios ii embedded evaluation kitWassim Smati
 

Ähnlich wie Microcontroleur Pic16 F84 (20)

Etude-Du-Microcontrleur-Pic16f84-160919133655
Etude-Du-Microcontrleur-Pic16f84-160919133655Etude-Du-Microcontrleur-Pic16f84-160919133655
Etude-Du-Microcontrleur-Pic16f84-160919133655
 
pic16f84-200306072553.pdf
pic16f84-200306072553.pdfpic16f84-200306072553.pdf
pic16f84-200306072553.pdf
 
le-pic-16f84.pdf
le-pic-16f84.pdfle-pic-16f84.pdf
le-pic-16f84.pdf
 
Microcontroller/microcontroleur/pic.pptx
Microcontroller/microcontroleur/pic.pptxMicrocontroller/microcontroleur/pic.pptx
Microcontroller/microcontroleur/pic.pptx
 
Arduino cottenceau1112
Arduino cottenceau1112Arduino cottenceau1112
Arduino cottenceau1112
 
prog_reg.pptx
prog_reg.pptxprog_reg.pptx
prog_reg.pptx
 
Projet boot loader avec le pic16f887_ppt
Projet boot loader avec le pic16f887_pptProjet boot loader avec le pic16f887_ppt
Projet boot loader avec le pic16f887_ppt
 
Exposé Le Microprocesseur
Exposé   Le MicroprocesseurExposé   Le Microprocesseur
Exposé Le Microprocesseur
 
Cours de PIC Généralités.pdf
Cours de PIC Généralités.pdfCours de PIC Généralités.pdf
Cours de PIC Généralités.pdf
 
µP
µPµP
µP
 
Cours_SAM(M14).ppt
Cours_SAM(M14).pptCours_SAM(M14).ppt
Cours_SAM(M14).ppt
 
Cours_SAM(M14).ppt
Cours_SAM(M14).pptCours_SAM(M14).ppt
Cours_SAM(M14).ppt
 
Tp bus i2_c
Tp bus i2_cTp bus i2_c
Tp bus i2_c
 
FDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
FDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDFDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
FDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
 
pres_chapter5 (5).pptx
pres_chapter5 (5).pptxpres_chapter5 (5).pptx
pres_chapter5 (5).pptx
 
8. introduction a larchitecture arm
8. introduction a larchitecture arm8. introduction a larchitecture arm
8. introduction a larchitecture arm
 
Tp bus i2_c_partie_2
Tp bus i2_c_partie_2Tp bus i2_c_partie_2
Tp bus i2_c_partie_2
 
Mini projet 3t2i se
Mini projet 3t2i seMini projet 3t2i se
Mini projet 3t2i se
 
Altera nios ii embedded evaluation kit
Altera nios ii embedded evaluation kitAltera nios ii embedded evaluation kit
Altera nios ii embedded evaluation kit
 
Altera nios ii embedded evaluation kit
Altera nios ii embedded evaluation kitAltera nios ii embedded evaluation kit
Altera nios ii embedded evaluation kit
 

Microcontroleur Pic16 F84

  • 1. Notes de cours sur le microcontrôleur PIC16F84 BADR DIDOUH FSTF
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17. III. LE JEU D’INSTRUCTIONS Mnémoniques ADDWF f,d ANDWF f,d CLRF f CLRW COMF f,d DECF f,d DECFSZ f,d INCF f,d INCFSZ f,d IORWF f,d MOVF f,d MOVWF f NOP RLF f,d RRF f,d SUBWF f,d SWAPF f,d XORWF f,d Descriptions Additionne W et f AND de W avec f Efface f Efface W Effectue le Complément de f Décrémente f Décrémente f, passe si 0 Incrémente f Incrémente f, passe si 0 OR Inclusif de W avec f Déplace f Déplace W dans f Pas d´opération (No Opération) Rotation gauche à travers la Retenue (Carry) Rotation droite à travers la Retenue (Carry) Soustrait W de f Bascule f sur lui même XOR de W avec f
  • 18. Opérations sur les Bit Mnémoniques BCF f,b BSF f,b BTFSC f,b BTFSS f,b Descriptions Met à 0 le bit b de f Met à 1 le bit b de f Test le bit b de f, passe si à 0 Test le bit b de f, passe si à 1 Opérations Littérales et de Contrôles Mnémoniques ANDLW k CALL k CLRWDT k GOTO k IORLW k MOVLW k OPTION k RETLW k SLEEP TRIS f XORLW k Descriptions AND d´un Littéral avec W Appel d´une sous-fonction Efface le 'Watchdog Timer' Branchement inconditionnel OR Inclusif d´un Littéral avec W Place un Littéral dans W Charge le registre OPTION Retourne au programme principal, place un Littéral dans W Se met en mode Stand by Charge le registre TRIS XOR d´un Littéral avec/vers W
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 27. Exemple1: clignotement d'une LED à l'aide du chien de garde. list p=16f84,f=inhx8m __config B'11111111110111' #include "p16f84.inc" bsf STATUS,RP0 movlw B'00001101' movwf OPTION_REG movlw B'11111110' movwf TRISB bcf STATUS,RP0 Boucle sleep comf PORTB,1 goto Boucle end
  • 28.
  • 29. Exemple3: clignotement d'une LED à l’aide des interruptions du TIMER 0. p=16f84,f=inhx8m __config B'11111111110001' #include "p16f84a.inc"  temps equ H'0C' org H'00' goto Debut org H'04' movlw D'012' movwf TMR0 bcf INTCON,T0IF decfsz temps,1 retfie comf PORTB,1 movlw D'008' movwf temps retfie Debut bsf STATUS,RP0 movlw B'10000111' movwf OPTION_REG bcf TRISB,0 bcf STATUS,RP0 movlw D'008' movwf temps movlw B'10100000' movwf INTCON Boucle goto Boucle end
  • 30. Exemple3: Lecture et écriture dans la mémoire EEPROM du PIC.
  • 31. list p=16f84,f=inhx8m __config B'11111111110001' include "p16f84.inc" bsf STATUS,RP0 movlw B'11100000' movwf TRISA bcf OPTION_REG,7 bcf STATUS,RP0 clrf PORTA clrf EEADR Boucle btfss PORTB,6 call Enregistre btfss PORTB,7 call Lit goto Boucle Enregistre btfss PORTB,6 goto Enregistre comf PORTB,0 movwf EEDATA movwf PORTA call Ecriture incf EEADR,1 return Lit btfss PORTB,7 goto Lit call Lecture movf EEDATA,0 movwf PORTA incf EEADR,1 return
  • 32. ;Écriture EEPROM Ecriture bsf STATUS,RP0 clrf EECON1 bsf EECON1,WREN movlw H'55' movwf EECON2 movlw H'AA' movwf EECON2 bsf EECON1,WR EcritureFin btfsc EECON1,WR goto EcritureFin bcf STATUS,RP0 Return ; Lecture EEPROM Lecture bsf STATUS,RP0 bsf EECON1,RD bcf STATUS,RP0 return ;Écriture des données dans la mémoire EEPROM du ;PIC à l'aide du programmateur org H'2100' de B'00000001',B'00000010',B'00000100',B'00001000' de B'00010000',B'00010000',B'00001000',B'00000100' de B'00000010',B'00000001',B'00000000' end
  • 33. FIN