ADC001 with 16 channels in 3 groups. Group 1 Channel 1 equals Group 1 Channel 0

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

cross mob
Not applicable
Hi All,

I am experiencing a problem with the ADC001 App where one of the 16 channels I am acquiring always returns the count of the previous channel. P14.8 is always the same as P14.9 in my case. I am using the XMC4500-F1--x1024 Stepping Code AB.

I have configured the ADC001 App to have 16 channels via 3 groups. See ADC001 App config and resource mappings (where the problem channels are in red and green)...

734.attach






I have defined a 16 element array of structures to hold the 16 ADC channel results...

// Analogue Input variables in a structure
ADC001_ResultHandleType A2DConversion[ A2D_CHANNELS ]
=
{
{0,0,0},
{0,0,0},
{0,0,0},
{0,0,0},
{0,0,0},
{0,0,0},
{0,0,0},
{0,0,0},
{0,0,0},
{0,0,0},
{0,0,0},
{0,0,0},
{0,0,0},
{0,0,0},
{0,0,0},
{0,0,0}
}
;


The 16 x ADC conversions are triggered every 1mS by the following function...

void A2DTrigger(void)
{
if(A2DConversionEventChannel == 0)
{
// All channels converted so generate A2D Load Event (re-starts sequential multi-channel conversion)
A2DConversionEventChannel = A2D_CHANNELS; // Defined as 16
ADC001_GenerateLoadEvent(&ADC001_Handle0);
}
}




Each ADC conversion calls the following event function which copies the channel ADC count into the correct index in the result array...

void A2DConversionEvent(void)
{
A2DConversionEventChannel--; // Range following decrement = 15 to 0


// Read the A2D Result structure into 'A2DConversion' array
ADC001_GetResult(&ADC001_Handle0,&A2DConversion[A2DConversionEventChannel]);
}




The Group 1 Channel 1 is connected to P14.8 which has 3.3V on it so I would expect a count of 4095 but it is always the same as the Group 1 Channel 0 count which is connected to P14.9. See the 'A2DConversion' array indexes 9 & 8 below, both of which have counts of 186...

736.attach

I believe the hardware to be fine as I have configured another project to acquire just one channel on pin P14.8 and I get the expected count of 4095 (3.3V).

I am wondering if anyone has come across this problem or if there could be a problem with the ADC001 App.

I would appreciate any help.

Thank you in advance
Best regards
Aaron
0 Likes
24 Replies
Not applicable


Project attached which contains only the ADC001 and NVIC002 App's to demonstrate the problem on the XMC4500-F1--x1024 Stepping Code AB.

The problem is not present if the ADC001 App is configured for 2 groups of 8 but then I can't use P15.2 and P15.3 which reside in the 3rd ADC group in hardware.
0 Likes
User8570
Level 3
Level 3
Aaron

I am wondering if your application is capable of reading pins P14.4, P14.5, P14.15 and P15.2. I asked on the forum if I can read these 4 ADC inputs somehow using ADC001 App. I will check your app and see if I can get the same results.
0 Likes
Not applicable
Hi jptalledo,

Thank you for your reply and your offer to help. I can read all P14 pins if I configure the ADC001 App with just 2 groups but when I have 3 groups (P15.2 and P15.3 added) then P14.8 returns the same A-D count as P14.9. Very strange.

Best regards
Aaron
0 Likes
Not applicable
Hi Aaron,

Why don't you try to read the conversion result directly from the global result register GLOBRES?

BR,
Zain
0 Likes
Not applicable
HI Zain,

Thanks very much for the suggestion. I will try that.

I would still like to know if there is a problem with the ADC001 App, hopefully someone from Infineon can comment soon.

Very best regards
Aaron
0 Likes
Not applicable
Hi Aaron,

I have no problem for converting 16 channels from 3 groups using XMC4500 Relex Lite Kit-V1. P14.8 & P14.9 are connected to GND & 3.3V respectively. The rest channels are floating. VAREF is tied to 3.3V. Below are the results obtained:

746.attach

As for the direct accessing of the GLOBRES, use "VADC -> GLOBRES". For example, GResult[count] = (VADC -> GLOBRES) & 0x1FFF.

Best regards,
Sophia
0 Likes
Not applicable
Hi Sophia,

Thank you for taking the time to test this. Could you attach a copy of your project please ?

Thank you very much
Aaron
0 Likes
Not applicable
Hi Aaron,

Here it is:


Best regards,
Sophia
0 Likes
Not applicable
Thank you very much Sophia.

Best regards
Aaron
0 Likes
User8570
Level 3
Level 3
Sophia.

Is it possible to instead of reading 16 channels, I can read the following Analog Pins: P14.4 P14.5 P14.15 and P5.2? Two of them are in the same group P14.15 and P5.2. Wondering a way to get the reading from all these 4 channels using a fixed setup.
0 Likes
Not applicable
Hi Jean Paul,

ADC002 should be used for your case. I think there is a typo: P5.2 should be P15.2, isn't it?

BR,
Zain
0 Likes
Not applicable
Hi Sophia,

I am still struggling with this one. If I run your project all is OK. If I paste your main.c into my project it doesn't work even though I have configured the ADC001 to be the same as your project.

The main difference I can see between your project and my project is the Resource Mapping and Signal Assignment but I have no control over this as DAVE maps them. The other thing I have noticed is that DAVE is not consistent in the way it maps the ADC001 channels to the IO001 Apps.

I have not been able to force the Resource Mapping and Signal Assigment in my project to be the same as yours.

If you run the project attached in post #2 I hope you will see the same problem.

Thank you once again
Best regards
Aaron
0 Likes
Not applicable
Hi Aaron,

Is this project originally built in DAVE 3.1.6 or 3.1.8 then migrated to 3.1.10? Are you able to build a working new project in a new workspace (DAVE 3.1.10) according to may settings?

Best regards,
Sophia
0 Likes
Not applicable
Hi Sophia,

It was created completely in DAVE 3.1.10. Did you try running it ?

Thanks
Aaron
0 Likes
Not applicable
Hi Aaron,

But I there are "Old_Lib" & "Old_Startup" folders in your project folder. Where are they come from? If it is newly built project in new workspace using DAVE 3.1.10. Then send us your log files including solver log file.

Best regards,
Sophia
0 Likes
Not applicable
Hi Sophia,

OK I will create a new test project in DAVE 3.1.10 and see if it works BUT the real project I am working on was migrated from DAVE 3.1.6. The project is very big so I will not be able to start it all over again in DAVE 3.1.10. The best I could do is delete the ADC001 App and it's children and the insert the ADC001 App and configure it again.

It would still be useful to know if you ran my project and witnessed the problem or not.

I will report back in a few days.

Thank you very much

Best regards
Aaron
0 Likes
Not applicable
Hi Sophia,

I have created a new project with DAVE 3.1.10 (attached) and it does not work, please note the following...


1) My project uses "main.c" from your project.

2) My ADC001 and NVIC002 Apps have been configured in the same way as your project.

3) The difference I see between the 2 projects is the Resource Mapping which I have no control over. For example...

Your project

P14.8 -> IO001/8 -> Channel BD -> vadc/0/group/1/ch/0
P14.9 -> IO001/9 -> Channel BE -> vadc/0/group/1/ch/1

My project

P14.8 -> IO001/8 -> Channel BF -> vadc/0/group/1/ch/1
P14.9 -> IO001/9 -> Channel BA -> vadc/0/group/1/ch/0

The channels are swapped

4) Running your project in my hardware I get the following...

Group 1, channel 0 (P14.8) = 4095
Group 1, channel 1 (P14.9) = 186

5) Running my project in my hardware I get the following...

Group 1, channel 0 (P14.9) = 188
Group 1, channel 1 (P14.8) = 187

6) Screen shot from your project
773.attach

7) Screen shot from my project
772.attach

😎 All other channel results match between your project and mine


I am struggling to see where the problem lies. Your help would be greatly appreciated.

Best regards
Aaron
0 Likes
Not applicable
Hi Sophia,

Here is the new project created in DAVE 3.1.10.

Best regards
Aaron

0 Likes
Not applicable
Hi Aaron,

Pls upload the log files including _solver.log as well.

Best regards,
Sophia
0 Likes
Not applicable


Hi Sophia,

1 log file attached. If you need others could you tell me where they are located please ?

Thank you.
Best regards
Aaron
0 Likes
Not applicable
Hi Aaron,

Sure.
In the meantime, I would like to seek your understanding of a small delay as our developers are busy on the next major release. I will follow up with the progress.

Best regards,
Sophia
0 Likes
Not applicable
Hi Sophia,

Any news on this please ?

Thank you very much
Best regards
Aaron
0 Likes
Not applicable
Hi Sophia,

Good news ! After updating my DAVE libraries to the latest versions the problem is resolved.

Thank you for your time and help.

Best regards
Aaron
0 Likes
Not applicable
Hi Sophia,

A colleague experienced the same problem this week and it looks like the root cause is a DAVE bug.

For all A-D channels to work, both the input pin number and the A-D channel must be SEQUENTIAL.

DAVE can incorrectly allocate the resources so the pins and channels are not sequential and the solver does not report an error.

For example,

If DAVE allocates the resource shown below the A-D works OK

P14.8 -> IO001/8 -> Channel BD -> vadc/0/group/1/ch/0
P14.9 -> IO001/9 -> Channel BE -> vadc/0/group/1/ch/1


If DAVE allocates the resource shown below the A-D does not work because channels 0 and 1 are swapped relative to the pin numbers (not sequential)

P14.8 -> IO001/8 -> Channel BF -> vadc/0/group/1/ch/1
P14.9 -> IO001/9 -> Channel BA -> vadc/0/group/1/ch/0




If we use the Manual Resource Assignment to force the pins and channels to be sequential as shown below the A-D works OK.

P14.8 -> IO001/8 -> Channel BA -> vadc/0/group/1/ch/0
P14.9 -> IO001/9 -> Channel BF -> vadc/0/group/1/ch/1





Please can you ensure this is fixed in the new DAVE 4.


Thank you very much
Best regards
Aaron
0 Likes