Replies: 1 comment 3 replies
-
The hardware is improperly designed, and connects the RS485 pin to the wrong port pin. On the DB32, the available USART mapping options are PA0-3 (XDIR on PA3) or PA4-7 (XDIR on PA7), PC0-3 (XDIR on 3), PF0-PF3 (XDIR on PF3), and PF4/5 with no XDIR/XCK mapping. Refer to table 3.1 I/O multiplexing and considerations. PC2 is not an option for xdir. This is not implemented in software, it is implemented in hardware. The #define is only there in order to tell the software which pin needs to be set output when they have RS485 mode enabled. Time to cut and jump for now and fix your design. Always double check table 3.1 I/O Multiplexing before you get the boards made. I've tried it both ways and the other way just doesn't work well. |
Beta Was this translation helpful? Give feedback.
-
Hi there,
I have some hardware based around the 128DB32, with an RS485 Transceiver on USART1. (PC0 => TXD, PC1 => RXD) . Unfortunately this specific hardware has the TX enable / !RX enable pins hard wired to PC2.
I believe that HWSerial handles enabling/disabling Transmission and Receiving? and I've noticed that XDIR for HWSERIAL_1 is defined as PIN_PC3.
#define PIN_HWSERIAL1_XDIR PIN_PC3
For my specific hardware I would want to remap this PC2 which coincidently is currently what USART1 XCK is currently defined as.
#define PIN_HWSERIAL1_XCK PIN_PC2
I was wondering what the best method could be for using PC2 as the XDIR pin?
Thanks for any suggestions? :)
Beta Was this translation helpful? Give feedback.
All reactions