Vybrid ADC Interrupt

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Vybrid ADC Interrupt

跳至解决方案
1,244 次查看
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 解答
743 次查看
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 回复数
743 次查看
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 项奖励
744 次查看
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!

743 次查看
karina_valencia
NXP Apps Support
NXP Apps Support

timesyssupport can you help to  review this case?

0 项奖励
743 次查看
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 项奖励