參數(shù)資料
型號: AN1759
廠商: 飛思卡爾半導(dǎo)體(中國)有限公司
英文描述: Add a Non-Volatile Clock to the MC68HC705J1A
中文描述: 添加非易失時鐘的MC68HC705J1A
文件頁數(shù): 23/24頁
文件大小: 316K
代理商: AN1759
Application Note
Code Listing
AN1759
23
CLOCK_IT
bset
bclr
decx
bne
SCL,SER_PORT
SCL,SER_PORT
;SCL=1
;SCL=0
;decrement counter
WRITE
* Check for ACK
bclr
bset
brclr
SDA,DDRA
SCL,SER_PORT
SDA,SER_PORT,J2
;SDA is input
;SCL=1
;if SDA=0, slave ACK
ACK_ERROR
bra
ACK_ERROR
;no slave ACK, error loop
J2
bclr
bset
rts
SCL,SER_PORT
SDA,DDRA
;SCL=0
;SDA is output
;return from sub
*** Routine clocks the DS1307 to read data from SDA, MSB first
*** 8 bit contents are put in AccA
*** Generates ACK back to slave
RXD
bclr
SDA,DDRA
ldx
#8T
;make the SDA pin on J1A input
;set counter
READ
bset
brclr
rola
bclr
SCL,SER_PORT
SDA,SER_PORT,J3
;SCL=1
;carry bit = SDA
;put carry bit into AccA MSB
;SCL=0
J3
SCL,SER_PORT
decx
bne
;decrement counter
READ
* ACK back to slave
bset
bclr
bset
bclr
rts
SDA,DDRA
SDA,SER_PORT
SCL,SER_PORT
SCL,SER_PORT
;make the SDA pin on J1A output
;SDA=0
;SCL=1
;SCL=0
;return from sub
*** Routine clocks the DS1307 to read data from SDA, MSB first
*** 8 bit contents are put in AccA
*** Generates NO ACK back to slave, signals last read to DS1307
RXD_LAST
bclr
SDA,DDRA
ldx
#8T
;make the SDA pin on J1A input
;set counter
READ_LAST
bset
brclr
rola
bclr
SCL,SER_PORT
SDA,SER_PORT,J4
;SCL=1
;carry bit = SDA
;put carry bit into AccA MSB
;SCL=0
J4
SCL,SER_PORT
decx
bne
;decrement counter
READ_LAST
* NO ACK back to slave
bset
bset
bset
bclr
rts
SDA,DDRA
SDA,SER_PORT
SCL,SER_PORT
SCL,SER_PORT
;make the SDA pin on J1A output
;SDA=1
;SCL=1
;SCL=0
;return from sub
*** VECTOR TABLE *******************************************************************
ORG
RESET
DW
START
F
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
.
相關(guān)PDF資料
PDF描述
AN1768 ADMISSIBLE AVALANCHE POWER OF SCHOTTKY DIODES
AN1775 Expanding Digital Input with an A/D Converter
AN1816 USING THE HC912B32 TO IMPLEMENT THE DISTRIBUTED SYSTEMS INTERFACE (DSI) PROTOCOL
AN2104 Using Background Debug Mode for the M68HC12 Family
AN2154FAP TV/Video Signal Processor
相關(guān)代理商/技術(shù)參數(shù)
參數(shù)描述
AN175C25A 制造商:NEW SURPLUS HARDWARE 功能描述:
AN176-20A 制造商:AN# - MILITARY 功能描述:
AN176-40 制造商:AN# - MILITARY 功能描述:
AN1768 制造商:未知廠家 制造商全稱:未知廠家 功能描述:ADMISSIBLE AVALANCHE POWER OF SCHOTTKY DIODES
AN176H22A 制造商:NEW SURPLUS HARDWARE 功能描述: