Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <xc.h>
- __CONFIG(FOSC_INTOSCIO & WDTE_OFF & PWRTE_ON & MCLRE_OFF & CP_OFF & IOSCFS_8MHZ & BOREN_ON);
- void interrupt myInterrupt(void)
- {
- if (T0IE && T0IF)
- {
- RA4 = ~RA4;
- TMR0 = 254;
- T0IF = 0;
- }
- }
- void main()
- {
- TRISA = 0;
- ANSEL = 0;
- PSA = 1; // Prescaler Assignment bit : 1 = Prescaler is assigned to the WDT, 0 = Prescaler is assigned to the Timer0 module
- T0CS = 0; // T0CS: TMR0 Clock Source Select bit : 0 = Internal instruction cycle clock (FOSC/4), 1 = Transition on T0CKI pin
- T0IE = 1; //T0IE: Timer0 Overflow Interrupt Enable bit
- GIE = 1; //GIE: Global Interrupt Enable bit
- while (1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement