Log in

View Full Version : INCONbits.GIEL usage


seanwitte
02-02-2004, 20:38
I have a question about the global low priority interrupt bit. We're using timer3 to sample and integrate a gyro at 100Hz. Since its using the ADC I want to make sure that mainline code doesn't get interrupted in the middle of an ADC conversion.

In the mainline code I think we want to set the GIEL bit low, do a conversion, then set it high again. If the timer interrupt event occurs during the conversion, will the timer3 interrupt bit stay high so that it gets serviced right after resetting the GIEL bit? In the data sheets it looks like the GIEL bit just keeps the low priority vector code from running, but I'm new to the PIC and would like to verify with someone who knows their way around the chip.

Jay Lundy
02-02-2004, 23:20
I have a question about the global low priority interrupt bit. We're using timer3 to sample and integrate a gyro at 100Hz. Since its using the ADC I want to make sure that mainline code doesn't get interrupted in the middle of an ADC conversion.

In the mainline code I think we want to set the GIEL bit low, do a conversion, then set it high again. If the timer interrupt event occurs during the conversion, will the timer3 interrupt bit stay high so that it gets serviced right after resetting the GIEL bit? In the data sheets it looks like the GIEL bit just keeps the low priority vector code from running, but I'm new to the PIC and would like to verify with someone who knows their way around the chip. All interrupts must be cleared in software so I'm pretty sure the answer is yes.