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

cross mob
User12789
Level 3
Level 3
10 sign-ins First solution authored 5 sign-ins

Hi, I'm using the VADC to measure the voltage drops across three shunt resistors to determine motor current on three phases of a three-phase motor. VADC_G0 is the master and VADC_G1 and G2 are slaves. The conversions are kicked off by a one-match event in a CCU8 timer used to generate PWM. This is on an XMC4400.

When I get the VADC interrupt (in VADC0_G0_0_IRQHandler()) I read the conversion results and "clear" the interrupt and return. The problem is, the interrupt handler is immediately re-entered and this occurs indefinitely.

I think I may be incorrectly clearing the interrupt. What I'm doing in the ISR is writing to the GxSEFCLR and GxREFCLR registers to clear the result event and source event flags.

Is this the proper way to clear these interrupts? If not, what is the correct way? The reference manual isn't very specific about this.

Please note: I'm not using the XMC libraries. I've implemented this from scratch and am directly manipulating the VADC registers, so any recommendations as to how to do it using the libraries won't help me.

0 Likes
6 Replies
ncbs
Moderator
Moderator
Moderator
500 replies posted 50 likes received 250 sign-ins

Hi @User12789,

Which DAVE APP are you using? Also, did you try to debug and check what is causing the control to loop back to the interrupt handler continuously?

Are there any channel events triggering the interrupt?

Regards,
Nikhil

0 Likes
User12789
Level 3
Level 3
10 sign-ins First solution authored 5 sign-ins

Hi Nikhil. I'm not using DAVE or any of the DAVE apps. I've written my code from scratch and I directly manipulate the registers of the VADC. 

Yes, channel events are triggering the interrupt, which is expected, because I've set up one of the CCU8 slices to trigger a VADC conversion on a one-match. The issue here is what is the correct way to "clear" a VADC interrupt so that it doesn't immediately occur again as soon as I return from the VADC interrupt handler. That process is not clearly described in the XMC4400 Reference Manual.

0 Likes
ncbs
Moderator
Moderator
Moderator
500 replies posted 50 likes received 250 sign-ins

Hi @User12789 ,

Can you define a default handler and check if the control is still going to the same?

void Default_Handler()
{
 //debug statements 
}

Also, are you using startup file from the XMC DAVE project?

Regards,
Nikhil

0 Likes
User12789
Level 3
Level 3
10 sign-ins First solution authored 5 sign-ins

Hi Nikhil,

As I said in my last post, I’m not using DAVE, therefore I’m not using the startup file from any DAVE project. 

I know this is not common, but some of your customers use your MCUs but not your tools (DAVE) or your software. 

0 Likes
ncbs
Moderator
Moderator
Moderator
500 replies posted 50 likes received 250 sign-ins

Hi @User12789,

Could you let us know your observations in defining the default handler?

 

Thanks for clarifying about DAVE. Could you let us know the reason for not using DAVE IDE for your application development? Which other IDE/tools are you using for the same?

 

Regards,
Nikhil

0 Likes
ncbs
Moderator
Moderator
Moderator
500 replies posted 50 likes received 250 sign-ins

Hi @User12789,

Thread was locked due to inactivity for long time, you can continue the discussion on the topic by opening a new thread with reference to the locked one. The continuous discussion in an inactive thread may mostly be unattended by community users.

Regards,
Nikhil

 

0 Likes