Some thoughts about wiring things up. Ideally, we would have a single cable going out of DaVeGa that we can connect either to VESC or to the USB-UART adapter for programming.
There are 5 pins on VeGa:
The VESC connects to the first 4. The USB connects to all.
Here’s the pinout of the devices to be wired up (for the VESC, this is how my ESCapes look like; I think that other VESC derivatives have a different pin order, but that doesn’t really matter):
Now, one option is to simply split 4 wires and add two connectors. That’s what I have done here. But, it’s pretty annoying having to split 4 wires and you end up with the dupont connector dangling around all the time when it’s only used rarely.
An alternative would be to make an adapter. It’s natural to go from more wires to fewer wires, i.e. from USB to VESC. But, that wouldn’t be very reliable since the dupont connectors tend to slide off. Plus, the device that’s plugged-in most of the time (the VESC) would go in via an adapter. Not ideal.
We can go the other way around, but that means the DTR wire would need to be separate. It’s not a problem to connect the 6 pin USB-UART to two (1+5 pin) dupont connectors. This would work just fine. We would end up with only a 1 pin dangling connector. No Y-splits needed.
An even better option would be to connect all 5 VeGa pins to the VESC and then make a simple adapter to the 6 pin dupont without the stand-alone wire for DTR. I think that it should be OK to connect the DTR to one of the VESC’s ADC pins. DTR is high (5V) in a normal state, but I believe the ADC pins are not used for anything by default. The only problem would be if the ADC is pulled low since that would reset the VeGa, but that shouldn’t happen. Could someone with a better knowledge of the VESC HW please confirm this? @Kug3lis maybe? Thanks! I know this is a hackish solution, but it seems the simplest and most elegant.
Last but not least, it’s not necessary to connect the DTR at all. Then we would need an extra button for resetting VeGa manually. It’s not hard to reset manually at the right moment when updating the FW. Still, it’s an extra button.