Advertisement
Guest User

Untitled

a guest
Feb 27th, 2015
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.91 KB | None | 0 0
  1. // Gestion des interruptions
  2.  
  3. INTCONbits.INT0IE = 1;// Autoriser les interruptions externes
  4. INTCONbits.GIEH = 1;  // Autoriser les interruptions haute priorité
  5. INTCONbits.GIEL = 1;  // Autoriser les interruptions basse priorité
  6. INTCONbits.TMR0IE = 1; // Activer l'interruption de débordement de timer
  7. RCONbits.IPEN = 1; // Activer les niveaux  d'interruption
  8.  
  9. // Configuration des caractéristiques du timer
  10.  
  11. T0CONbits.TMR0ON = 1; // Activer le timer
  12. T0CONbits.T08BIT = 0; // Configuration 16 bits
  13. T0CONbits.T0CS = 0; // Horloge interne
  14. T0CONbits.T0SE = 1; // High to low
  15. T0CONbits.PSA = 0; // Activer le prescaler
  16. T0CONbits.T0PS = 111; // Prescaler sur 256
  17.                    
  18. // Congiguration des éléments physiques du circuit
  19.                    
  20. TRISD = 0x00; // Les pins du portD sont des sorties
  21. LATD = 0x00; // Toutes les leds sont éteintes
  22. TRISBbits.RB0=1; // Le bouton poussoir RB0 est une entrée
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement