-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] TMC 2130 does not work in SPI mode #24516
Comments
You may end up using the TMC2130s in standalone mode. Is there a SPI only feature you need from these chips? TMC_USE_SW_SPI assumes all SPI interfaces have a common TMC_SW_MOSI, TMC_SW_MISO & TMC_SW_SCK with dedicated chip selects. I see the dedicated chip selects but not the others. I'm not aware that Marlin has the ability to control/use the 74HC595 shift registers. I'm thinking this request is outside the scope of this forum. This is dedicated to Marlin bug fixes. There are a couple of Facebook Marlin support goups (3Dtechtalk is one) plus a RepRap one that are better suited to this type of question. |
Which SPI actually used for TMC? If you try using one shared with flash i wouldn't expect it to work at all. |
@Bob-the-Kuhn esp32 has built into the HAL shit register support, to extend the number of IO pins. |
I'm amazed at what they've been able to do with the ESP32 platform. Definitely a world I haven't explored. |
CS on extended pins should be possibe anyway, with hw or sw SPI (though no idea if current code/framework can do arbitrary CS pins for HW SPI) |
I understand that there is probably limitation in using shift registers in Marlin with current code, but if you support SPI drivers and settings current via SPI, I should be (at least) able to communicate with driver.
ESP-IDF change in last 4 years so it is possible to control CS pin via I2S and shift registers. FluidNC has code for that. I would like to help to resolve this, but I would need some point where to start as I do not know how Marlin internally works. |
|
LOL, this much is obvious. Please read about esp-idf SPI peculiarities. |
I finally figured out what was my problem. After a lot of testing I found out that I can not toggle CS pin at TMC driver if this pin is driven with shift register and I2S. When I control just STEP and DIR pin via I2S and use some GPIO for CS pin, it works as expected. Does anyone know code for I2S? I will try to make PR for documentation with my findings as it will definetely help other people. |
esp-idf framework is not aware about I2S pins, you'll have to redefine/overload any SPI CS related functions in HAL to use them |
This issue has had no activity in the last 60 days. Please add a reply if you want to keep this issue active, otherwise it will be automatically closed within 10 days. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Did you test the latest
bugfix-2.1.x
code?Yes, and the problem still exists.
Bug Description
I designed custom board for FluidNC, but find out that there is not support (and it is not planned) for features which I need for my pick and place machine so I decide to switch to Marlin.
My board is based on ESP32 andn it is using 74HC595 shift registers to control stepper motors, but issue which I´m facing now is that I can not establish connection via SPI. This is defintely SW issue as if I upload FluidNC firmware, all axis are working fine.
Here is my log from Printerface:
I searched issues here, searched Discord channels (looked for "I2S", "All LOW", "All HIGH"), but did not find solution.
I tried use TMC_USE_SW_SPI, tried put X CS pin on real HW pin, but without change. I´m using BIGTREETECH TMC2130 V3.0 .
As I´m using custom board definition, I´m including files so you can compile same code as me.
marlin_configs.zip
I ordered ESP PROG so I will be hopefully able to use debugger and see what FW is doing.
Thanks for help or any direction.
Bug Timeline
No response
Expected behavior
No response
Actual behavior
No response
Steps to Reproduce
No response
Version of Marlin Firmware
Marlin bugfix-2.1.x (Jul 18 2022 02:26:39)
Printer model
none
Electronics
custom board
Add-ons
No response
Bed Leveling
No response
Your Slicer
No response
Host Software
Pronterface
Don't forget to include
Configuration.h
andConfiguration_adv.h
.Additional information & file uploads
No response
The text was updated successfully, but these errors were encountered: