Unintended pulse at start up of a PWM output

Hello,

On nRF52832, I implemented a code with PWM output at P0.07.

Here is the section at my overlay:

pwmleds {
        compatible = "pwm-leds";
        pwm_led0: pwm_led_0 {
            pwms = <&pwm0 0 PWM_MSEC(0) PWM_POLARITY_NORMAL >;
        };
    };
&pwm0 {
    status = "okay";
    pinctrl-0 = <&pwm0_custom>;
    pinctrl-1 = <&pwm0_csleep>;
    pinctrl-names = "default", "sleep";
};
&pinctrl {
    pwm0_custom: pwm0_custom {
        group1 {
            psels = <NRF_PSEL(PWM_OUT0, 0, 7)>;
            nordic,invert;
        };
    };  
   
    pwm0_csleep: pwm0_csleep {
        group1 {
            psels = <NRF_PSEL(PWM_OUT0, 0, 7)>;
            low-power-enable;
        };
    };

    uart0_default: uart0_default {
        group1 {
            psels = <NRF_PSEL(UART_TX, 0, 6)>,
                <NRF_PSEL(UART_RX, 0, 8)>;
        };
    };

    uart0_sleep: uart0_sleep {
        group1 {
            psels = <NRF_PSEL(UART_TX, 0, 6)>,
                <NRF_PSEL(UART_RX, 0, 8)>;
            low-power-enable;
        };
    };
};
I can observe a 25-40ms pulse at the pin during startup. I tried to add this pin as "gpio-leds" also but still seeing the pulse.
As shown in the above overlay configuration, I disabled UART_CTS function also as it is configured as as P0.07 pin as default.

Do you have any suggestion? Thanks!
Parents Reply
  • Hello,

    Attached please find the capture of the waveform. A pulse is observed at ~1s.
    The waveform was measured at nRF52dk PCA10040, P0.17, i.e. control of LED1. This confirms the issue is not related to P0.07.

    The waveform is captured by running the pwm example code, with the following added in DT overlay. No modification was done in the example code.

    / {
    	zephyr,user {
    		io-channels = <&adc 0>;
    	};
        pwmleds {
    		compatible = "pwm-leds";
    		pwm_led0: pwm_led_0 {
    			pwms = <&pwm0 0 PWM_MSEC(0) PWM_POLARITY_NORMAL >;
    		};
    	};
    };

Children
Related