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

low_power_pwm with Frequency 4Khz

hello i am using the nrf52840.

how i can set the 4Khz frequency in low_power_pwm.

low_power_pwm_config_t have period parameters. which value i need to assign to generate the 4Khz Siganl.

before i used the APP_PWM which is much more easy but have some issue with nrf52840. because when i used the P1.08 pin then he is creathing some conflict with i2c. thats why i try to use the low_power_pwm and i also follow this Link

no matter if you help me to generate the 4Khz signal in Low power Pwm or to fix the issue with App_PWM.

in the APP_PWM i was generating the signal using this command which is working great.

/* 1-channel PWM, 4kHz, output on pin14. t = 1/f so i/4k= 250uS*/ app_pwm_config_t pwm1_cfg = APP_PWM_DEFAULT_CONFIG_1CH(250, 14);

i also like to menstion that in APP_PWM i already declear the pin like this

#define Buzzer_Pin NRF_GPIO_PIN_MAP(1,8)

Parents
  • thank you so i need APP_PWM. yes when i try to use the both i got error. when i init the APP_PWM immediately the value on the I2C Sensor giving me the garbage value.. these both work fine on nrf 52832 but not on nrf52840. may be i am using the P1.08 pin. this can be the issue. no idea. if you just try to run both nrf52840 then you will see.. and also try to use the P1.08 pin for pwm.... if you need code then i will send you...

Reply
  • thank you so i need APP_PWM. yes when i try to use the both i got error. when i init the APP_PWM immediately the value on the I2C Sensor giving me the garbage value.. these both work fine on nrf 52832 but not on nrf52840. may be i am using the P1.08 pin. this can be the issue. no idea. if you just try to run both nrf52840 then you will see.. and also try to use the P1.08 pin for pwm.... if you need code then i will send you...

Children
No Data
Related