#include <p18f2550.h>
#include <timers.h>
#include <delays.h>
#pragma config FOSC = XT_XT //Crystal oscillator
#pragma config WDT = OFF //Watchdog Timer off
#pragma config MCLRE = OFF //Master clear off
#pragma config LVP = OFF //LVP off
void timer_isr (void);
unsigned char digit[] = {0x01,0x4F,0x12,0x06,0x4C,0x24,0x20,0x0F,0x00,0x04};
#pragma code high_vector=0x08
void high_interrupt (void)
{ _asm GOTO timer_isr _endasm
}
#pragma code
#pragma interrupt timer_isr
void timer_isr (void)
{
INTCONbits.TMR0IF = 0;
PORTA = digit[3];
Delay10KTCYx(10);
}
void main(void)
{
TRISA = 0x00;
PORTA = digit[0];
OpenTimer0 (TIMER_INT_ON & T0_SOURCE_INT & T0_8BIT);
INTCONbits.GIE = 1; //enable global interrupts
while (1);
}