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?
解決済! 解決策の投稿を見る。
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.
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
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.
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.
juangutierrez can you help on this case?