Vybrid MQX ADC0 and ADC1

cancel
Showing results for 
Search instead for 
Did you mean: 

Vybrid MQX ADC0 and ADC1

Jump to solution
998 Views
speterson
Contributor III

Hi,

I am currently working with the Vybrid lwadc MQX example and am unable to get both ADC0 and ADC1 working.

The issue is that if BSPCFG_ENABLE_LWADC0 and BSPCFG_ENABLE_LWADC1 are defined non-zero in the BSP (user_config.h) that the interface enabled first will be overwritten by the second. Therefore if you have the following:

#define BSPCFG_ENABLE_LWADC0    1

#define BSPCFG_ENABLE_LWADC1    1

You will only be able to access the channels on ADC1 (ADC1SE0 through ADC1SE9) because the ADC1 initialization overwrites ADC0.

This appears to be a limitation of the driver, has anyone else seen this issue or working on a solution?

Labels (2)
0 Kudos
1 Solution
420 Views
rendy
NXP Employee
NXP Employee

I've consulted this issue with MQX team and it looks like the issue will be gone in next MQX release. It's version 4.1.0 and it will be available soon.

View solution in original post

0 Kudos
4 Replies
420 Views
rendy
NXP Employee
NXP Employee

Hi Serah,

I can confirm this problem. I have contacted MQX team and waiting for their opinion. In the meantime I am trying to develop a workaround. If you have already developed your own, pls let me know.

Rene

0 Kudos
420 Views
rendy
NXP Employee
NXP Employee

I found the workaround, there is a problem with 'context_ptr' variable in the 'lwadc_vadc.c' file. I suppose you have the 4.0.1 version of MQX. Please ty to add correct initialization of this variable in all functions in this file, except the '_lwadc_init' function. The initialization expression is:

context_ptr = lwadc_ptr->context_ptr;


I expect this should be corrected in MQX versions higher than 4.0.1, but at this moment I can't confirm that with certainity. I've attached the updated file. It would be great if you could try the solution and provide the feedback here.

421 Views
rendy
NXP Employee
NXP Employee

I've consulted this issue with MQX team and it looks like the issue will be gone in next MQX release. It's version 4.1.0 and it will be available soon.

0 Kudos
420 Views
karina_valencia
NXP Apps Support
NXP Apps Support

juangutierrez can you  help on this case?

0 Kudos