Close

How does the pins work

A project log for NodeMCU and DRV8825

Connecting all control pins from DRV8825 to NodeMCU

Johan WestlundJohan Westlund 08/17/2018 at 11:330 Comments

This list is made with only mentioning how it handles digital logic and interrupts

DRV8825: https://www.pololu.com/product/2133

PinFunctionStatus
EN
Logic high to disable device output and indexer
Input, Internal pulldown
M0Set step mode
Input, Internal pulldown
M1Set step modeInput, Internal pulldown
M2Set step modeInput, Internal pulldown
RSTLogic low to reset indexer and disable output
Input, Internal pulldown
SLPLogic low to enter low-power sleep
Input, Internal pulldown
STPRising edge move stepper one step
Input, Internal pulldown
DIRLogic level sets direction
Input, Internal pulldown
FLTLogic low when in fault condition
Output, open-drain, pullup to sleep pin

Limit switch:

PinFunctionStatus
1Endstop, need interrupt pin preferably
Output, Normaly Open

This means that we need 8 outputs that doesn't have fixed pullups and can handle boot with pulldowns on the pins. And 2 interrupt inputs with at least one that has a pullup.

As seen in the list below this means that D3 and D4 need to be inputs and one of the serial lines as output.

NodeMCU v1.0 Amica ESP-12E:

PinFunctionStatusCan be used as
D0
GPIO16
Not usable with deepsleep, Hi-Z DIO, no interrupt
Output
D1GPIO5Hi-Z DIO
Output, Input, Interrupt
D2GPIO4Hi-Z DIO
Output, Input, Interrupt
D3GPIO0No Hi-Z DIO (prefere pullup)
Input, Interrupt
D4GPIO2Don’t connect to ground at boot time (prefere pullup)
Input, Interrupt
D5GPIO14Hi-Z DIO
Output, Input, Interrupt
D6GPIO12Hi-Z DIO
Output, Input, Interrupt
D7GPIO13
Hi-Z DIO
Output, Input, Interrupt
D8GPIO15
Can't have pullup (only pulldown DIO)
Output
RXGPIO3
Not usable during Serial transmission
Output, Input, Interrupt (if serial not used)
TXGPIO1
Not usable during Serial transmission, Don’t connect to ground at boot time
Output, Input, Interrupt (if serial not used)
A0ADC0
Analog
Not usable as DIO
SD3GPIO10
Might be connected to flashmemory!!!
Not usable
SD2GPIO9
Might be connected to flashmemory!!!
Not usable
SD1MOSI

Unknown
CMDCS

Unknown
SDOMISO

Unknown
CLKSCLK

Unknown
ENEnable
DigitalWrite/Read not possible
Not usable
RSTReset
DigitalWrite/Read not possible
Not usable

Discussions