AN114 Xicor, AN114 Datasheet - Page 2

no-image

AN114

Manufacturer Part Number
AN114
Description
Interfacing the X9408/X9418 XDCP to 8051 Microcontrollers
Manufacturer
Xicor
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
AN1149FHKEBV
Manufacturer:
PANASONIC/松下
Quantity:
20 000
80C51 MICROCONTROLLER ROUTINES FOR MANIPULATING AN X9408
;-----------------------------------------------------------------------------
;
; 80C51 MICROCONTROLLER ROUTINES FOR MANIPULATING AN X9408
;
;
;
;
;
;
;
;
;
; This code provides basic 80C51 code for commmunicating with and
; controlling the X9408 quad digital potentiometer. In this listing
; is code that implements all of the available X9408 instructions.
; The X9408 communicates via a 2-wire bus that is similar, but a little
; different from the I2C bus. This code is very generic and can be
; simplified and shortened by removing any unnecessary routines.
;
; For those instructions which program the nonvolatile data registers
; (XFR_WCR, GFXR_WCR, and WRITE_DR) this program provides acknowledge
; polling to determine early completion of the internal write cycle.
; Although this is handled automatically by the routines, some background
; might be helpful.
;
; After issuing a start condition, the master sends a slave address
; and receives and acknowledge (ACK). The master then sends an instruction
; byte to the X9408 and again receives an ACK. If necessary, the master sends
; a data byte and receives a final ACK. The master then initiates a stop
; condition to signal the X9408 to begin an internal nonvolatile write
; cycle. When the write cycle begins, the I/O pins go to a high impedance state
; and remain in this state until the nonvolatile write is complete.
;
; Immediately following the stop condition, the master can begin acknowledge
; polling by successively sending start conditions, followed by "dummy"
; instructions. When the X9408 finally answers with an acknowledge, the
; internal write cycle is completed. The master then issues a stop
; condition. After the next start condition, the X9408 is ready to receive
; further instructions.
;
master can now begin acknowledge polling by succes-
sively sending start conditions followed by "dummy"
instructions. When the X9408/X9418 finally answers
with an acknowledge, the internal write cycle has been
completed. The master must then initiate a stop condi-
tion. After the next start condition, the X9408/X9418 is
ready to receive further instructions.
In the code listing, an assumption was made that the code
executes upon a reset of the microcontroller. That is, the
code is loaded into low memory, however this can be
changed with an ORG assembler directive. Simple
MAIN program routines are included in the code listing.
These can be modified for different device addresses,
different registers and different DCPs within the device.
REV 1.1 11/12/02
FILE NAME : X9408_8051.TXT
TARGET MCU:
DESCRIPTION:
(C) XICOR INC. 2002
Cygnal C8051F000
QUAD EEPOT
Application Note
www.xicor.com
CEM
In this listing, the commands cause an X9408/X9418 (at
A3A2A1A0 = 1100 to be accessed.) The listing also
includes some instructions that are specific to the Cygnal
80C51 processor. These should be examined and modi-
fied, as needed, for the specific 80C51 in the system. The
commands issued in the “Main” section of the code are
simple assignment and call sequences.
In Figure 1, a representative hardware connection
between the X9408 and an 8051 family microcontroller
is shown. The pull-up resistors on the SDA and SCL
lines are determined by the total capacitance of all of the
devices connected to the bus, which is about 18pF.
AN 114
2 of 12

Related parts for AN114