English
Language : 

AN114 Datasheet, PDF (1/12 Pages) Xicor Inc. – Interfacing the X9408/X9418 XDCP to 8051 Microcontrollers
Application Note
AN 114
Interfacing the X9408/X9418 XDCP to 8051 Microcontrollers
by Applications Staff,
This application note describes the routines for the
control of an X9408 or X9418 digitally controllable
potentiometer. The X9408/X9418 devices have a variety
of different instructions that provide flexibility to the
designer. Additionally, the nonvolatile nature of the
device allows for stored wiper positions that can be
retrieved after power cycles.
The following code implements all of the available
X9408/X9418 instructions using a standard bi-direc-
tional bus protocol. Although the subroutines occupy
about 300 bytes of program memory, designers who
won't need to implement all of the instructions can
shorten the code by removing any unnecessary routines.
However, this will necessitate the reassembly of the
code.
For those instructions which program the nonvolatile
data registers (XFR_WCR, GXFR_WCR, &
WRITE_DR), acknowledge polling has been imple-
mented to determine an early completion of the internal
write cycle. Although this is automatically handled by
the routines, a word or two regarding the procedure
should be informative. After issuing a start condition, the
master sends a slave address and receives an acknowl-
edge. It then issues an instruction byte to the X9408/
X9418 and again receives an acknowledge. If necessary,
it now transmits the data byte and receives a final
acknowledge. The master must then initiate a stop condi-
tion which will cause the X9408/X9418 to begin an
internal write cycle. The X9408/X9418 pins go to high
impedance until this internal cycle is complete. The
REV 1.1 11/12/02
+5V
R1
R2
10K
10K
U1
39
38
P0.0
37
36
P0.1
P0.2
35 P0.3
34
33
P0.4
P0.5
32 P0.6
P0.7
12
13 INT0
17
10
INT1
RD
14
15
RXD
T0
11 T1
16
TXD
WR
19
18
X1
X2
31
9
EA/VP
RST
80C51
P1.0
1
2
P1.1
P1.2
3
4
P1.3 5
P1.4
P1.5
6
7
P1.6 8
P1.7
21
P2.0 22
P2.1
P2.2
23
24
P2.3
P2.4
25
26
P2.5 27
P2.6
P2.7
28
ALE/P
PSEN
30
29
U2
17
7
SCL
SDA
18
5
8
A3
A2
20 A1
A0
19 VSS
VH0
3
4
VW0
VL0
2
10
VH1
VW1
11
9
VL1
VH2
15
14
VW2 16
VL2
22
VH3
VW3
21
23
VL3
VCC
1
24
V+
V-
13
X940
8
-5V
Figure 1. Connecting the X9408 to an 80C51 microcontroller
www.xicor.com
1 of 12