-->
Page 1 of 2

soft wdt reset when driving stepper motor

PostPosted: Wed May 20, 2020 1:37 pm
by Heiniketh
I am having some issues trying to drive a 28byj-48 stepper motor. I have modified the example stepper motor code to have a simple design and for some reason I am getting a wdt reset. I tried driving the motor from just my computer power supply, then using an external 2A supply but the board resets both ways. The code is very simple, and its just trying to rotate CCW.
I appreciate the help.
Here is the serial log:

Soft WDT reset

>>>stack>>>

ctx: cont
sp: 3ffffde0 end: 3fffffc0 offset: 01a0
3fffff80: 3fffdad0 00000400 3ffee2e8 402013fb
3fffff90: 3fffdad0 00000000 3ffee358 40201078
3fffffa0: feefeffe feefeffe 3ffee358 40201d14
3fffffb0: feefeffe feefeffe 3ffe84e0 40100c21
<<<stack<<<

ets Jan 8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 3456, room 16
tail 0
chksum 0x84
csum 0x84
va5432625
~ld
clockwise
counterclockwise


I used the exception decoder and here is the output:
Decoding stack results
0x40201258: Stepper::stepMotor(int) (C:\Program Files at x86)\Arduino\libraries\Stepper\src\Stepper.cpp line 283
0x402013fb: Stepper::step(int) (C:\Program Files at x86)\Arduino\libraries\Stepper\src\Stepper.cpp line 198
0x40201078: loop() at C:\Users\Ani\Documents\Arduino\motor_rotations/motor_rotations.ino line 23
0x40201d14: loop_wrapper() at C:\Users\Ani\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\cores\esp8266\core_esp8266_main.cpp line 197

Re: soft wdt reset when driving stepper motor

PostPosted: Thu May 21, 2020 7:15 am
by rudy
Disconnect the stepper and then run the code. If you don't get wdt resets then the problem is most likely electrical.

What are you using to drive the stepper motor? (eg. ULN2004) And do you have diodes across the coil windings?

Re: soft wdt reset when driving stepper motor

PostPosted: Thu May 21, 2020 9:44 am
by Heiniketh
Ive tried running the code with nothing connected to the ESP, and I'm getting the same error.

I am driving the motor with a ULN2003AN. As for the diodes across the windings, I am unsure if I do.

Re: soft wdt reset when driving stepper motor

PostPosted: Fri May 22, 2020 12:26 pm
by rudy
Pin 9 must be connected to the positive power for the stepper.

Image

Image


But if you have the problem without the motor connected then that would seem that the motor is not the reason.