|
620 | 620 | #endif
|
621 | 621 |
|
622 | 622 | #if HAS_TMC_UART
|
623 |
| - |
624 | 623 | /**
|
625 |
| - * Address for the UART Configuration of the TMC2209. Override in Configuration files. |
626 |
| - * To test TMC2209 Steppers enable TMC_DEBUG in Configuration_adv.h and test the M122 command with voltage on the steppers. |
| 624 | + * TMC2208/TMC2209 stepper drivers |
| 625 | + * It seems to work perfectly fine on Software Serial, if an advanced user wants to test, you could use the SAMD51 Serial1 and Serial 2. Be careful with the Sercom configurations. |
| 626 | + * Steppers 1,2,3,4 (X,Y,Z,E0) are on the Serial1, Sercom (RX = 0, TX = 1), extra stepper 5 (E1 or any axis you want) is on Serial2, Sercom (RX = 17, TX = 16) |
627 | 627 | */
|
628 |
| - #ifndef X_SLAVE_ADDRESS |
| 628 | + |
| 629 | + //#define X_HARDWARE_SERIAL Serial1 |
| 630 | + //#define Y_HARDWARE_SERIAL Serial1 |
| 631 | + //#define Z_HARDWARE_SERIAL Serial1 |
| 632 | + //#define E0_HARDWARE_SERIAL Serial1 |
| 633 | + //#define E1_HARDWARE_SERIAL Serial2 |
| 634 | + |
| 635 | + // Default TMC slave addresses |
| 636 | + #ifdef X_SLAVE_ADDRESS |
| 637 | + static_assert(X_SLAVE_ADDRESS == 0b00, "X_SLAVE_ADDRESS must be 0b00 for BOARD_BRICOLEMON_V1_0."); |
| 638 | + #else |
629 | 639 | #define X_SLAVE_ADDRESS 0b00
|
630 | 640 | #endif
|
631 |
| - #ifndef Y_SLAVE_ADDRESS |
| 641 | + #ifdef Y_SLAVE_ADDRESS |
| 642 | + static_assert(Y_SLAVE_ADDRESS == 0b01, "Y_SLAVE_ADDRESS must be 0b01 for BOARD_BRICOLEMON_V1_0."); |
| 643 | + #else |
632 | 644 | #define Y_SLAVE_ADDRESS 0b01
|
633 | 645 | #endif
|
634 |
| - #ifndef Z_SLAVE_ADDRESS |
| 646 | + #ifdef Z_SLAVE_ADDRESS |
| 647 | + static_assert(Z_SLAVE_ADDRESS == 0b10, "Z_SLAVE_ADDRESS must be 0b10 for BOARD_BRICOLEMON_V1_0."); |
| 648 | + #else |
635 | 649 | #define Z_SLAVE_ADDRESS 0b10
|
636 | 650 | #endif
|
637 |
| - #ifndef E0_SLAVE_ADDRESS |
| 651 | + #ifdef E0_SLAVE_ADDRESS |
| 652 | + static_assert(E0_SLAVE_ADDRESS == 0b11, "E0_SLAVE_ADDRESS must be 0b11 for BOARD_BRICOLEMON_V1_0."); |
| 653 | + #else |
638 | 654 | #define E0_SLAVE_ADDRESS 0b11
|
639 | 655 | #endif
|
640 |
| - #ifndef E1_SLAVE_ADDRESS |
| 656 | + #ifdef E1_SLAVE_ADDRESS |
| 657 | + static_assert(E1_SLAVE_ADDRESS == 0b00, "E0_SLAVE_ADDRESS must be 0b00 for BOARD_BRICOLEMON_V1_0."); |
| 658 | + #else |
641 | 659 | #define E1_SLAVE_ADDRESS 0b00
|
642 | 660 | #endif
|
643 | 661 |
|
644 |
| - /** |
645 |
| - * TMC2208/TMC2209 stepper drivers |
646 |
| - * It seems to work perfectly fine on Software Serial, if an advanced user wants to test, you could use the SAMD51 Serial1 and Serial 2. Be careful with the Sercom configurations. |
647 |
| - * Steppers 1,2,3,4 (X,Y,Z,E0) are on the Serial1, Sercom (RX = 0, TX = 1), extra stepper 5 (E1 or any axis you want) is on Serial2, Sercom (RX = 17, TX = 16) |
648 |
| - */ |
649 |
| - |
650 |
| - //#define X_HARDWARE_SERIAL Serial1 |
651 |
| - //#define Y_HARDWARE_SERIAL Serial1 |
652 |
| - //#define Z_HARDWARE_SERIAL Serial1 |
653 |
| - //#define E0_HARDWARE_SERIAL Serial1 |
654 |
| - //#define E1_HARDWARE_SERIAL Serial2 |
655 |
| - |
656 |
| - #define TMC_BAUD_RATE 250000 |
| 662 | + // Reduce baud rate to improve software serial reliability |
| 663 | + #ifndef TMC_BAUD_RATE |
| 664 | + #define TMC_BAUD_RATE 19200 // 250000 |
| 665 | + #endif |
657 | 666 |
|
658 | 667 | //
|
659 | 668 | // Software serial
|
|
0 commit comments