Vybrid ADC Interrupt

cancel
Showing results for 
Search instead for 
Did you mean: 

Vybrid ADC Interrupt

Jump to solution
662 Views
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.

Labels (2)
Tags (2)
1 Solution
161 Views
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!

View solution in original post

4 Replies
161 Views
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 Kudos
162 Views
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!

View solution in original post

161 Views
karina_valencia
NXP Apps Support
NXP Apps Support

timesyssupport can you help to  review this case?

0 Kudos
161 Views
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 Kudos