ADC interrupt interfering with TI1

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

ADC interrupt interfering with TI1

3,381件の閲覧回数
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

ラベル(1)
タグ(1)
0 件の賞賛
返信
3 返答(返信)

1,373件の閲覧回数
admin
Specialist II
Which CPU you use? Which method you use to start conversion?
0 件の賞賛
返信

1,373件の閲覧回数
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 件の賞賛
返信

1,373件の閲覧回数
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 件の賞賛
返信