A while ago, I wrote a post about choosing the resistor values for setting ADDR on the MCP23018. At work, we make use of pumps by a company called EMP, which produces a range of CAN-controlled pumps. The pumps have three pins on the LV connector that allow you to change the address of the pump between 0x88 and 0x97. This looks like a good way to get additional addresses on my hardware projects with limited pin requirements. The specific addressing for the EMP WP150 high-voltage pump is as follows.
| Address Input 1 | Address Input 2 | Address Input 3 | CAN Address |
|---|---|---|---|
| Open | Open | Open | 0x88 |
| Open | Ground | Open | 0x89 |
| Ground | Open | Open | 0x8A |
| Open | Open | Ground | 0x8B |
| Ground | Ground | Open | 0x8C |
| Open | Ground | Ground | 0x8D |
| Ground | Open | Ground | 0x8E |
| Ground | Ground | Ground | 0x8F |
| Open | Power | Ground | 0x90 |
| Power | Open | Open | 0x91 |
| Ground | Power | Opne | 0x92 |
| Power | Ground | Open | 0x93 |
| Open | Power | Ground | 0x94 |
| Power | Open | Ground | 0x95 |
| Ground | Power | Ground | 0x96 |
| Power | Ground | Ground | 0x97 |
| NOTE: Address input 1 and address input 2 do not support sensing shorting of both pins to power. Address input 3 does not support sensing short to power. | |||
This means that by taking a single pin on a connector can have three states: either power, ground, or open circuit. The EMP has some rules about pins not being able to be used in some combinations, which is why they only list 16 addresses.
An advantage of making the addressing a function of the wiring of the connector, rather than either a software configuration or DIP switches, is that it allows for quick replacement of FRUs (Field Replaceable Units), and reduces the risk of misconfigurations.
CAN Addressing Component layout
Making some assumptions, I think the internal circuit looks something like this. I have wired the connection for 0x95 per the table above. I don’t know why they have the limitation on the pin assignments; it may be an optimisation due to the number of components they have used internally or the number of Analogue and Digital pins they have available on their ASIC.
The circuit I have drawn out below can use the entire 27 address space (3×103 addresses). The +5 VDC rail was drawn for convenience, and could just as easily be a 3V3 rail; the diodes are used for voltage clamping and also make up part of the ESD protection. The diode pairs could be replaced with a single BAT54S SOT-23 diode, which would reduce the component count.

Number of addresses vs pin count
Having three states gives you a higher address space count per number of addressing pins than just having two states; you could get higher density using the hardware version numbers circuit, but that is harder to implement just using splices on the supply cable.
| Address Pin Count | Available Addresses |
|---|---|
| 1 | 3 |
| 2 | 9 |
| 3 | 27 |
| 4 | 81 |
| 5 | 243 |
| 6 | 729 |
Looking at the above table, three address pins with 27 addresses available in the address space seems like a sweet spot.
Spice Model of Addressing pin
I have modelled a single channel of the above circuit in Falstad. I have made some assumptions, and the spice is not guaranteed to be 100% representative, as the spice models are quite simplified. The value of 10 kOhm reisisors mean theat the forward current of the diode when connected to 12 VDC is limited to about 0.7 mA (far below its rated 200 mA forward current).
If there was a guarentee the the voltage was the same on the connector side as the supply to the microcontroller, and ESD protection was not required. The clamping diodes could be omitted.
This circuit could also be used as a replacement for the hardware version numbers circuit, allowing more versions with just the placement of a few zero-ohm resistors rather than changing the values of multiple resistors.
If you are looking to use this circuit as is in an automotive environment, please note that the design has not been specified to survive the requirements of LV124 and will need to be assessed against that standard.
Layout with the addition of a CAN termination resistor
If you are using this addressing system on a CAN, RS-485, DMX or another communication system that requires termination resistors, you can use an additional pin on the connectors to allow for automatic correct inclusion of a termination resistor when the FRUs are wired into the data bus, again reducing the risk of user error.
