There are currently 9 free available pins on the 40pin extension header
- IO2 (W5500 CLK)
- IO42 (W5500 CS)
- IO41 (W5500 MOSI)
- IO40 (W5500 MISO)
- IO39
- IO38
- IO45
- IO21
If necessary,
- ZDATA
- ZCLK
- U0TX
- U0RX
could also be used.
That leaves us with 8 (or 12) free pins available for extensions.
Bus requirements:
- BiDiB, RS485 transceiver, 3 pins (RX/TX,DIR) or 2 pins with auto DIR
- CAN, transceiver, 2 pins
- LocoNet, 2 pins, a comparator for reception and a FET for transmission?
- Ethernet, W5500, SPI so 4 pins
LocoNet
Collision detection is PITA. I really don't want to to bit level detection... The standard says byte level detection is ok, but that means we'd need to read the UART RX buffer after every byte transmitted!
Here's a link to some schematic: https://mrrwa.org/loconet-interface/
And there is also this group: https://groups.io/g/LocoNet-Hackers/topics
I wonder if RS485 mode on the ESP32S3 could be used... this mode features a UART_RS485_CLASH_INT interrupt and can automatically detect collisions.
There are currently 9 free available pins on the 40pin extension header
If necessary,
could also be used.
That leaves us with 8 (or 12) free pins available for extensions.
Bus requirements:
LocoNet
Collision detection is PITA. I really don't want to to bit level detection... The standard says byte level detection is ok, but that means we'd need to read the UART RX buffer after every byte transmitted!
Here's a link to some schematic: https://mrrwa.org/loconet-interface/
And there is also this group: https://groups.io/g/LocoNet-Hackers/topics
I wonder if RS485 mode on the ESP32S3 could be used... this mode features a
UART_RS485_CLASH_INTinterrupt and can automatically detect collisions.