uPyCam icon indicating copy to clipboard operation
uPyCam copied to clipboard

Issues when using camera driver in parallel with PWM

Open jischebeck opened this issue 5 years ago • 2 comments

Hi Lemariva,

the driver is great and works perfect standalone.

When combined with PWM to control servos, either the system reboots, fails to initialize the camera or the servos don't work anymore.

Could it be due to the Timer used? TIMER_0 for Camera, TIMER_1 for PWN ? Do you have any idea?

Jan

I added the following PWM to the webcam.py: servo_r = machine.PWM(machine.Pin(12), freq=50,duty=0) servo_l = machine.PWM(machine.Pin(13), freq=50,duty=0)

jischebeck avatar Jul 19 '20 19:07 jischebeck

  • Do the servos work without the camera driver? Usually I have the problem that the servos drain too much current and the board reboots. or
  • It could be a memory problem, this means, the board runs out of memory.

lemariva avatar Aug 09 '20 21:08 lemariva

It works fine without the camera driver. If I run it on different channels / timers it works fine. At https://robotzero.one/esp32-cam-rc-car/ someone run into the same problem, and got it solved with different channels.

Unfortunately, this can't be repeated easily using micropython, as there you cannot change the channels/times.

jischebeck avatar Aug 10 '20 12:08 jischebeck