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

cross mob
Not applicable
Hello,

I downloaded the DAVE example Compare ADCSYNC001_Example1 and I am able to achieve 2 of the voltage level. However, the purpose of it is to minus the 2 values and update the PWM accordingly
For example when the value is less than 1500 then the program should update the PWM accordingly. I am really unsure of how should I come about in doing this. Can I use the software connectivity APP? if yes which app should I use?

Can anyone help me out in this please? (I am using XMC1200)
0 Likes
2 Replies
Not applicable
Hi wadevva,

You can use the PWMSP001 app to generate PWM waveform.
Then, using the value you got from the ADC (after you minus the value), you can update the PWM with API 'PWMSP001_SetCompare' or 'PWMSP001_SetPeriod'.
0 Likes
Not applicable
Sorry, for this compare application, I just need to change the IO001/x to whatever pin I assign it to right? And how do I minus the 2 values? Do I write it in the main after the
int main(void)
{
// status_t status; // Declaration of return variable for DAVE3 APIs

DAVE_Init(); // Initialization of DAVE Apps

ADC002_InitializeQueue(&ADC002_Handle0);

while(1)
{
result2 = result0-result1; (do I write excatly this?)
}
return 0;
}

How do I change the PWM? Do I have to write any code to it? Like a sub code? I am unsure of how to approach this method. How do I write the PWM_setcompare? Sorry for so many question as I am a year 1 student doing a project on AC-DC by using the buck converter to step down the converted AC 230V to 24V and need to maintain it at 24V as the output using the XMC and there isn't much guide for me to read up on.
0 Likes