Close

PINS, PINS, PINS

A project log for Monoprice Mini Marlin 2.0 Support

Getting Marlin to run on the Monoprice Mini/Malyan M200.

jc-nelsonJ.C. Nelson 05/11/2018 at 22:130 Comments

IAs you may have noted, I now had USB running, a relatively stable Marlin build, no longer had to have my rigged setup hooked to the display port.

All was well.

At least, all was well-er.

Two problems immediately showed up:

First, if I left the board on, in about 8 seconds, it reset with no error logged.

Secondly, I didn't actually have a pin configuration that worked.

The reset I had a sneaking suspicion about - The STM32 MCU comes with a built-in watchdog that has its own clock and everything, and if you don't feed the dog every so often, BOOM.

But I had the watchdog disabled, or so I thought.

It turns out, however, that the initial programmer for a board can enable hardware level watchdog, where it starts on boot. Without knowing the secret "option bytes" malyan used, I couldn't reset this, and to be honest, I didn't want to.

The watchdog is a good thing, protecting against runaway software that leaves the heater on (but not failed transistors!). The fix here was to enable the watchdog, so marlin's temperature loop would feed it.

Pins, on the other hand, came from simple testing.

The monoprice wiki had a PDF with some pins that I used to start the definitions. The thermistors were easy to find - they were hooked to analog capable pins. The limit switches were more difficult, but again, test programs helped.

For steppers I wound up writing some code that would enumerate through a set of pins, trying each to see if it was the key to stepping, direction, and so on.

All in all, what I had figured would be a difficult portion turned out to be not complex, just tedious of updating my pin map and re-running. Every pin positively identified reduced the pool of possibles, and since the STM32F103CB only has 47 usable pins, it wasn't magic.

Now I could finally print a lucky cat using Marlin, using USB commands and printing from SD.

Unless I turned the printer OFF. 

Getting it to reliably boot would be the next challenge.

Discussions