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.
Solved! Go to Solution.
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!
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
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!
timesyssupport can you help to review this case?
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