Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /******************************************************************************/
- /* Files to Include */
- /******************************************************************************/
- #if defined(__XC)
- #include <xc.h> /* XC8 General Include File */
- #elif defined(HI_TECH_C)
- #include <htc.h> /* HiTech General Include File */
- #endif
- #include <stdint.h> /* For uint8_t definition */
- #include <stdbool.h> /* For true/false definition */
- #include <stdio.h>
- #include "system.h" /* System funct/params, like osc/peripheral config */
- #include "user.h" /* User funct/params, such as InitApp */
- #pragma config FOSC = INTOSCIO
- /******************************************************************************/
- /* Function Prototypes */
- /******************************************************************************/
- /******************************************************************************/
- /* User Global Variable Declaration */
- /******************************************************************************/
- /******************************************************************************/
- /* Main Program */
- /******************************************************************************/
- void main(void)
- {
- /* Configure the oscillator for the device */
- //ConfigureOscillator();
- /* Initialize I/O and Peripherals for application */
- InitApp();
- //turn timer on
- TMR1ON = 1;
- for(;;)
- {
- asm("NOOP");
- }
- }
- void interrupt TMR1_ISR()
- {
- //if TMR1 int flag set
- if(TMR1IF==1)
- {
- //turn off the timer
- TMR1ON = 0;
- //invert PORTA
- PORTA = PORTA ^ 0xFF;
- //reset TIMER1 counter registers
- TMR1H = 0x00;
- TMR1L = 0x00;
- //reset int flag bit
- TMR1IF = 0;
- //turn back on the timer
- TMR1ON = 1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement