I still have problems whit this.
Here is my test code:
#define PWM_SRC_CLK_FREQ CLOCK_GetRootClockFreq(kCLOCK_Root_Bus)
#define DEMO_PWM_CLOCK_DEVIDER kPWM_Prescale_Divide_4
#define APP_DEFAULT_PWM_FREQUENCE (1000UL)
static void PWM_init(void)
{
uint16_t deadTimeVal;
pwm_signal_param_t pwmSignal[2];
uint32_t pwmSourceClockInHz;
uint32_t pwmFrequencyInHz = APP_DEFAULT_PWM_FREQUENCE;
pwmSourceClockInHz = PWM_SRC_CLK_FREQ;
/* Set deadtime count, we set this to about 650ns */
deadTimeVal = ((uint64_t)pwmSourceClockInHz * 650) / 1000000000;
pwmSignal[0].pwmChannel = kPWM_PwmA;
pwmSignal[0].level = kPWM_HighTrue;
pwmSignal[0].dutyCyclePercent = 50;
pwmSignal[0].deadtimeValue = deadTimeVal;
pwmSignal[0].faultState = kPWM_PwmFaultState0;
pwmSignal[0].pwmchannelenable = true;
PWM_SetupPwm(PWM3, kPWM_Module_1, pwmSignal, 1, kPWM_SignedCenterAligned, pwmFrequencyInHz, pwmSourceClockInHz);
}
I have set the pinmux on pin K4 and mapped it to PWM3 A,1 with Software Input On bit set.
But the K4 pin goes from "1" with pullup to steady "0" after the PWM_Init() function.
What have I missed out?