Chat freely about anything...

User avatar
By limpkin
#26892
eriksl wrote:Also you might want to try this:

Code: Select alluint32 io_info[][3] = {{PWM_0_OUT_IO_MUX,PWM_0_OUT_IO_FUNC,PWM_0_OUT_IO_NUM},{PWM_1_OUT_IO_MUX,PWM_1_OUT_IO_FUNC,PWM_1_OUT_IO_NUM},{PWM_2_OUT_IO_MUX,PWM_2_OUT_IO_FUNC,PWM_2_OUT_IO_NUM}};


change to this:

Code: Select alluint32 io_info[PWM_CHANNEL][3] = {{PWM_0_OUT_IO_MUX,PWM_0_OUT_IO_FUNC,PWM_0_OUT_IO_NUM},{PWM_1_OUT_IO_MUX,PWM_1_OUT_IO_FUNC,PWM_1_OUT_IO_NUM},{PWM_2_OUT_IO_MUX,PWM_2_OUT_IO_FUNC,PWM_2_OUT_IO_NUM}};


So you're sure that the io_info array is exactly as large as the pwm_init function expects. This is just like #define usage, help the compiler help you by not trusting on "easy" default behaviour.


thanks for the tip! that didn't help.
User avatar
By rabbit
#26955
limpkin wrote:Anyway, I already tried with 1 and 2 pwm channels... no success.

Did you solve your problem?

My PWM-test with GPIO13 (1 channel) works with sdk1.3.0:
Code: Select allLOCAL uint32 duty = 500;
LOCAL uint32 io_info[][3] = {{PERIPHS_IO_MUX_MTCK_U, FUNC_GPIO13, 13}};
LOCAL void ICACHE_FLASH_ATTR config_PWM(void) {
   pwm_init(1000, &duty, 1, io_info);
   pwm_start();
}
User avatar
By limpkin
#26956
rabbit wrote:
limpkin wrote:Anyway, I already tried with 1 and 2 pwm channels... no success.

Did you solve your problem?

My PWM-test with GPIO13 (1 channel) works with sdk1.3.0:
Code: Select allLOCAL uint32 duty = 500;
LOCAL uint32 io_info[][3] = {{PERIPHS_IO_MUX_MTCK_U, FUNC_GPIO13, 13}};
LOCAL void ICACHE_FLASH_ATTR config_PWM(void) {
   pwm_init(1000, &duty, 1, io_info);
   pwm_start();
}


Unfortunately your code doesn't work on my project... I'm wondering if this is makefile related...