Synchronized ADC w Background Read

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

cross mob
Not applicable
Hi all,

I am developing a motor-control application using the ADC of a XMC4400 to read the phase-currents in the motor. The voltage to read is present on P14.0, P14.4 and P14.8 to allow for a synchronuos (simultaneous) read of all the three pins.

The ADC is set up using the ADC002-app and are being triggered from CCU8 slice4 (using the PWMMP001-app). The trigger is occuring every 50 us since we have a 20 kHz PWM. This is working very well, the triggering is happening and the ADC reads the voltage present on the pins correctly. So far so good. This is a high-priority task that needs to happen at exactly the right time and may never ever be interrupted.

But in order for my system to work I also need to read some other ADC-channels (6, in fact) that measure busvoltage, temperature etc. This is the low-priority task that is not time-critical, nor very frequent. I thought using the ADC001-app for this task would be a breeze. And also using it in Autoscan-mode would be clever, since then I do not need to trigger or care about it in one way or the other. Just let it run and collect the ADC-readings as I go along.

But using the ADC001-app with autoscan enabled totally wrecks my ADC002 synchronized behaviour. The trigger point for my (high priority) ADC jumps around all over the place and this is no longer possible to use for me. It seems like using the ADC001 app with autoscan enabled gets some higher priority than the ADC002 when I would like it to be the other way around. The ADC001 seems to be continuously interupting the ADC002 and not letting it finish properly.

First of all, why is the above happening ? And second, what do I do to correct it ? Ive been playing around in DAVE trying all possible settings without any form of success. Also been reading the Device Guide for the ADC, but it has not brought me any closer to my goal.

This is a very common user-case of the ADC when it comes to motor-control and since the XMC4400 seems to be targeted at this market, Why is it then this hard to make a thing like the above working ?

And another question, I do not like to use interrupts together with a ADC with autoscan enabled. How may I then be sure that I do not read a corrupt ADC result register ? With corrupt I mean that I try to read a ADC result register, at the same time that the ADC is updating it (because of the autoscan being enabled). Is the read of an ADC result register atomic ?

Any suggestions, comments or help is welcome!
0 Likes
2 Replies
Travis
Employee
Employee
First solution authored Welcome! 500 replies posted
Hi AlliedRob,

My colleague shall look into this issue.

Best Regards
Travis
0 Likes
elegantk
Employee
Employee
Maybe you can try out the XMC44 sensorless FOC App (PMSMFOCSL01) which is available in the App release for 1.0.52.
http://www.infineon.com/cms/en/product/promopages/aim-mc/DAVE_3_Support_Portal/DAVE_Apps_download.ht...

In this App, it is reading the single shunt current.
We will be releasing the PMSMFOCSL02 soon. This App is similar to the 01 version except that it support two and three shunt current measurement.
0 Likes