This topic will help you use the Stepstick TMC2130 Stepper drivers with Megatronics. The setup is fairly easy, but the wiring may become a bit messy, as there is quite some extra wires necessary. The TMC2130 use SPI to allow the Microprocessor to communicate with the driver and set Microstepping settings for example. For more information on the features of the chip, please check the TMC2130 datasheet.
TMCStepper Arduino library (Find it using Manage libraries, from the Arduino Menu)
First you need to hook up the wirring. SPI works with four wires: Data (Master -> Slave or MOSI), Data (Slave -> Master or MISO), Clock (SCK) and Chip Select (SS, CSN or CS). The Chip select wiring determines which device is active, only one device can be active at a time, so if you are using SD and a LCD for examples, they should be quiet and not listen when talking to a stepper driver. There is one chip select wire for each device, while the MISO, MOSI and SCK wire can be connected in parallel. The Stepsticks have a description on the back on how to connect them: Data in (SDI), Clock (SCK), Chip select (CSN) and Data out (SDO). Note that Data In is to be connected to the master data out (MOSI), while Data Out should got to MISO.
Megatronics support SPI in the SDOUT header, but it can be used to hook up a external SD or LCD, so it it more convenient to use the ICSP header. Chip select can be connected to any digital I/O and can be changed in the firmware. So you may use the I/Os from the keypad header too. But in this example we will use AUX3. Review the following wiring schema:
The blue wire is MOSI, purple is Clock,green is MISO and the orange wires are Chip select.The Chip select wire go to AUX3 pins 3-6 in this example.
That's it for the wiring. In the firmware we need to setup some things. In this example we will look at MK4Duo, but other firmwares work about the same. In the Megatronics v3 pin mapping files (MK4duo/src/boards/703.h) change the CS_PIN definitions for each stepper driver to the I/Os you choose. If you used the wiring above, this will work:
That's it. If you get a compilation error, verify that the TMCStepper driver library is installed. Connecting to the Megatronics board shoul give message that the stepper drivers got connected upon startup:
Info:echo:MK4duo_4.3.7_beta echo:Last Updated: Nov 13 2018 16:23:14 | Author: (none, default config) echo:Compiled: Nov 13 2018 echo:Free Memory: 4121 PlannerBufferBytes: 1184 echo:stepperX connect! echo:stepperY connect! echo:stepperZ connect! echo:stepperE0 connect! echo:Factory Settings Loaded Config: G21 ; Units in (mm)
Dispatch same business day!
2.000+ products available from stock
More than 25.000 satisfied customers in over 40 countries
Secure payment for all payment options
Professional tech support (over 9 years 3D experience)
25.000+ satisfied customers
Pay safely using
ReprapWorld is the number one webshop for all your reprap supplies for your 3D printer. We have a large collection of 3D printer components, from our famous electronics lines to filament from our own production. And everything is at a very competitive price!