Need a reality check on floating values of pins with pull down resistors


I want to be able to set a DRV8825 into the mode where you can adjust the current output of the driver, but the instructions I've seen for doing this say to disconnect the M0, M1, and M2 pins. And in my project, I have these pins connected to an Arduino, and I would like to be able to enable this "current adjustment mode" via code, and I don't remember which state pins with pull down resistors on them are in when they float... is it +V or is it GND? I'm thinking +V, but I just need a reality check on that please?

Thank you,


Where are those instructions that you have seen ?

It is a combination of the reference voltage with the shunt registers.
Manufacturer's page of the DRV8825:
Pololu's DRV8825 module:, a schematic a available.

With pull-downs they don't "float". They are pulled low (to ground or digital zero). But of course you can "over-power" the pull down resistor with an active-high signal.

Thank you, this is exactly what I was looking for.

@Koepel - I've set the current on DRV8825's many times, so I fully know the procedure ... I just needed this info so I can set it into the right mode from within a sketch. Also, in spite of reading through this, I was not able to find the exact info I got here.

The instructions for adjusting the current I found here ... scroll down about mid-way and look at Method 2. And yes, I am aware of the method where you read a voltage from the potentiometer.

Thank you for explaining and the links.

They let the MODE pins open to select the full-step mode to measure the current.
Since the MODE pins have an internal pulldown, they will be low.
So making them low with the Arduino is the same thing.

I'm not sure if I agree with that method. I would check what mechanical force I need from the stepper motors for a project and adjust the current to that.

I kind of like the method where you read the current directly as it is applied to the stepper while the stepper is not stepping but is set to a position and held there because the meter will tell you exactly how much current is going to the motor vs using the voltage from the pot then doing the math to give you the current. In terms of accuracy, the meter method tells you what's going on inside the circuit and would compensate for any kind of variance between different steppers where inevitably, the impedance of the coils will vary from one stepper to the next and using the pot method only tells you generally what target current the driver is going to strive for whereas the meter method leaves nothing to guess. Though I've not compared the pot method to the meter method, which would be an interesting test and would reveal how accurate the driver is when it does its own adjustments to the output current. Though I suspect it will be fairly spot on ... the DRV8825 is no slouch in the engineering quality department. TI doesn't tend to "half-ass" anything they do.

It just so happens that in this specific application, I'm driving four electromagnetic coils for an electronic stirrer where a Teflon coated magnet (called a pill because of its shape) is spun on its center axis inside a solution in a beaker. The DRV8825 turned out to be a perfect choice since the way the coils are energized is exactly the same as they are inside a stepper motor, though I would really like to have a driver that graduates voltage during the transition from one coil pair to the next keeping the intensity of the magnetic field constant throughout the circle that the pill spins in, but I think the only way to really do that effectively would be to have two more coil pairs inside the radius of the sweep, where I could have three points of field generation for each end of the magnet where the center point is always the strongest and the leading point is stronger than the tailing point. I think it would help combat some of the problems I have spinning the pill inside a thick solution where the "jerkiness" of transitioning between only two coil pairs seems to cause enough injected resistance between the pill and the solution that it causes the pill to leave the magnetic field and it just starts jumping around inside the beaker.

As it turns out, it's not imperative that I get the current precise because as it happens to be, I need to drive the coils as hard as I can for obvious reasons. I'm driving these coils with 32 volts and they tend to consume around 400 to 800ma of current when it's spinning inside a thick solution. They do get hot ... too hot to touch for very long ... but I've had them powered up and running - one time for a straight 7 days without stopping and they hold up just fine, though removing heat would give me a stronger magnetic field ... I tried using a fan but the magnetic field from the fan interfered with the pill so I might try something at a distance - short of being able to submerge the coils inside liquid nitrogen would be perfect ... but WAY overkill for this application lol.

I step the stepper with a very simple method where I calculate RPMs into microsecond delays between steps and I use a timer library that I wrote called BlockNot - though I have a microsecond version of it for this app, which I'm going to add to the published library once I have the time to do that. But I didn't actually expect BlockNot to work in this application, I just tried it as a test but it's been working flawlessly which was a pleasant surprise. BUT, I am using it on a Teensy 4.1 which is far superior to a standard Arduino in terms of processing speed. I have my stepper code running on a loop on one CPU core while the rest of the code runs on the other core. Those Teensy's are really nice.

I see, I remember those from school: who gets the best liquid vortex. That is the opposite of what you want :wink:

If you tend towards the Teensy 4.1, then maybe a ESP32 with FreeRTOS or a Raspberry Pi Pico with Mbed/rtos is something for you. No more fooling around with millis() and no more getting cramps of moving around in too little memory.

Heck, we didn't have magnetic stirrers when I was in school ... not even in college chemistry. Heck, I didn't know they even existed until a few years ago. And I am DEFINITELY chasing the vortex, but my solution is so vicious, I'm struggling with it. But I found a company that makes all different kinds of stir bars and have an inquiry into them to find out which bar would be best to use in this situation.

The memory in the Teensy is more than adequate for any project I could ever see myself doing. Not like the Nano when I did my first large project, I found myself having to learn how to squeeze every byte I could out of the thing ... I was constantly finding the code unable to compile until I either found a more efficient way to do something, or I simply made compromises.

I have several Raspberry Pi Pico's, but the last time I gave that a go, I couldn't find any examples of how to use each core of the processor independently using C++ in the Arduino environment ... plenty of examples using Python ... but who wants to code in Python? ... I dunno ... I seem to struggle accepting Python as an actual programming language since it isn't a programming language ... being a scripting language and all ... I think my brain just outright rejects it on principle... lol.

You have got to be kidding.

Apparently, I am ... it started out as a scripting language... I didn't realize it had evolved until I just looked it up ... my bad ... my ignorance.

I always assumed that the magnetic stirrers had a permanent magnet in the base, connected to a motor shaft...

Me too. Actually I thing the OP's idea could work, but with coils on steel cores, not unlike a synchronous motor, but with the cores open and facing the bottom of the flask. That would concentrate the magnetic field and eliminate the crazy techniques that you would need to make it work with only wire coils and an air core.

Those are necessary because of the tiny value of coupling coefficient between the coils and the stirrer.