Timer1
et sécurité réseaux.
.
Sommaire
Introduction
Caractéristiques du timer 1
Le timer 1 et les interruptions
Le registre T1CON
Le timer 1 en mode « timer »
Le timer 1 en mode compteur synchrone et asynchrone
Le timer 1 et TOSCEN
Utilisation du débordement
Utilisation d’une lecture
Utilisation d’une écriture
Conclusion
Introduction
b7 : Inutilisé : lu comme « 0 »
b6 : Inutilisé : lu comme « 0 »
b5 : T1CKPS1 : Timer 1 oscillator ClocK Prescale Select bit 1
b4 ; T1CKPS0 : Timer 1 oscillator ClocK Prescale Select bit 0
b3 : T1OSCEN : Timer 1 OSCillator ENable control bit
b2 : T1SYNC : Timer 1 external clock input SYNChronisation control
bit
b1 : TMR1CS : TiMeR 1 Clock Source select bit
b0 : TMR1ON : TiMeR 1 ON bit
Le timer 1 en mode « timer »
T1CON : B’00XX0001’
• T1CON : B’00xx1x11’
Le timer 1 et TOSCEN
Utilisation du débordement
clrf TMR1L ; effacer timer 1, 8 lsb
clrf TMR1H ; effacer timer 1, 8 msb
movlw B’00100000’ ; valeur pour T1CON
movwf T1CON ; prédiviseur = 4, mode timer,
timer off
bsf STATUS,RP0 ; passer en banque 1
bsf PIE1,TMR1IE ; autoriser interruptions timer 1
bcf STATUS,RP0 ; repasser banque 0
bsf INTCON,PEIE ; interruptions périphériques en
service
bsf INTCON,GIE ; interruptions en service
bsf T1CON,TMR1ON ; mettre timer 1 en service
Utilisation d’une lecture