Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Gestion des interruptions
- INTCONbits.INT0IE = 1;// Autoriser les interruptions externes
- INTCONbits.GIEH = 1; // Autoriser les interruptions haute priorité
- INTCONbits.GIEL = 1; // Autoriser les interruptions basse priorité
- INTCONbits.TMR0IE = 1; // Activer l'interruption de débordement de timer
- RCONbits.IPEN = 1; // Activer les niveaux d'interruption
- // Configuration des caractéristiques du timer
- T0CONbits.TMR0ON = 1; // Activer le timer
- T0CONbits.T08BIT = 0; // Configuration 16 bits
- T0CONbits.T0CS = 0; // Horloge interne
- T0CONbits.T0SE = 1; // High to low
- T0CONbits.PSA = 0; // Activer le prescaler
- T0CONbits.T0PS = 111; // Prescaler sur 256
- // Congiguration des éléments physiques du circuit
- TRISD = 0x00; // Les pins du portD sont des sorties
- LATD = 0x00; // Toutes les leds sont éteintes
- TRISBbits.RB0=1; // Le bouton poussoir RB0 est une entrée
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement