猪啊朱 发表于 2023-8-3 11:28:45

k题Pwm输出求助理

#define PWM_PSC                         (240-1)        //120分频
#define PWM_PERIOD                 2000                //周期20毫秒
12mhz主频下pwm输出是这样的;
我想在24mhz下输出50hzpwm,怎么设置

神农鼎 发表于 2023-8-3 11:35:42





梁工 发表于 2023-8-3 12:19:03

楼主设置已经对啦:
#define PWM_PSC                (240-1)      //240分频
#define PWM_PERIOD          (2000-1 )               //周期20毫秒

猪啊朱 发表于 2023-8-3 12:22:25

梁工 发表于 2023-8-3 12:19
楼主设置已经对啦:
#define PWM_PSC                (240-1)      //240分频
#define PWM_PERIOD      ...

哈哈哈,当时我用示波器测了一下发现对了
页: [1]
查看完整版本: k题Pwm输出求助理