Sign in

username:

password:



Not a member?

Search piclist



Search tips

Subscribe to piclist



piclist by Keywords

12F675 | 16F628 | 16F84 | 16f877 | 16F877A | 16F88 | 18F458 | ADC | AVR | Bootloader | CAN | CCS | CRC | EAGLE | EEPROM | ICD | ICSP | IDE | JDM | LED | Macros | Microchip | MPLAB | PCB-CAD | PIC10F | Pic12f675 | PIC16F84 | PIC16F84A | PIC16F877 | PIC18 | PIC18F452 | PicBasic | PICC | PICSTART | PWM | RS-485 | RS232 | SMT | SPI | UART | USART | USB | Wireless | Wisp628 | Xilinx

Ads

Discussion Groups

Discussion Groups | Piclist | unable to use PIC18 low isr

A discussion group for the PICMicro microcontroller. Also called the Microchip PIC, this list is dedicated to the use and abuse of this fine, simple, microcontroller. Close to topic posts are welcome, ie. general electronics.

unable to use PIC18 low isr - embe...@austinlakes.com - Jul 3 1:57:40 2008

I have been attempting to use the PIC18 low isr but can't seem to get anything but the high isr to fire. I have reduced my code to the following and it works fine as long as I use the high isr. If I set a break point on the low one, it never gets accessed. The original code was designed to use the low isr only and I have been able to make it work by pointing the high vector to the low handler. Changing IPEN makes no difference. Not really what I wanted!

Any suggestions?
#include
#include
#include

#pragma config OSC = HS
#pragma config PWRT = OFF
#pragma config BOREN = OFF
#pragma config WDT = OFF
#pragma config MCLRE = ON
#pragma config PBADEN = OFF
#pragma config LVP = OFF
void timer0_isr(void); // Interrupt

void init(void); // Initial

#pragma code high_vector=0x08

void high_vector(void)
{
_asm GOTO timer0_isr _endasm
}

#pragma code /* return to the default code section */

#pragma code low_vector=0x18

void low_vector(void)
{
_asm GOTO timer0_isr _endasm
}

#pragma code /* return to the default code section */
//#pragma interruptlow timer0_isr

void timer0_isr (void)
{
unsigned int i;

TMR0H=0X80;
TMR0L=0X00;

i++;

INTCONbits.TMR0IF = 0;
INTCONbits.GIE = 1; //jb added when seen that GIE gets reset

}
/******************************************************/
void main (void)
{

// timer0_isr(); //jb added as test to display temp prior to ints

OpenTimer0 (TIMER_INT_ON & T0_SOURCE_INT & T0_16BIT);
RCONbits.IPEN=1; //jb added due to c18 app note on no high isr
INTCON2bits.TMR0IP = 1;
INTCON2bits.RBIP = 0;
INTCONbits.TMR0IF = 0; //jb added to clear the tmr0 flag

INTCONbits.GIE = 1;

while(1){};
}

------------------------------------

to unsubscribe, go to http://www.yahoogroups.com and follow the instructions



(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )