First page Back Continue Last page Graphics
Interrupt Service Routine
- In websrv65_v310/src/mxwebsrvr.c
- Change:
- /////////////////////////////////////////////////
- //High Interrupt ISR
- TickUpdate();
- To:
- /////////////////////////////////////////////////
- //High Interrupt ISR
- //------------------------------------------------
- // Preset TMR0 for next interrupt
- // in 1/1200th of a second
- //------------------------------------------------
- TMR0H = TICK_COUNTER_HIGH;
- TMR0L = TICK_COUNTER_LOW;
- //------------------------------------------------
- // read the 10bit Analog to Digital Converter
- // output initiated during the prior ISR
- //------------------------------------------------
- Adc_sample = ((WORD)ADRESH << 8) | (WORD)ADRESL;
- Input = Adc_sample;
- metric += Input;
- //------------------------------------------------
- // Digital IIR Filter "Temp" scaled by 2^8 coef's
- //------------------------------------------------
- Temp = 185*Intermediate2 - 425*Intermediate1;
- The ISR routine begins with presetting for the next timer to trigger the next interrupt.
- The A/D output is read from ADRESH & ADRESL, transferred to “Input”, and an input summation “metric” is accumulated. The metric is to later judge whether signal is present on an input.
- “Temp” is the IIR Filter multiplication of prior intermediate values times filter coefficients inflated by 256