AN114 Xicor, AN114 Datasheet - Page 7

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
gxfr_wcr:
inc_wiper:
;-----------------------------------------------------------------------------
;
; NAME: instr_gen (Instruction generator)
; FUNCTION: Issues appropriate I2C protocol for each X9408 instruction
; INPUTS: ADDR_BYTE, ID, PULSES, DPTR, DATA_BYTE
; OUTPUTS: DATA_BYTE
; CALLS: start_cond, stop_cond, send_byte, send_bit, get_byte, polling
; AFFECTED: DATA_BYTE, A, COUNT
;
;-----------------------------------------------------------------------------
instr_gen:
case6:
wiper_lp:
case4:
case2:
case1:
case3:
REV 1.1 11/12/02
mov
orl
mov
mov
call
ret
mov
orl
mov
mov
call
ret
call
mov
call
jc
mov
call
jc
clr
jmp
mov
anl
mov
mov
anl
call
djnz
jmp
mov
call
jmp
call
jmp
mov
call
a,ID
a,#080h
ID, a
dptr,#case5
instr_gen
a,ID
a,#020h
ID,a
dptr,#case6
instr_gen
start_cond
a,ADDR_BYTE
send_byte
stop_gen
a,ID
send_byte
stop_gen
a
@a +dptr
a,PULSES
a,#00111111b ; A <- Bits 0 0 D5 D4 D3 D2 D1 D0
COUNT, a
a,PULSES
a,#10000000b ; A <- Bits DIR 0 0 0 0 0 0 0
send_bit
COUNT,wiper_lp ; Continue until all pulses are sent
stop_gen
a,DATA_BYTE
send_byte
stop_gen
get_byte
stop_gen
a,DATA_BYTE
send_byte
; Get bits R1 R0 x x
; Append to the GXFR WCR instruction code
; Save the result
; Jump to the addr for this instruction
; Get bits x x P1 P0
; Append to the Incr Wiper instruction code
; Save the result
; Jump to the addr for this instruction
; Issue an I2C start condition
; Send X9408 slave/address byte
; if NACK, end...
; Send X9408 instruction byte
; if NACK, end...
; Reset offset before jump
; Jump to various instruction cases
; A <- Bits DIR X D5 D4 D3 D2 D1 D0
; Save as the number of pulses
; Send the bit (a single pulse)
; If program gets here, then it is done
; Send X9408 data byte
; Receive X9408 Data Byte
; Send X9408 Data Byte
Application Note
www.xicor.com
AN 114
7 of 12

Related parts for AN114