Vybrid ADC Interrupt

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
2,222件の閲覧回数
johannestraxler
Contributor III

Previously we worked with the LWADC driver, but the "wait_next" function gives a delay, so I'm searching for an improved method to access the ADC.

My question is:

How can I make the ADC interrupt driven (interrupt on conversion complete)?

I've checked the datasheet and there should be AIEN-Flag in the ADCx_HC0/1 registers, which might play a role here.

ラベル(2)
タグ(2)
1 解決策
1,721件の閲覧回数
johannestraxler
Contributor III

I found the answer myself. You can use the MQX functions:

    _int_install_isr(NVIC_ADC0, iADC_ISR, 0);

    _bsp_int_init(NVIC_ADC0, 3, 0, TRUE);

    _int_install_isr(NVIC_ADC1, iADC_ISR, 0);

    _bsp_int_init(NVIC_ADC1, 3, 0, TRUE);

with iADC_ISR is the function pointer to the ISR: iADC_ISR(void*ptr).

And then make sure to have the AIEN flag enabled in the ADCx_HC0 registers!

元の投稿で解決策を見る

4 返答(返信)
1,721件の閲覧回数
cyborgnegotiato
Senior Contributor II

Hi,

For new implementation in MQX, you can find inspiration in adc driver (for example in Freescale_MQX_4_1\mqx\source\io\adc directory).

Regards,

Jozef

0 件の賞賛
返信
1,722件の閲覧回数
johannestraxler
Contributor III

I found the answer myself. You can use the MQX functions:

    _int_install_isr(NVIC_ADC0, iADC_ISR, 0);

    _bsp_int_init(NVIC_ADC0, 3, 0, TRUE);

    _int_install_isr(NVIC_ADC1, iADC_ISR, 0);

    _bsp_int_init(NVIC_ADC1, 3, 0, TRUE);

with iADC_ISR is the function pointer to the ISR: iADC_ISR(void*ptr).

And then make sure to have the AIEN flag enabled in the ADCx_HC0 registers!

1,721件の閲覧回数
karina_valencia
NXP Apps Support
NXP Apps Support

timesyssupport can you help to  review this case?

0 件の賞賛
返信
1,721件の閲覧回数
timesyssupport
Senior Contributor II

Unfortunately, we do not have any details about how to make the MQX lwadc driver interrupt driven. Does the Freescale MQX team have any comment on this?

Thanks,

Timesys Support

0 件の賞賛
返信