-
Notifications
You must be signed in to change notification settings - Fork 23
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
Add shared UART with analog commutator and ChipSelect pin #2
base: master
Are you sure you want to change the base?
Conversation
Looks good. I'll merge it soon and then make some minor stylistic changes. |
I'm testing this patch with Arduino Due, 74HC4066, 74HC125 and a bunch of 2208 (4 pieces). That turned out to be more tricky than I expected, so please postpone merge a little bit ... |
Well, preliminary tests (like in examples folder) on Arduino Due are over and successfull. Though I have to admit, that wasted 3 days just because though that if function returns boolean then it is an indicator whether it succeeds or no. But turned out that it's not always true :). I'm talking about functions that read driver's registers and return 0 if CRC is ok and 1 otherwise. May be this should be clarified in the readme ? |
I believe it's quite common for 0 to be "ok" and then 1, 2, 3.. to be different errors. |
Well, I assumed (as per readme) that boolean true == CRC is okay. |
The TMCStepper is already pushed on github but it's still WIP and I haven't added it to the Arduino Library Manager. At first I aim to support TMC2130, TMC5130 and TMC2660. Then TMC2208 and TMC2224 come after because they use UART instead of SPI. The new library will support everything the old ones do but the interface will change a bit for UART communication. I can merge this later this week and it'll also be part of the TMCStepper library in the future. |
My fault - I'm new to github and mistook "popular" for "all" repos. Will look forward for new library! |
Small patch to enable use of shared UART with analog commutator like 77HC4066 for multiple TMC2208 drivers. This might be suitable for platforms like Arduino Due which don't have software UART library implementations.
In this scenario drivers should be connected as shown on TMC2208 datasheet (https://www.trinamic.com/fileadmin/assets/Products/ICs_Documents/TMC220x_TMC222x_Datasheet.pdf), page 22, figure 4.2. And ChipSelect pins (port pins in the datasheet) should be defined and used in TMC2208Stepper class constructors.
Examples compile for both avr and due architectures, so I guess, that "avr-only" limitation can be shifted.