Skip to content
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

TMC2209 + RP2040 chip - no way to get it working #78

Open
fryc88 opened this issue Jul 14, 2024 · 5 comments
Open

TMC2209 + RP2040 chip - no way to get it working #78

fryc88 opened this issue Jul 14, 2024 · 5 comments

Comments

@fryc88
Copy link

fryc88 commented Jul 14, 2024

At the start i must say i'm total new with arduino ide, so i might be doing something wrong, however i'm trying to use 3d printer board for other purpose, but by all means i can't get it working.
There's RP2040 chip built in, 2x TMC2209, so i would assume tmc2209 lib for arduino ide. I'm not bothered about two, i'm not even bothered about using them in full uart mode, just normal step/dir would be fine too, but that way i couldn't get it working either
[https://github.com/FYSETC/FYSETC-ERB/blob/main/V1.0/hardware/Schematic.pdf](board schematics)

So from examples i've tried software serial, that wont even compile because of lack of soft serial library (?).
image
Any other options will give me similar results while trying to compile, all errors are related to lack of serial.

image

Could you tell me if that's related to RP2040 & you addon missing something, or am i missing something here?

@peterpolidoro
Copy link
Member

I have never used one of these boards, but I am curious to see if we can get it working.

I added an example examples/UnidirectionalCommunication/TestRP2040/ and bumped this library version to 9.4.1. Please try this example and see if you can get it to run on your board.

The schematic shows that only a single RP2040 UART pin is connected to each TMC2209 so only unidirectional commands will work. Since there are no RX pins the RP2040 cannot receive any information from each TMC2209.

The UART pins are not the usual pins reserved for UART0 and UART1 so you can use SerialPIO instead of SerialUART. SoftwareSerial could work, but SerialPIO should be much faster and is preferable.

You will need to add your own code if you want to use the step and direction pins on the RP2040. My example code simply calls moveAtVelocity to test to see if it can get the motors to move. I do not know how large of motors you are using and your power supply voltage so you may need to adjust the run current.

@fryc88
Copy link
Author

fryc88 commented Jul 14, 2024 via email

@fryc88
Copy link
Author

fryc88 commented Jul 16, 2024

Hi,
I tried to compile above, but again i have serial related error:
image

I can't even see any libraries for SerialPIO or SoftwareSerial, but neither of them work. Is there anything else that i need to add to Arduino IDE in order to use above?

EDIT:
I actually added another boards based on RP2040 chips and tried couple of them, and one of them goes through the compilation with your example, I'll flash it and see what happens next.

Thing that I'm trying to build is respooler for 3d printer. It was built using simplified way, however I don't have necessarily components, that's why I tried to use what I had in my hands. Motor will be not-too-large nema17, for now it's all on bench power supply, so at the end I'll figure out voltage and current what I need for it.
I also know in 3d printers firmwares, current on this kind of boards can be set via software.
https://makerworld.com/en/models/448008?from=search#profileId-354782

@fryc88
Copy link
Author

fryc88 commented Jul 16, 2024

Ok, so I've tried literally all boards from this library:
https://github.com/earlephilhower/arduino-pico/tree/master

Neither of them do anything, however only this library for 2040 does go through the compilation in Arduino IDE. There are other two rp2040 libraries that I've found available, but neither of them will compile, both showing serial issue.
Now I'm thinking why is that happening, I don't fully understand differences between boards, I would assume chip is chip, and as long as hardware connections are set properly then it should work, but it looks like I'm very wrong. I did ask author of that library for any suggestions, maybe he will have some ideas, as I'm pretty much clueless at this stage.

@peterpolidoro
Copy link
Member

Sounds like the Arduino IDE might not be setup properly. You need to make sure you have the correct board and dependencies.

You can also try using platformio instead of the Arduino IDE. I have an example platformio file at the root of the directory. That should automatically download the dependencies for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants