Jyothi@Pic
New Member
Hi,
I am using PIC18f4620 and c18 compiler below is the code when i execute this code the controller does not goto interrupt routine break point is at isr.
If their is any mistake please tell me what corrections is to be made
I am using PIC18f4620 and c18 compiler below is the code when i execute this code the controller does not goto interrupt routine break point is at isr.
If their is any mistake please tell me what corrections is to be made
Code:
#include <p18f4620.h>
#include <timers.h>
#define NUMBER_OF_LEDS 8
void timer_isr (void);
static unsigned char s_count = 0;
#pragma code low_vector=0x18
void low_interrupt (void)
{
_asm GOTO timer_isr _endasm
}
#pragma code
#pragma interruptlow timer_isr
void timer_isr (void)
{
static unsigned char led_display = 0;
INTCONbits.TMR0IF = 0;
s_count = s_count % (NUMBER_OF_LEDS + 1);
led_display = (1 << s_count++) - 1;
PORTB = led_display;
}
void main (void)
{
TRISB = 0;
PORTB = 0;
OpenTimer0 (TIMER_INT_ON & T0_SOURCE_INT & T0_16BIT);
INTCONbits.GIE = 1;
while (1)
{
}
}