cancel
Showing results for 
Search instead for 
Did you mean: 

ST6265 - Interupt vector #4

dustin
Associate II
Posted on February 28, 2005 at 14:13

ST6265 - Interupt vector #4

3 REPLIES 3
dustin
Associate II
Posted on February 22, 2005 at 22:16

Hello,

Im trying to use 2 interupts. 1) for the timer - when the timer hits zero 2) for the adc - when end of conversion (EOD).

I have written my code in C and my problem is that when im debugging it will only go into one of the interupt vectors, which ever one comes first. I am puzzled by this, does anyone have any suggestions.

Here is the code for the interupt functions:

void int_adc(void) interrupt 4

{

ADCR = 0x10; // Disable ADC interrupt

} // Exit interrupt

void int_timer(void) interrupt 4

{

TCR = 0x86; // Reload the timer counter register to 86h

TSCR = TSCR&0x7F;

// Reset the TMZ bit of the TSCR register to enable

// a new count

count++;

}

joern2
Associate II
Posted on February 28, 2005 at 13:34

The ADC (End of Conversion) and the Timer (Overflow) share one and the same interrupt. Both events branch to the same address. You need to decide by software polling TMZ and EOC what has happend. Or you use another timer or wait the 70µs until the A/D has finished.

dustin
Associate II
Posted on February 28, 2005 at 14:13

Ok thanks thats what I was thinking. I used a few if loops to check the status of the ADCR and TSCR registers.