ADC interrupt interfering with TI1

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ADC interrupt interfering with TI1

2,564 Views
spearce
Contributor I
I am using a periodic interrupt(TI1) which calls an ADC to perform a single sample each time an interrupt is received. If I enable the "Interrupt service/event" in the ADC bean then the periodic interrupt will only take place one time. No interrupts are being generated by the ADC, just switching it to enable creates this problem

I can only guess this problem is related to a register value. I have tried setting "Interrupt preserve registers" to yes or no in conjunction with(and without) commenting out "#pragma interrupt called". How do I get the periodic interrupt to call an ADC and allow the ADC to generate interrupts?

Thank you for any help
Sam

Message Edited by spearce on 2006-12-1909:44 PM

Message Edited by spearce on 2006-12-1909:49 PM

Labels (1)
Tags (1)
0 Kudos
3 Replies

556 Views
admin
Specialist II
Which CPU you use? Which method you use to start conversion?
0 Kudos

556 Views
spearce
Contributor I
I am using a DSP56F807 with code warrior 7.0

In my main file I call "TI1_OnInterrupt()", in the events file under this function I have:

{
AD1_Measure(TRUE);
AD1_GetValue(&adc_Buff[0]);
.
.
.
}

Everything after the AD1 usage is math and data manipulation. Once again, this function will only execute one time if I enable the "Interrups service/event" in the ADC bean.

Thanks again
Sam
0 Kudos

556 Views
admin
Specialist II
There are 2 ways.
1. You need to disable "ADC on End" interrupt and use followed code - i.e. wait end of ADC conversion in the timer event.
2. Enable "ADC on End" interrupt. In the timer interrupt function use
AD1_Measure(FALSE); // run conversion
and in the ADC interrupt function - i.e. after conversion ended succesfully
AD1_GetValue(&adc_Buff[0]);

Message Edited by Alexey on 2006-12-2008:02 PM

0 Kudos