Welcome! Log In Create A New Profile

Advanced

UART connection not working

Posted by d.romeo 
UART connection not working
October 19, 2020 12:52PM
UART seems not to work with TMC2208 / 9, M122 command always returns "BadConnection" error. I have read that many, especially for the first experiences, encounter this error. I have carried out several serial tests, all with satisfactory results, except for the M122 one, which should verify that everything has been done correctly.

My tests

printer: LK4 pro;
mainboard: LGT_KIT_V1.0 based on RAMPS;
IC: atmega2560
Marlin: 2.0.7 readjusted for my model, source [https://github.com/mrv96/Alfawise-U30-Pro-Longer-LK4-Pro-Marlin-2-Stock-Mainboardreste(url)
drivers: TMC2208 / TMC2209, both with 1k internal resistance, this excludes any error related to
self-made UART / PDN adapters, so I only use 2 simple jumper cables without any modification;
serial type: both hardware and software

* tested the serial connection for the 2 drives using the script [https://learn.watterott.com/silentstepstick/configurator//2009(url) and a FTDI, working;
* tested the serial connector of the board, both software and hardware, by means of 2 serial monitors per board <---> FTDI, successful in both directions
* tested several free pins, including those of Serial3 (14,15)
* for each pair of pins I also tried the opposite combination, to avoid distraction errors RX <-> RX ...
* touchscreen connected and disabled, check the files MarlinCore.cpp, stepper.cpp, trinamic.cpp, try different combinations of software settings
* tried with the original copy of the firmware with the original settings of the link mentioned above, modifying only the minimum necessary, modified 2 pins and changed the Z stepper from standalone to uart
* right now I am also trying the bugfix 2.0.x version updated today without different results
* I'm running out of other ideas ...

My settings regarding steppers
#define Z_SERIAL_TX_PIN 14 and others
#define Z_SERIAL_RX_PIN 15 and others
#define Z_DRIVER_TYPE TMC2209 / 8
#define SOFTWARE_DRIVER_ENABLE (defined not defined)
#define TMC_DEBUG
and many other possible setting combinations ...

Could you help me? Thank you.
Re: UART connection not working
October 20, 2020 03:55AM
Way to many variables.

please attach configs (and other modified files) of one version that you think should work that doesn't
Re: UART connection not working
October 20, 2020 07:23PM
These are my settings, I've rearranged them for my convenience. The pin settings in the UART section are the last ones I've tried, I haven't reset them.
Of course I also tried the original configuration of the link mentioned above, modifying only the minimum necessary to enable the UART connection.
Attachments:
open | download - Marlin.zip (63.1 KB)
Re: UART connection not working
October 20, 2020 11:39PM
So many warnings...

you have

#define Z_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define Z_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
Ie redefining Z_MIN_ENDSTOP_INVERTING

you have

#define X_SLAVE_ADDRESS 0
#define Y_SLAVE_ADDRESS 1
#define Z_SLAVE_ADDRESS 2
#define E0_SLAVE_ADDRESS 3

this is only used with tmc2209 when they share serial ports. if you don't set the address with ms1,ms2 to match you can't talk to it.

and whats with
#define X_MIN_PIN -3
#define X_MAX_PIN -2

-1 is disabled -2 and -3 are invalid.

you also have SOFTWARE_DRIVER_ENABLE in advances.
this will kill all movement on these drivers.

now finally at the point of actually trying it
Sorry, only registered users may post in this forum.

Click here to login