Theres something different with the pullup/pulldown on the P2 thats causing communication to not work. I am able to successfully send data to the driver, but am unable to receive any replies from it, so I cannot query any registers or anything like that.
This chip is kind of strange where both TX and RX go to the same pin on the IC itself, with a 1k in between them. See following post for screenshot (I can’t upload more than two pictures as a new user)
I’m guessing that the P2 is also pulling the pins in different directions, and the IC is no longer able to drive the line low enough when sending data. See the following scope output:
Is this expected behavior? Was I just lucky with the Argon? Is there any software pullup i can manipulate on the Serial3 pins, or is it hardwired in some way to allow it to also be SPI?
I can provide code and equivalent schematics of what I’m doing of that helps diagnose.
Hmm, not having luck on that, I think its complicated by the fact that the TX/RX are bridged at the IC, so the pullup on the TX pin is also affecting the line level of the RX.
Is there a way to turn off the pullup on both the TX and RX and let the device control the line direction?
(I’m using Serial3, I think those are the right pins, D16 = RX, D15 = TX)
Setting the TX to OUTPUT makes the serial non-functional which I think is heartening that the settings are “sticking,” but is not yielding the desired results, hah.
I don’t think the pull-up on TX should make a difference. The reason is that once in UART mode, the TX pin is push-pull so it will always drive the pin either high or low in full-duplex mode overriding any pull resistance.
The P2 doesn’t support half-duplex mode, but neither did the Argon. TX pull could make a difference in half-duplex mode.
@willdueease Can you try lowering the value of the 20K pull down on UART to something like 4.7K?
That should provide more current to pull down the RX line.
I’m not sure, but Diodes or buffers might also do the trick to isolate RX/TX.
Unfortunately for me that 20k pulldown is not easily changeable on the off-the-shelf module (well, 0402’s are a bit out of MY comfort zone anyways!)
That said, I’ve tried putting some pulldowns of various values onto the RX pin of the module on my breadboard (electrically I think this is the same thing? anything I add will be in parallel with the 20k, but I can still arrive at a target resistance), and it seems to mostly just shift the whole signal around. If I put a strong enough pulldown where the troughs of the RX signal is in the right voltage to be read as bits, the TX no longer works, as it’s too low now.
I’ll look into some kind of buffering/diode hardware solution.
Is half duplex support on the roadmap? or removing the pullup at the HAL layer?
Thanks for the help! I was also kind of surprised by the weird semi-custom one wire serial that Trinamic implemented, and was (happily) surprised when it…just worked…on the Argon, hah.
FWIW I also tried connecting these devices through the recommended SC16IS750 I2C/UART Extender, and had similar behavior. They have an RS485 mode, but the TMC220x isn’t actually RS485 it’s their own weird thing.
Anyways, thanks again for the help, I’ll look into external circuits and report if get anything working, lmk if eng has any input.
I can report that I am now able to communicate with my TMC2209 modules.
For anybody else who wants to use these modules, this is the hardware setup that I have working:
Two FYSETC TMC2209 V4.0 modules, in “daisy chain” configuration where both modules TX/RX are connected to Serial 3 port of the P2. This allows one serial port to control two modules, provided that the address pins (MS1, MS2) are configured to be unique. This is how I have them configured: