AN114 Xicor, AN114 Datasheet - Page 10

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
;-----------------------------------------------------------------------------
;
; NAME: stop_cond (Stop condition)
; FUNCTION: Issues an I2C bus stop condition
; INPUTS: NONE
; OUTPUTS: NONE
; CALLS: NONE
; AFFECTED: SDA, SCL
;
;-----------------------------------------------------------------------------
stop_cond:
;-----------------------------------------------------------------------------
;
; NAME: ack_send (Send Acknowledge)
; FUNCTION: Sends an acknowledge bit to complete SDA line data reads
; INPUTS: NONE
; OUTPUTS: NONE
; CALLS: send_bit
; AFFECTED: A
;
;-----------------------------------------------------------------------------
ack_send:
;-----------------------------------------------------------------------------
;
; NAME: polling (Acknowledge polling for XFR_WCR, WRITE_DR, GXFR_WCR)
; FUNCTION: Sends dummy commands to X9408 during an internal write cycle
;
; INPUTS: ADDR_BYTE
; OUTPUTS: NONE
; CALLS: start_cond, send_byte
; AFFECTED: C
;
;-----------------------------------------------------------------------------
polling:
again:
REV 1.1 11/12/02
clr
ret
clr
setb
nop
nop
nop
nop
setb
ret
clr
call
ret
so that the end of the cycle is marked by an acknowledge
call
mov
call
jc
ret
SCL
SDA
SCL
SDA
a
SEND_BIT
START_COND
a,ADDR_BYTE
SEND_BYTE
POLLING
;Complete clock pulse
; Pull SDA LOW and hold
; Pull SCL HIGH and hold
; Pull SDA HIGH (SCL=HIGH)
; A <- LOW (Sending a 0)
; Send the bit!
; Re-establish I2C protocol
; Attempt to send a dummy command
; If C=1, then there was no ACK
Application Note
www.xicor.com
AN 114
10 of 12

Related parts for AN114