ADC auto scan example

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Hi,

I'm trying to set ADC0 to auto scan a couple of channels. But no luck.
Is there an example of how this is done.

Thanks,
Evs
0 Likes
6 Replies
Not applicable
Hi EVS,

Which device are you using?
0 Likes
Not applicable
I'm using XE167FM
0 Likes
Not applicable
Hi EVS,

Did you use DAVE for the code generation?
If yes, it is quite simple.
You just need to enable the Parallel Source in the general tab and choose Enable Autoscan in the Parallel tab.
Then, you enable the ADC channels you want to use and use the function ADC0_vStartParReqChNum to include the ADC channel into the Autoscan.
0 Likes
Not applicable
Jackson wrote:
Hi EVS,

Did you use DAVE for the code generation?
If yes, it is quite simple.
You just need to enable the Parallel Source in the general tab and choose Enable Autoscan in the Parallel tab.
Then, you enable the ADC channels you want to use and use the function ADC0_vStartParReqChNum to include the ADC channel into the Autoscan.


Thanks for the reply.

Yes I did al that! I also read the documentation many times. But the ADC is 0 (RESR0). If I do a single scan it works fine.
I do a conversion request(ADC0_vStartParReqChNum (0)) but it isn't handeld by hardware and I don't know why.
CRMR1=0x0011. I think it should work.

Regards,
0 Likes
Not applicable
Hi EVS,

You need to call the function ADC0_vSetLoadEvent after you call the ADC0_vStartParReqChNum function.
0 Likes
Not applicable
Dear,
I also use a XE167FM, I want to read input P15.0 to P15.6 but it's not working.
I change the input at each timer.
When I read only one input it's ok, but if i want to read 15.0, 15.1 the next time... 15.5 the next time it's not working.
I use :

ADC1_vStartParReqChNum(ucCptReadSensor);
ADC1_vSetLoadEvent();
while(ADC1_uwBusy());

fPressureA = (ADC1_uwGetResultData(RESULT_REG_7) + fPressureA * 20)/21;

Do you have an idea about what is wrong?
thank you for your help
Benoît
0 Likes