CAN is multi-master network, working very good to connect single sensors and actors like in a vehicle. Had that in mind when designing my board, too, but it has two disadvantages: a data packet is limited to 8 bytes (fix) and it’s quite difficult/expensive to connect it to Windows.
Unlike CAN, RS485 has direct support from Windows/AOG, because AgIO not even notices, whether the Nano is couples by USB or by RS485. I just made a smoke test, works out of the box for my autosteer module with an $0.99 USB-RS485-Stick:
RS485 can build a network very similar to UDP, but with minimal hardware efford and no need to config anything. As mentioned, AgIO as master would have to support time slots or (much easier) to concatenate packets to all modules to one, when talking to more than one module.
Modules need to have a cheap RS485 driver and to support half-duplex. Three options: hardware patch, clever driver or simply with some extra lines of software to control the direction of the driver like that (search for “&&&&”): Autosteer_USB_20_CMPS14_twistable.ino.txt (26,1 KB)
On my board, I needed to add the following connections:
- pin 6, U7 = 0V (disabling U7)
- pins 2,3, U8 = pin 26, U5 (data direction via Arduino-output A3)
- pin 1, U8 = pin 30, U8 (RxD of µC)
- pin 4, U8 = pin 31, U8 (TxD of µC)