This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

nrf52 DK try to set duty to 0 but i still could get about 400mv of LED

Dears:

I try to use nRF52_SDK_0.9.0_0c82e3e SDK pheripheral pwm example and set the channel1(led2)

duty to 0.

But i still could get the signal about 400mv with LED2(P0.18).

Would that be normal??

In my opinion it should 0v when i set the duty to 0.

Would i miss anything??

Please correct me if i am wrong.

Thanks for your command.

Parents
  • Hi Justin

    On my side, when testing this with nRF52-DK preview board (PCA10036), pwm example from nRF52 SDK 0.9.2, the voltage is 0.0V on both pin P0.17 and P0.18 when I set the duty cycle as follows:

    int main(void)
    {
    		ret_code_t err_code;
    		
    		/* 2-channel PWM, 200Hz, output on DK LED pins. */
    		app_pwm_config_t pwm1_cfg = APP_PWM_DEFAULT_CONFIG_2CH(5000L, BSP_LED_0, BSP_LED_1);
    		
    		/* Switch the polarity of the second channel. */
    		pwm1_cfg.pin_polarity[1] = APP_PWM_POLARITY_ACTIVE_HIGH;
    		
    		/* Initialize and enable PWM. */
    		err_code = app_pwm_init(&PWM1,&pwm1_cfg,pwm_ready_callback);
    		APP_ERROR_CHECK(err_code);
    		app_pwm_enable(&PWM1);
    		
    		app_pwm_channel_duty_set(&PWM1, 0, 0);
    		app_pwm_channel_duty_set(&PWM1, 1, 100);
    	
    		uint32_t value;
    		while(true)
    		{
    		} 
    }
    
  • That is strange.

    Make sure you do not have anything connected to those pins.

    Make sure your multimeter has a new battery. Some multimeters give false results when battery is low.

    Try also to configure other pins than P0.17 and P0.18 to the PWM and measure if you get the correct voltage on them. It is a possibility that internal ESD diodes are shorted on certain pins, depending on your previous activity with your board.

Reply
  • That is strange.

    Make sure you do not have anything connected to those pins.

    Make sure your multimeter has a new battery. Some multimeters give false results when battery is low.

    Try also to configure other pins than P0.17 and P0.18 to the PWM and measure if you get the correct voltage on them. It is a possibility that internal ESD diodes are shorted on certain pins, depending on your previous activity with your board.

Children
No Data
Related