Hi Pablo, thanks for your answer and your support.
Maybe I was not so clear in the first part of my question...
Just to clarify: what I'm trying to do with this works is to change the duty cycle of a sqare wave of frequency about 500kHz (the carrier) in a sinusoidal way, the sine signal that control the variation of the duty cycle (the mudulating) has a fixed amplitude and frequency that can be selected in the range 20Hz-20kHz. I think this is an example of PWM modulation.
The micro generates the sinusoidal signal Vsin(t)=Vmax*sin(2piNt/Fs) used to control the duty cycle, each sample (@48kHz Fsample rate) has the amplitude value in the range [-Vmax, +Vmax], for example when Vsin=0 the duty cycle will be 50%, when Vsin=+Vmax duty cycle will be 99% and when Vsin=-Vmax the duty cycle will be 1% (just to avoid the 0% and 100% d.c. problems)
At the moment I can use the AudioPll and the I2S peripheral's IRQ to generate the sine signal samples with a wavetable synthesys @48kHz; I generate the carrier @480kHz with the SCT_Timer with a 50% duty cycle; I can change the value of the carrier's duty cycle (SCTIMER_UpdatePwmDutycycle) at each generated sine sample and I can get the right syncronization using a PINT IRQ drived by a pin port externally connected to the 48kHz LRCK signal of the I2S Flexcomm port pinout.
This works well using modulating sine signals from 1Hz to 10kHz, for higher frequencies I have some problems: it seems that the micro loses some sync pint IRQ and duty cycle updates, maybe this solution is too slow.
What do you think about?
Do you have any idea about a faster way to sync the 48kHz generation of the sine samples with the SCT_Timer duty cycle updating wihout using the external driven PINT IRQ?
If there are any other ideas I will be grateful to hear them...
Thanks!