-->
Page 4 of 15

Re: pwm_init creates a platform restart

PostPosted: Sun Aug 23, 2015 11:51 am
by limpkin
Yes... but that shouldn't be a problem when only trying with 1 PWM channel no?

Code: Select alluint32 pwm_duty_init[PWM_CHANNEL] = {0,0,0};


for 3 channels didn't help.

Re: pwm_init creates a platform restart

PostPosted: Sun Aug 23, 2015 11:52 am
by limpkin
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.

Re: pwm_init creates a platform restart

PostPosted: Mon Aug 24, 2015 11:05 am
by rabbit
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();
}

Re: pwm_init creates a platform restart

PostPosted: Mon Aug 24, 2015 11:11 am
by limpkin
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...