KE18 ADC hardware trigger

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

KE18 ADC hardware trigger

1,173件の閲覧回数
davidsherman
Senior Contributor I

I can't seem to get the ADC to trigger from the LPIT or the FTM using the TRGMUX.  The ADC works from software triggers.  I can confirm the LPIT is running and it is triggering events, but I can't get the ADC interrupt to happen on any of the channels.  I have the pseudocode example in the KE18 manual implemented, but nothing happens.

SIM->ADCOPT |= SIM_ADCOPT_ADC0TRGSEL(1) | SIM_ADCOPT_ADC0PRETRGSEL(1);

TRGMUX0->TRGCFG[TRGMUX_ADC0_INDEX] = TRGMUX_TRGCFG_SEL0(0x07); // use LPIT ch0 for trigger source

 ADC0->SC2 |= ADC_SC2_ADTRG(1);

What am I missing?  Unfortunately, the ADC chapter is confusing on the subject of pretriggers and triggers.  I'm just trying to get the ADC to trigger at a regular interval.

0 件の賞賛
返信
2 返答(返信)

1,050件の閲覧回数
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, David,

I think your above code is correct, can you post your code here so that we can have a review and debug?

BR

Xiangjun Rong

0 件の賞賛
返信

1,050件の閲覧回数
davidsherman
Senior Contributor I

I found it, I missed the part in the LPIT where it has to be stopped to change the interval.  I was modifying something that did software triggers, but part of it calculates the acquisition interval and it stopped the LPIT when it tried to update the interval.  Seems to be working now.

0 件の賞賛
返信