Re: pwm_init creates a platform restart
Posted: Sun Aug 23, 2015 11:35 am
What happens if you only use two PWMs? I have actually never used more than two PWM at the same time, maybe you ran into an SDK bug.
I do this (pseudo code), this works for at least two pwm's:
I do this (pseudo code), this works for at least two pwm's:
Code: Select all
uint32_t pwm_io_info[gpio_pwm_size][3];
uint32_t pwm_duty_init[gpio_pwm_size];
gpio_init(); /* this may or may not matter, try it... */
for pwmchannel in all pwm's
{
pwm_io_info[pwmchannel][0] = mux_index;
pwm_io_info[pwmchannel][1] = mux_func;
pwm_io_info[pwmchannel][2] = pin_index;
pwm_duty_init[pwmchannel] = duty;
}
pwm_init(3000, pwm_duty_init, pwmchannel, pwm_io_channel);
pwm_start();