Hi Nadia,
If you look at the PWM_LDD help, it states the following:
Component PWM_LDD
Pulse width modulation
Component Level: Logical Device Driver
Category: Logical Device Drivers-Timer
This component implements a pulse-width modulation generator that generates a signal with variable duty and fixed frequency (period).
The PWM_LDD Component has the frequency fixed.
But since it is "just software" you could play around with Events.c PWM1_OnEnd() ISR as shown below to allow changing frequency. The frequency range depends on the clock configuration so this is just an example:
void PWM1_OnEnd(LDD_TUserData *UserDataPtr)
{
/* Write your code here ... */
#if 0 //DES 0=change frequency, 1=change duty
PWM1_SetRatio16(MyPWM1Ptr,++ratio); //change duty
#else
static unsigned increment=0;
increment++;
if(!(increment%10)) //DES slow down frequency change to enable watching on oscope
{
FTM_PDD_WriteModuloReg(FTM0_BASE_PTR, ++ratio);
FTM_PDD_WriteChannelValueReg(FTM0_BASE_PTR, 0, (uint16_t)ratio/2);
increment=0;
}
#endif
}
I tested the above using KDS+PE for the TWR-K70.
Regards,
David