So.. You got yourself a BigTreeTech/BIQU SKR v1.1 or v1.3 controller board, and you want to use TMC2208 driver modules on it, in UART mode, with Marlin? It's not difficult to set up.
- You'll need to know how to do a little basic soldering.
- You'll want to have good lighting, and a decent magnifier lamp.
- You'll need some basic skill in using a text editor, and understand how to compile Marlin. Try their official guide. It's aimed at Re-ARM, but the process is the same for SKR boards.
- You'll need to make sure you have the PlatformIO TMCStepper library installed. While most folks would recommend using the latest, I strongly suggest trying v0.3.1 first, even if it means downgrading.
- Your PlatformIO framework-arduino-lpc176x platform module must be at v0.1.0 or later.
- You'll need Marlin from their official repository, using the bugfix-2.0.x branch.
You may not necessarily be able to just use any random download/snapshot, so best if you get it from git and jump to a specific point. The following will put you at a point where I know for sure it works. :-) (you could also try commit d8329d85, as that's been confirmed by others as a good working point also):
git clone https://github.com/MarlinFirmware/Marlin.git cd Marlin git checkout bugfix-2.0.x git reset --hard 2513f6b5
Once you've finished this guide and have gotten things to a stable point, you can always try updating Marlin and your TMCStepper library, though if the above combo is working, I see no reason to change it.
When you're sure Marlin and PlatformIO are ready, go ahead and load your Marlin configs into your favorite editor or IDE (you'll do the necessary tweaking later in this Instructable).
If you're using the SKR v1.1 and have an LCD connected, please disconnect it prior to following this guide, just to avoid any possible interference. You can plug it back in later.
You may find that the LCD itself works fine once plugged back in, without any additional configuration beyond what it "should" need, but plugging an SD card into the LCD's card reader may cause things to go awry. This would be because the LCD's SD card reader uses GPIO lines that conflict with the ones the 2208's use (per this guide anyway).
The SKR v1.1's onboard SD card slot works fine and does not conflict with the 2208's, so if worse comes to worst, you could just use its reader instead of the LCD's.
Some pins that may work to drive the 2208s' UART lines in lieu of the ones given later in this guide include whichever end stop lines are unused on your setup (the six lines are P1_24 through P1_29), or the TX pin on AUX1 (P0_02). Gloomyandy did have this last one configured to drive a 2208 running a second extruder in his original pins definitions (though commented-out). There may be other pins on the LCD/SD/SPI header that can be safely shared with the LCD or its SD reader. I have not tested any of these, so comments welcome.
I'll leave it as an exercise to the reader to choose appropriate GPIO pins for the 2208's to keep them and the LCD and/or its SD reader out of each others' way.
- A fine soldering tip would be a very good idea also.
SKR v1.1 users only:
- Some female Dupont connectors (two per driver module). You can find these in a lot of older electronics -- I got mine from old PC cases. You probably have some in your junk box.... er, you DO have a junk box, right?
- If possible, some single-pin Dupont connector housings for the above (one per driver module)
- Some appropriate wire (anything will do as long as it's easy to work with)
- Heat shrink tubing (2 to 3 millimeter size, 2:1 shrink ratio or better, as long as it fits)
SKR v1.3 users only:
- Some shunt jumpers (one per driver module). I refer to the little caps that people routinely call "jumpers", used to temporarily, electrically bridge two pins together. To avoid confusing terms, I'll call these "shunts", as distinct from the pins they go on ("headers", but sometimes called jumpers), or the pads on your driver modules that you'll be soldering on (also called jumpers)
Step 1: Modify Your Driver Modules...maybe
Most driver modules have a two-pad middle jumper.
I use Eryone driver modules (the amber board above), which are basically the same as FYCETC modules, PCB color aside. On those brands, and on many others, there are at least two sets of jumper pads on the underside: one close the STEP, and one close to the middle two pins, of the EN/STEP/DIR header row. There may also be a jumper on the right.
On some TMC2208 modules, the chip and various other parts are on the top of the PCB (like the black PCB pictured above), instead of the bottom like usual. If you have this kind, then if you hold the module with the chip and such facing you, and the potentiometer and test holes to your left, there'll be one set of jumper pads on the right, and one set near the middle. There may also be a jumper on the left.
There are at least two brands that put the chip and such on top (Watterott and BigTreeTech).
In all cases, we're interested only in the set of pads near the middle of the header.
Use your soldering iron to bridge this middle pair of pads together. This will connect the driver chip's PDN/UART signal to the PDN pin on the driver module's header.
In some newer TMC2208 driver modules, this middle jumper has three pads.
On this kind (like the white PCB pictured above), which pair of pads on this jumper should be shorted together technically depends on what SKR version you'll use the module on.
But, let's make it simple: just solder-bridge all three pads together.
This connects the 2208 chip's PDN/UART signal to both the PDN pin on the module's header, and to the unused pin next to it (which is the effect we would have eventually ended up with anyway, were this a two-pad-jumper driver module).
This configuration will work on all types of controller boards, regardless of brand, so long as the controller board still has a standard MS1-3 config block between the driver module's headers. If you have one of the parts-on-top driver modules mentioned earlier, but with a three pad jumper, do the same thing on that one - short all three pads together. I have yet to find an example of this type driver module, but I'm sure they exist, or will soon enough (since the two-pad jumper is the older version).
Some of the latest generation of TMC2208 drivers may already be configured for UART mode.
Such drivers may either come with the PDN/UART jumper already soldered for you, or they might not have a jumper at all, but would clearly be declared by the vendor, seller, or manufacturer as already being set for UART mode.
These may include the "v3.0" driver modules manufactured and sold by BIQU/BigTreeTech (as of mid 2019).
In any case, no soldering is necessary on these kinds of driver modules.
If your drivers have a two-pad jumper:
⬇ Continue to the next step, "Modify Your Driver Modules (Part 2)".
If your drivers are UART-capable, and do not have a two-pad jumper:
⬈ If you're using SKR v1.1, jump ahead to "Patch Things Up".
⬈ If you're using SKR v1.3, jump ahead to "Close Some Circuits".
If your drivers have no PDN/UART jumpers, and have not been clearly and explicitly declared as being already wired for UART mode, then you must assume that they are the really old kind, and thus are NOT UART compatible.
You will not be able to use this old type of driver for this Instructable, unless you have very good soldering skills and dexterity and can safely tap into the PDN/UART pin on the 2208 chip itself.
If that's the case, STOP HERE. You'll either have to hack your way into usability, or get new drivers that can be used with this Instructable.
Step 2: Modify Your Driver Modules (part 2)
If your driver module is of the type with two pads on the middle jumper, then you will need to make a solder bridge on the top side of the driver module to connect the PDN pin to the unused pin next to it on the module's header. This unused pin is most likely unmarked, or may be labeled "NC". On my Eryone modules, the manufacturer put the OpenHardware logo next to it.
We do this because, on the controller board, that unused pin happens to be routed to the MS1-3 jumper header under the driver module, making for a convenient place to pick up the UART signal, without having to muck about with flipping pins to the top side of the driver modules.
⬈ If you're using SKR v1.3, skip ahead to "Close Some Circuits".
⬇ If you're using SKR v1.1, proceed to the next step, "Patch Things Up".
Step 3: Patch Things Up
For SKR v1.1 users only:
You'll need to prepare some simple patch wires, with a female Dupont connector on each end.
Affix the the plastic connector housing to only one end -- leave the other connector bare. Carefully bend that bare one in half backwards, to create a simple right-angle connection (by "backwards", I mean that once bent, you could put a really long pin through the connector part, without hitting the crimped end). Add a drop of solder to the inside of the bend to reinforce it, and shrink a bit of heat-shrink tubing over it for insulation.
For whichever axis you're working on, remove all shunts from the board's MS1-3 config block.
Connect the "right-angle" end of one of these patch wires to pin 5 of the block (it should be clearly marked on the board next to the pin). This would normally be the MS3 signal line on drivers like the A4988 or DRV8825, but TMC2208 driver modules don't use this connection at all, so the soldering we did on the module routed the TMC2208 chip's PDN/UART signal such that we could pick it up from pin 5.
Connect the other end of this wire to an appropriate GPIO pin on the SKR's AUX1 or LCD/SD/SPI header. But just where are these signals? That's explained in the next step! :-)
Step 4: Help Marlin Make the Connection
For SKR v1.1 users only:
You will need to define some pins to match where you connected the patch wires on AUX1 and LCD/SD/SPI. But, there are a few more pins available on the board than you'll need for this project, so you have some leeway here.
This "leeway" can be confusing, though (it didn't do me any favors, to be sure), so to make it simple, I went with gloomyandy's pins definitions, and put the following into src/pins/pins_BIQU_SKR_V1.1.h just before the temperature sensor pins:
#if HAS_DRIVER(TMC2208) #define X_SERIAL_TX_PIN P2_06 // "2.6" on LCD/SD/SPI (aka AUX3) #define X_SERIAL_RX_PIN P2_06 #define Y_SERIAL_TX_PIN P1_31 // "1.31" on LCD/SD/SPI #define Y_SERIAL_RX_PIN P1_31 #define Z_SERIAL_TX_PIN P1_23 // "1.23" on LCD/SD/SPI #define Z_SERIAL_RX_PIN P1_23 #define E0_SERIAL_TX_PIN P0_03 // "RX" on AUX1 #define E0_SERIAL_RX_PIN P0_03 #endif
⬈ Disregard the next step and skip ahead to "Give Your Board Some Intelligence".
Step 5: Close Some Circuits
For SKR v1.3 users only:
Your board already has the internal circuitry needed to route the UART signals between the LPC1768 and the driver modules, and Marlin already has the proper pins definitions for the SKR v1.3. So, the patch wires and pins.h changes mentioned in the previous steps (that you hopefully skipped) are not necessary to use TMC2208's with the SKR v1.3.
Simply plug shunts into the red UARTX, UARTY, etc. headers located next to (and outside of) the driver module headers on the SKR board.
If you have any shunts plugged into the MS1-3/SPI config block for whatever axes you'll be using TMC2208's on, remove them all.
If you have any shunts plugged into the red diagnostic header on the right, next to the two X end stop connectors, remove those, too (this header is not shown in the above photo).
Step 6: Give Your Board Some Intelligence
You will of course need to configure Marlin to be able to do its job, if you have not done so already. For brevity, I've omitted most settings that are commented-out or are either specific to my bot alone, or which don't apply to my bot at all. That is, I've tried to include only the stuff that everyone will need.
Start with these basic settings for Configuration.h to get it to at least talk to your PC properly:
#define SERIAL_PORT -1 //#define SERIAL_PORT_2 -1 #define BAUDRATE 250000
(note that the second serial port is commented-out)
You can use whatever baud rate you want that works with your PC/OS, from the list of suggestions just above that option in the config (not shown here). Faster is generally better, up to a point.
Among those Configuration.h settings, you must set your motherboard type as well:
SKR v1.1 users:
#define MOTHERBOARD BOARD_BIQU_SKR_V1_1
SKR v1.3 users:
#define MOTHERBOARD BOARD_BIGTREE_SKR_V1_3
After that, add whatever other configuration you need that's specific to your printer, i.e. thermistor type, temperature limits, motor steps/mm, speed and acceleration limits, build volume, end stops, and so on.
Backup your SKR's existing firmware (just copy the SD card's contents to somewhere sane), then compile and flash. Make sure the SKR boots up and can talk to the PC reliably over USB.
Step 7: Configure Marlin for Your Driver Modules
You'll need to set Marlin up for TMC2208 regular mode (not "STANDALONE") for whichever axes use them (I have all four; by default, Marlin expects A4988 driver modules), with appropriate settings for current, microstepping, stealthChop, spreadCycle, or Hybrid mode, and so on.
For example, in Configuration.h, I have these settings:
#define X_DRIVER_TYPE TMC2208 #define Y_DRIVER_TYPE TMC2208 #define Z_DRIVER_TYPE TMC2208 #define E0_DRIVER_TYPE TMC2208
...and in Configuration_adv.h, I have these, in various places as appropriate for that config file:
#define MINIMUM_STEPPER_PULSE 1 // 0 is not recommended for TMC2208 anymore.
#define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current #define INTERPOLATE true // Interpolate X/Y/Z_MICROSTEPS to 256 #if AXIS_IS_TMC(X) #define X_CURRENT 600 // (mA) RMS current. Multiply by 1.414 for peak current. #define X_MICROSTEPS 16 // 0..256 #define X_RSENSE 0.11 #endif #if AXIS_IS_TMC(Y) #define Y_CURRENT 600 #define Y_MICROSTEPS 16 #define Y_RSENSE 0.11 #endif #if AXIS_IS_TMC(Z) #define Z_CURRENT 800 #define Z_MICROSTEPS 16 #define Z_RSENSE 0.11 #endif #if AXIS_IS_TMC(E0) #define E0_CURRENT 500 #define E0_MICROSTEPS 16 #define E0_RSENSE 0.11 #endif
#define STEALTHCHOP_XY #define STEALTHCHOP_Z //#define STEALTHCHOP_E
#define HYBRID_THRESHOLD #define X_HYBRID_THRESHOLD 150 // [mm/s] #define Y_HYBRID_THRESHOLD 150 #define Z_HYBRID_THRESHOLD 3 #define E0_HYBRID_THRESHOLD 10
Also, if you have SOFTWARE_DRIVER_ENABLE ... well... enabled, disable that option (comment-out the whole line, including the leading #define ). It doesn't do what you think it does. :-)
Step 8: Finishing-up
Install the driver modules onto their headers.
If your SKR is already able to talk to the computer (for example, if it's brand new and you're just now opening the packaging), set SKR's 5v power shunt to "USB", hook up your USB cable, and wait for the SD card to show up on your computer, and mount/open it.
If it isn't talking to the computer yet, move its SD card to your computer's own card reader, and mount it.
Compile and upload the firmware to that SD card. When you see firmware.bin appear in the card's folder, unmount the SD card, move it back to the SKR if necessary, and reboot the SKR.
Do a quick communications check, send a few commands like M115 or M119 or others that don't require hooking stuff up to the SKR board, just to make sure the firmware is working. If it all looks good, you should now be done with the basic configuration.
Now power-down the SKR, wire-up your printer's main 12/24v power supply, some motors, end stops, heaters, sensors, etc., move the SKR's 5v shunt to "INT", and power back up.
Make sure UART mode is active by sending M122 from your host program (Pronterface, Repetier-host, whatever). You should see something similar to this at the end of the spew in its debug console:
Driver registers: X 0xC0:09:00:00 Y 0xC0:0A:00:00 Z 0xC0:08:00:00 E 0x80:09:00:00 Testing X connection... OK Testing Y connection... OK Testing Z connection... OK Testing E connection... OK
If that came out okay (i.e. nothing says ALL LOW or otherwise implies that there's some fault), check that your motors work, and run in the right directions.
If so, you may now begin routine calibrating and printing.
Enjoy your 32-bit goodness! :-)
As an aside: when you get a chance, you should also adjust the driver modules' potentiometers to set fallback currents, just in case the UART feature craps out some time (e.g. if a connector gets pulled out).
Step 9: Credits and Notes
- This Instructable was inspired by "UART This!" by seansadler.
- jammi clued me in to the UART-on-MS3 method via his RAMPS-oriented imgur guide, sure beats unsoldering and/or flipping pins around!
- The drawing of the pinouts of the SKR v1.1 came from BigTreeTech's public Github repository, modified by me.
- The photo of the TMC2208 module with three-pad PDN/UART jumper was cribbed from an Aliexpress listing, enhanced and modified by me.
- The photo of the TMC2208 module with everything on the top side of the PCB was "borrowed" from a Github thread, enhanced and modified by me.
- All other photos used in this Instructable are entirely my own work.
Fair Use rationale:
Try as I might, I could not find a single, clean image with a free-use license, of either of the two driver module types mentioned immediately above. Only non-free, low quality sources were to be found. Per the "four fair use factors" set forth in US copyright law:
1. Both images are used in a non-commercial, non-profit manner, purely for educational purposes (though I have no control over what Autodesk does with them outside of this Instructable).
2. The original images were published and deliberately made accessible to anyone on the Internet, without any kind of account, password, or other obvious means of access control.
3. The images as obtained from the sources above were low-quality. They have been cropped to just the modules themselves, and then scaled, enhanced, and annotated by me. Due to the nature of the technology, using anything less than the full module images currently shown in this Instructable could lead to confusion, defeating the purpose of their use entirely.
4. These images have no obvious possibility to disrupt the market in which they were originally used, and no preference for one brand over any other(s) is intended.
About the connector and wire colors:
Shortly after I got my SKR, I killed it by accident while probing around on it. But a while before that happened, I swapped the motor and endstop connectors around so that X is red, Y is green, and Z is blue, to match what you see in most 3d modeling programs, then color-coded my patch wires to match. Since I still have that board in my junk box, I just went ahead and used it for most photos, just so that I didn't have to pull my good, working board out of the printer. The white patch wire seen in some photos is just an extra I had lying around.
The working board is shown in the final image since since I needed a "complete, installed" photo at that point, and while it has "correct" wire colors, it has "incorrect" connector colors. My OCD isn't quite triggered enough to overcome my laziness. ;-)