I'm working on some devices that will talk to each other over CAN. The simple idea is to daisy chain essential signals between each device: power (+12V and ground), enable and CAN high / low.
Now, there main two problems I have with introducing this daisy-chaining set up are node addressing and bus termination. My current solution to these two problems are:
Current Solutions
Node Addressing
I'd have some sort of switch (analog switch, MOSFETs, something) break the CAN bus between the input connector and output connector of every device. They would be, at start up, configured to essentially only be "attached" to the input connector portion of the bus wiring. Thus, when all devices power up, node #1 (connected directly to the master node) will be the only node connected, and will be able to pull an address. Once a node pulls an address, it closes its bus wiring switches and lets the next node connect. The master keeps assigning IDs until it determines no other nodes are out there waiting.
Bus Termination
I have worked up a way to use extra pins in the connectors as a "sense" signal... driving a voltage to the output connector and seeing it if comes back (each device shorts the pins on their input connectors) to tell us if we are the end of the bus or not.. and whether we should apply termination.
What I'm Not Sure On / Want To Make Better
Using Analog Switches
The analog switch thing works conceptually, but the electrical aspect confuses me. For example, a lot of the bit rate charts you see for CAN are referenced by how long the network is... this makes total sense. Harder to drive a signal farther without repeating, etc. Now, my confusion is... would an analog switch, with it's inherently high (compared to raw wire) resistance be killing my maximum bit rate on the bus?
From calculating it out, if my bus was entirely 20AWG wire... adding in an analog switch with a really low Ron (lowest I've found is 0.3 ohms so far) to each node to provide the circuitry to do node addressing would be the equivalent of adding an extra ~30 feet of wiring for every node. Am I overestimating the impact these switches would have? The bus is already terminated at each end by 120 ohm termination resistors so it's not adding a ton in terms of the passive bus resistance... but calculating it in terms of how much extra wiring it appears as makes it seem bad.
Remote Node Sensing
Also, as far as sensing remote nodes.... I'd like to avoid an approach that relies on using dedicated pins in the connectors. Long story short, being able to ditch the sense pins lets me save money on a lower pin count connector AND it lets me switch to thicker wiring which means I can carry more power and support more end nodes. I'd also like to be able to slightly reduce the component count of the driving/receiving circuitry of the sense functionality which involves a lot of passives, zeners for clamping, discrete logic ICs, etc.
So... thoughts? :)