Vous êtes sur la page 1sur 4

t-inhx8m

h"4

flP1M1;"1.1,,FR1.1N.
NC's

PW;i4

ECM 01

EQU ;Registre du timer = Olh


OC
;Compteur
Flour OD
;Compteur
EON 03FF

;Veteur de remise a zero pour PIC 84

EON OBH

EQu 01H

EQU 01

SON 089

ORG 00

GOTO INIT ;Aller S INIT

;La Routine de reponse de l'interruption

rill' ORG 04

MOVF PORTA,0 ;Port_A en sortie

XORLW 01 ;Complemente le bit inherent au ronfleur


MOVWF PORTA ;Sortie sur le port A

MOVLW SON

MOVWF TMRO ;Charger le timer avec la constante SON

BCF INTCON,2 ;Interruption produite par la fin de comptage de

TMRO

BSF INTCON,7 ;Validation globale de interruption

RETFIE ;Retourner

;Initialisation

WIT BSF STATUS,5

BCF OPT,5 ;Modalite temporisateur

BCF OPT,3 ;Prescaler du timer

BsF OPT,0

BsF OPT,1

OPT,2 ;Prescaler divise par 16


BcF

BCF STATUS,5

INTCON,5 ;Validation du timer pour


BSF

isinterruption
MOVIM SON la constante

; Configurer le timer en chargeant


MOVWF TMRO

son
140V LW 00
• Configurer le port b
TRIO PORTB

MOVLW 018H
; Configurer le port A
TRIO PORTA
;Validation de l'interruption
BSF INTCON,7

Le Prouramme principal

NOP
MAIN

NOP

GOTO MAIN

Vous aimerez peut-être aussi