Hi, im trying to use a timer interrupt to trigger the interrupt service routine and read a value from the ADC. however when trying to compile the ISR doesnt like to call any functions and spits an error at me.
any help woule be appreciated.
its a 16F876 btw.
Interrupts!
-
- Valued Contributor
- Posts: 548
- Joined: Tue Jun 26, 2007 11:23 am
- Has thanked: 6 times
- Been thanked: 44 times
Hello Legoman,
The ADC component functions: SampleADC, ReadAsInt and ReadAsByte can be included in the macro called by the timer interrupt. The returned value and any control flags can then be saved to global variables.
It is advisable not to do too much more from within the interrupt service routine, but return as quickly as possible to the main program.
The ADC component functions: SampleADC, ReadAsInt and ReadAsByte can be included in the macro called by the timer interrupt. The returned value and any control flags can then be saved to global variables.
It is advisable not to do too much more from within the interrupt service routine, but return as quickly as possible to the main program.