2000 Microchip Technology Inc. DS11195A-page 17
MCP41XXX/42XXX
5.0 SERIAL INTERFACE
Communications from the controller to the
MCP41XXX/42XXX digital potentiometers is done
using the SPI serial interface. This interface allows
three commands:
1. Write a new v alue to the potentiometer data reg-
ister(s).
2. Cause a channel to enter low power shutdown
mode.
3. NOP (No Operation) command.
Executing any command is done by setting CS low,
and then clocking in a command byte followed by a
data byte into the 16-bit shift register. The command is
executed when CS is raised . Data is clocked i n o n the
rising edge of clock and out the SO pin on the falling
edge of the clock. See Figure 5-1. The device will track
the number of clocks (rising edges) while CS is low and
will abort all commands if the number of clocks is not a
multiple of 16.
5.1 Command Byte
The first byte sent is always the command byte, fol-
lowed by the data byte. The command byte contains
two command select bits and two potentiometer select
bits. Unused bits are don’t care bits. The command
select bits are summarized in Figure 5-2. The com-
mand select bits C1 and C 0 (bits 4:5) of th e command
byte determine which command will be executed. If the
command bits are both 0’s or 1’s, then a NOP com-
mand will be executed after all 16 bits have been
loaded. This command is useful when using the daisy-
chain configurat ion. When the co mmand bits are 0,1 a
write command wil l be executed with the 8 bits sent in
the data byte. The data will be written to the potentiom-
eter(s) determined by the potentiometer select bits. If
the command bits are 1,0 then a s hutdown command
will be executed on the potentiome ters determined by
the potentiometer select bits.
For the MCP42XXX devices, the potentiometer select
bits P1 and P0 (bits 0:1) deter mine which pote ntiome-
ters are to be acted upon by the command. A corre-
sponding one in the position signifies that the
command for that potentiome ter will get execute d and
a zero signifies that the command will not effect that
potentiometer. See Figure 5-2.
5.2 Writing Data Into Data Registers
When new data is written into one or more of the poten-
tiometer data regis ters, the write c omm and is followed
by the data byte for the new value. The command
select bits C1, C0 are set to 0,1. The potentiometer
selection bits P1 and P0 allow new values to be written
to potentiome ter 0, potentiome ter 1 or both with a sin-
gle command. A o ne for either P1 or P0 wi ll cause the
data to be written to the res pective da ta register and a
zero for P1 or P0 will cause no change. See Figure 5-2
for the command format summary.
5.3 Using The Shutdown Command
The shutdown command allows the user to put the
application circuit into a power saving mode. In this
mode, the A terminal is open circuited and the B and W
terminals are shorted together. The command select
bits C1, C0 are set to 1,0. The potentiometer selection
bits P1 and P0 allow each potentiometer to be shut-
down independently. If either P1 or P0 are high, the
respective potentiometer will enter shutdown mode. A
zero for P1 or P0 will have no effect. The eight data bits
following the command byte still need to be transmitted
for the shutdown command but they are don’t care bits.
Se e Fi gu r e 5-2 for com ma n d fo rmat sum ma ry. Once a
particular potentiometer has entered the shutdown
mode, it will remain in this mode until:
•A new value is written to the potentiometer data
register, provided that the SHDN pin is high. The
device will remain in the shutdown mode until the
rising edge of the CS is detected, at which time
the device will come out of shutdown mode and
the new value will be written to the da ta regis-
ter(s). If the SHDN pin is low when the new value
is received, the registers will still be set to the new
value, but the device will remain in shutdown
mode. This scenario assumes that a valid com-
mand was received. If an invalid command was
received, the command will be ignored and the
device will remain in the shutdown mode.
It is also possible to use the hardware shutdown pin
and reset pin to remove a device from software shut-
down. To do this, a low pulse on the chip select line
must first be sent. For multiple devices, sharing a single
SHDN or RESET line, allows you to pick an individual
device on that chain to remove from software shutdown
mode. See Figure 1-3 for timing. With a preceding chip
select pulse, either of these situations will also remove
a device from software shutdown:
•A falling edge is seen on the RS pin and held low
for at least 150ns, provided that the SHDN pin is
high. If the SHDN pin is low, the registers will still
be set to mid-scale but the device will remain in
shutdown mode. This condition assumes that CS
is high, as bringing the RS pin low while CS is low
is an invalid state and results are indeterminate.
11195A.book Page 17 Tuesday, November 7, 2000 2:06 PM