Hardware PWM doesn't operate with 100% duty cycle

Hello

I'm currently working SDK upgrade from ncs v2.6.4 to v3.2.1

I found that, in fade in/out scenario, the PWM works well. however, if it need to turn on in 100%duty cycle, it doesn't turned on.

When I compare both driver implementation in sdk, I found a suspicious part.

Path: **zephyr/drivers/pwm/pwm_nrfx.c**

line 202:207

	} else if (pulse_cycles >= period_cycles) {
		/* Constantly active (duty 100%). */
		/* This value is always greater than or equal to COUNTERTOP. */
		compare_value = PWM_NRFX_CH_COMPARE_MASK;
		needs_pwm = IS_ENABLED(NRF_PWM_HAS_IDLEOUT) &&
			    IS_ENABLED(CONFIG_PWM_NRFX_NO_GLITCH_DUTY_100);
	} else {

Could you tell me there is similar issue or solution to solve this problem?

Best regards,
Woo-chan Kim

  • My understanding was that nordic,invert is used on all ncs pwm pinctrl samples because the peripheral is active low by default. nordic,invert makes these pins active high which is more intuitive. If I do `pwm usec pwm@d2000 0 30 0 # duty to 0%` then the pin still goes low. When PM_DEVICE_RUNTIME is disabled and i set the duty cycle to 100 the pin goes high as expected.

    I can create a seperate ticket with more details.

Related