ADC_MEASUREMENT_ADV 4.0.14 with SCAN_APP creates wrong config

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

cross mob
User9897
Level 2
Level 2
When using ADC_MEASUREMENT_ADV with ADC_SCAN_APP setting, the created mask for loading GxASSEL is wrong

e.g.
new project for XMC4400x64
add ADC_MEASUREMENT_ADV: Number of Channels 3
config Pin Allocator: Channel_A P14.1, Channel_B P14.3, Channel_C P14.5

Results in (adc_measurement_adc_conf.c):
.insert_mask  = 41 //0b00101001
what will be loaded in G0ASSEL register. But it should be 0b00101010 in this case.
0 Likes
2 Replies
jferreira
Employee
Employee
10 sign-ins 5 sign-ins First like received
Hi,

The setting is correct since the alias feature is being used, i.e. the alias Feature redirects conversion requests defined at channels CH0 to other analog input channels.
See in the generated code the configuration of ADC_MEASUREMENT_ADV_0_Channel_A_ch_config

Regards,
Jesus
0 Likes
User9897
Level 2
Level 2
hmm, ok, didn't know that feature ... the problem in my case was the following:

I had configured two apps:
ADC_MEASUREMENT_ADV_0 on P14.3 and P14.4
ADC_MEASUREMENT_ADV_1 on P14.8, P14.9 and P14.14

so my expectation was:
adc0 scans its channels 3 and 4 (G0ASSEL=0b00011000)
adc1 scans its channels 0,1 and 6 (G1ASSEL=0b01000011)
but G1ASSEL in my case was 0b01011011, so for me it looked like channel 3 und 4 of adc1 get converted during the scan. I noticed this because I was getting wrong results for adc1_ch0. Looking at the result register I saw that RESD[0].CHNR also jumped between 0, 3 and 4.
So I thougth the scan settings are wrong and the otherwise unconfigured channels 3 and 4 of adc1 just get written into result0 by default. Unfortunately I'm not able to reproduce this in an empty project, so maybe something else was going on. I need to check that again.
0 Likes