I am trying to output 4MHz and 50% dutycycle on KW36. I run the demo frdmkw36_driver_examples_tpm_simple_pwm and I make some modifications:
int main(void)
{
tpm_config_t tpmInfo;
tpm_chnl_pwm_signal_param_t tpmParam;
#ifndef TPM_LED_ON_LEVEL
#define TPM_LED_ON_LEVEL kTPM_LowTrue
#endif
tpmParam.chnlNumber = (tpm_chnl_t)BOARD_TPM_CHANNEL;
tpmParam.level = TPM_LED_ON_LEVEL;
tpmParam.dutyCyclePercent = 50;
BOARD_InitPins();
BOARD_BootClockRUN();
BOARD_InitDebugConsole();
CLOCK_SetTpmClock(1U);
PRINTF("\r\nTPM example to output center-aligned PWM signal\r\n");
PRINTF("\r\nIf an LED is connected to the TPM pin, you will see a change in LED brightness if you enter different values");
PRINTF("\r\nIf no LED is connected to the TPM pin, then probe the signal using an oscilloscope");
TPM_GetDefaultConfig(&tpmInfo);
TPM_Init(BOARD_TPM_BASEADDR, &tpmInfo);
TPM_SetupPwm(BOARD_TPM_BASEADDR, &tpmParam, 1U, kTPM_CenterAlignedPwm, 4000000U, TPM_SOURCE_CLOCK);
TPM_StartTimer(BOARD_TPM_BASEADDR, kTPM_SystemClock);
while (1)
{
}
}
but I get this:

This is not 50% dutycycle. How could I get 50% dutycycle pwm?