An apparatus for automatically adjusting the margin of an operating impedance for an operating circuit, the operating circuit having a plurality of discrete, selectively adjustable impedance values associated therewith, the apparatus comprising:
- a reference circuit, said reference circuit having a test impedance value applied thereto, said test impedance value being controlled by a binary count;
- a counter for incrementing and decrementing said binary count;
- a first storage device, coupled to an output of said reference circuit, said storage device storing a signal which controls the direction of said binary count;
- incrementing said binary count if said reference circuit is in said first state and decrementing said binary count if said reference circuit is in said second state, thereby increasing said applied test impedance value if said binary count is incremented and decreasing said applied test impedance value if said binary count is decremented;
- determining a condition in which said reference circuit oscillates between said first state and said second state;
- a second storage device, said second storage device storing a pair of binary count values, one of said pair of binary count values representing a first impedance value which causes said reference circuit to change from said first state to said second state, the other of said pair of binary count values representing a second impedance value which causes said reference circuit to change from said first state to said second state;
- and
- an adder for adjusting the lower of said stored pair of binary count values so as to create a buffered count;
- wherein the desired operating impedance for the operating circuit corresponds to said buffered count.