Datasheet

© 2006 Microchip Technology Inc. DS21945E-page 29
MCP4021/2/3/4
5.0 SERIAL INTERFACE
5.1 Overview
The MCP4021/2/3/4 utilizes a simple 2-wire interface to
increment or decrement the digital potentiometer’s
wiper terminal (W), store the wiper setting in non-vola-
tile memory and turn the WiperLock technology feature
on or off. This interface uses the Chip Select (CS
) pin,
while the U/D
pin is the Up/Down input.
The Increment/Decrement protocol enables the device
to move one step at a time through the range of
possible resistance values. The wiper value is
initialized with the value stored in the internal EEPROM
upon power-up. A wiper value of 00h connects the
wiper to terminal B. A wiper value of 3Fh connects the
wiper to terminal A. Increment commands move the
wiper toward terminal A, but will not increment to a
value greater than 3Fh. Decrement commands move
the wiper toward terminal B, but will not decrement
below 00h.
Refer to Section 1.0 “Electrical Characteristics”,
AC/DC Electrical Characteristics table for detailed input
threshold and timing specifications.
Communication is unidirectional. Therefore, the value
of the current wiper setting cannot be read out of the
MCP402X device.
5.2 Serial Commands
The MCP402X devices support 10 serial commands.
The commands can be grouped into the following
types:
Serial Commands
High-voltage Serial Commands
All the commands are shown in Table 5-1.
The command type is determined by the voltage level
on the CS
pin. The initial state that the CS pin must be
driven is V
IH
. From V
IH
, the two levels that the CS pin
can be driven are:
•V
IL
•V
IHH
If the CS
pin is driven from V
IH
to V
IL
, a serial
command is selected. If the CS pin is driven from V
IH
to
V
IHH
, a high-voltage serial command is selected.
High-voltage serial commands control the state of the
WiperLock technology. This is a unique feature, where
the user can determine whether or not to “lock” or
“unlock” the wiper state.
High-voltage serial commands increment/decrement
the wiper regardless of the status of the WiperLock
technology.
TABLE 5-1: COMMANDS
Command Name
Saves
Wiper
Value in
EEPROM
High
Voltage
on CS
pin?
After
Command
Wiper is
“locked”/
”unlocked”
Works
when
Wiper is
“locked”?
Increment without Writing Wiper Setting to EEPROM ——unlockedNote 1
Increment with Writing Wiper Setting to EEPROM Yes unlocked Note 1
Decrement without Writing Wiper Setting to EEPROM ——unlockedNote 1
Decrement with Writing Wiper Setting to EEPROM Yes unlocked Note 1
Write Wiper Setting to EEPROM Yes unlocked Note 1
High-Voltage Increment and Disable WiperLock Technology Yes Yes unlocked Yes
High-Voltage Increment and Enable WiperLock Technology Yes Yes locked Yes
High-Voltage Decrement and Disable WiperLock Technology Yes Yes unlocked Yes
High-Voltage Decrement and Enable WiperLock Technology Yes Yes locked Yes
Write Wiper Setting to EEPROM and Disable WiperLock
Technology
Yes Yes unlocked Yes
Write Wiper Setting to EEPROM and Enable WiperLock
Technology
Yes Yes locked Yes
Note 1: This command will only complete if wiper is “unlocked” (WiperLock Technology is Disabled).