You cannot control the overall resistances in the parallel arrangement (where each MOSFET or relay is in series with each resistor) as well as in the series arrangement (where each MOSFET or relay is in parallel with each resistor).
Consider the case where you have three resistors, A, B, C, and therefore eight different states:
- 0 = Open Open Open: Disconnected
- 1 = Closed Open Open: Total resistance is A
- 2 = Open Closed Open: Total resistance is B
- 4 = Open Open Closed: Total resistance is C
- 3 = Closed Closed Open: Total resistance is A//B = 1/(1/A + 1/B) = AB/(A+B)
- 5 = Closed Open Closed: Total resistance is A//C = 1/(1/A + 1/C) = AC/(A+C)
- 6 = Open Closed Closed: Total resistance is B//C = 1/(1/B + 1/C) = BC/(B+C)
- 7 = Closed Closed Closed: Total resistance is A//B//C = 1/(1/A + 1/B + 1/C) = ABC/(AB + AC + BC)
In particular, if A = B = C = 1, the seven finite resistances are 1, 1, 1, 1/2, 1/2, and 1/3; yielding three unique ones: 1.000, 0.500, and 0.333.
If A=1, B=2, C=4, the seven finite resistances are 1, 2, 4, 2/3, 4/5, 4/3, 4/7; yielding 0.571, 0.667, 0.800, 1.000, 1.333, 2.000, 4.000.
If A=1, B=2, C=3, we get 0.545, 0.667, 0.750, 1.000, 1.200, 2.000, 3.000.
Simply put, your resolution at the low end will always be better than at the high end, because of how parallel resistances behave.
In particular, if your N resistances are R/2
n = 2
-nR, n=0..N-1, then you can obtain resistances R/k, k=1..2
N-1.
Compare to the series configuration with N resistances 2
nR, n=0..N-1, which yields resistances Rk, k=1..2
N-1.
The serial configuration is superior, because with N resistors R, 2R, 4R, ..., 2
N-1R, you can produce any resistance between 0 and 2
NR - R, inclusive, at a resolution of R. Furthermore, these can be built from resistors all having the same value, putting several in series-parallel configuration (although it is easier if you have two to four different values).
For example, let's say you want 256 steps, or eight shortable (via MOSFET or relay) resistance steps, from 0 to 255R, inclusive, using 4-8 resistors of 8R or 16R each:
- R: eight 8R resistors in parallel
- 2R: four 8R resistors in parallel
- 4R: four 16R resistors in parallel
- 8R: two pairs of two 8R series resistors in parallel
- 16R: two pairs of two 16R series resistors in parallel
- 32R: four 8R resistors in series
- 64R: four 16R resistors in series
- 128R: eight 16R resistors in series
for a total of 20 individual 8R resistors and 20 individual 16R resistors. With 4 4R, 12 8R, 12 16R, and 4 32R resistors, each would consist of exactly four resistors.
With R=12.5Ω –– linear 12.5Ω steps up to 3187.5Ω ––, you'd need 32 resistors: 4×50Ω, 12×100Ω, 12×200Ω, 4×400Ω. If you have resistors with the same resistance from different batches, and a precise resistance measurement, you can hand-tune the resistances to get very good resolution.
(Note that with 11 steps, 100%/2
11 = 100%/2048 ≃ 0.05%, so you'd need the highest resistor set to be exact to within 0.025%, to keep the midway step (the 50% glitch where you switch from 10 lowest to only the highest) within 0.25R and 0.75R. With 8 steps, 100%/2⁸=100%/256≃0.39%, so the highest step overall resistance should be within 0.2% or so. Because series resistors are easier to select, it can make a lot of sense to use twice the number of resistors for the largest resistance.)
When switching resistances, I would recommend always opening the short (enabling resistors) before adding new shorts (shorting resistors), doing the switch in two steps. This means that switching from cocccccc to occccccc you actually do cocccccc → oocccccc → occccccc, with enough delay in between to stabilise the switching transistors or relays. This way, you always 'glitch' toward higher resistance. If you have a glitch that temporarily has very low resistance (for example, cocccccc → cccccccc → occccccc, you have a
near zero-ohm short, cccccc, for a short while), the resistance could be so low it damages your voltage/current source.