I use SDK V1.0.0
GPIO0
pwm_init freq range 1 - 500
freq eq 500 it is OK,
freq eq 100 it is OK,
but freq eq 50 and 10 ,It is a problem.
attachment
code: freq = 10HZ
Oscilloscope picture: freq = 10HZ
code: freq = 50HZ
Oscilloscope picture: freq = 50HZ
code: freq = 100HZ
Oscilloscope picture: freq = 100HZ
Use pwm_init experiencing some problems
Re: Use pwm_init experiencing some problems
Postby costaud » Tue Mar 31, 2015 6:10 pm
将pwm.h中pwm_single_param 和pwm_param 结构体参数类型做以下修改即可解决问题:
uint16 h_time; 改为 uint32 h_time;
uint16 period; 改为 uint32 period;
修改后为:
struct pwm_single_param {
uint16 gpio_set;
uint16 gpio_clear;
uint32 h_time;
};
struct pwm_param {
uint32 period;
uint16 freq;
uint8 duty[PWM_CHANNEL];
};
uint16 h_time; 改为 uint32 h_time;
uint16 period; 改为 uint32 period;
修改后为:
struct pwm_single_param {
uint16 gpio_set;
uint16 gpio_clear;
uint32 h_time;
};
struct pwm_param {
uint32 period;
uint16 freq;
uint8 duty[PWM_CHANNEL];
};
Who is online
Users browsing this forum: No registered users and 54 guests
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.