I am designing a circuit involving an LTC4316, which is configured by providing one of sixteen analog voltages on each of the XORH and XORL pins to set the upper and lower nibbles of its configuration byte (which for the specific chip, is the I2C address translation mask).
Ordinarily, for a device with a single fixed I2C address, I would follow the procedure laid out in the datasheet to arrive at appropriate resistor values for a resistor divider. However, for this device, this needs to be settable by the user or installer. My prototype involved using a potentiometer and providing test points for the user to probe to set the voltage, but this is not a very user-friendly procedure; it would be much better to provide a set of discrete DIP switches and some passive resistors.
The datasheet provides the following table for what voltage ratio the configuration pin needs to be placed at for the different configuration values:
| addr | ratio Vin/Vcc |
| ---- | -------------- |
| 0000 | ≤ 0.03125 |
| 0001 | 0.09375 ±0.015 |
| 0010 | 0.15625 ±0.015 |
| 0011 | 0.21875 ±0.015 |
| 0100 | 0.28125 ±0.015 |
| 0101 | 0.34375 ±0.015 |
| 0110 | 0.40625 ±0.015 |
| 0111 | 0.46875 ±0.015 |
| 1000 | 0.53125 ±0.015 |
| 1001 | 0.59375 ±0.015 |
| 1010 | 0.65625 ±0.015 |
| 1011 | 0.71875 ±0.015 |
| 1100 | 0.78125 ±0.015 |
| 1101 | 0.84375 ±0.015 |
| 1110 | 0.90625 ±0.015 |
| 1111 | ≥ 0.96875 |
(Note that these are not volts, they're unitless multiples of the input supply voltage.)
Essentially, this is just splitting the range between 0.0 to 1.0 into 16 equal intervals, with the 0.015 tolerance allowing you to hit anywhere in the middle 48% of each interval.
The input impedance of the pins here is really very high -- the datasheet's table also includes recommendations for resistances in a fixed divider, and for e.g. 0111 it recommends using an 887k / 1M.
Note that the voltage levels I need to achieve are not ones I am able to specify myself. There is no programmable uC, and there are no additional voltage supplies other than Vcc and ground.
Technically, I don't need the dip switch positions to map neatly to separate bits. The board already has a silkscreened table of DIP switch positions vs the translated addresses of the on-board devices, and this table can be shuffled into any order if there's a clever scheme that can produce these voltages in some order other than the usual one.
An R-2R ladder would be able to achieve a compatible set of evenly-spaced voltages, but the classic design requires inputs driven both to the high and low voltages -- meaning more expensive dual-throw DIP switches rather than the common single-throw type. Given the high input impedance, using low-value pullups and high-value ladder resistance values could work, but irritatingly the voltages an R2R ladder produces are off by half a step, going from one rail to one step shy of the other rather than something from the middle 48% of each step.
An arrangement that makes use of only a small number of distinct resistor values would be nice, but resistors are cheap -- and as long as I can make do with only basic values, having them assembled is cheap too.
How can I achieve this type of analog voltage configuration in a way that's settable from a DIP switch, using only passive resistance values?