AN1241 Motorola Semiconductor Products, AN1241 Datasheet - Page 17

no-image

AN1241

Manufacturer Part Number
AN1241
Description
Interfacing the Mc68hc705j1a to 9356/9366 Eeproms
Manufacturer
Motorola Semiconductor Products
Datasheet
*** Subroutine to write 16 bit data ******************************************
J9356_WR_DATA
*
J9356_LOOP4
J9356_L4_2
*
J9356_L4_3
***
J9356_RD_DATA
*
J9356_LOOP3
J9356_L3
*
*
J9356_WAIT
J9356_W2
AN1241/D
Write the serial output pin with data
Clock the serial clock pin
Subroutine to read 16 bit data ***************************************
Read the serial input pin
Clock the serial clock pin
Wait until write cycle is over
ldx
brclr
bset
bra
bclr
bset
bclr
asl
rol
decx
bne
rts
ldx
brclr
rol
rol
bset
bclr
decx
bne
rts
bset
clra
sta
brclr
bclr
rts
Freescale Semiconductor, Inc.
For More Information On This Product,
#16T
7,DATA_H,J9356_L4_2
SER_OUT,PORTA
J9356_L4_3
SER_OUT,PORTA
SER_CLK,PORTA
SER_CLK,PORTA
DATA_L
DATA_H
J9356_LOOP4
#16T
SER_IN,PORTA,J9356_L3 ;carry bit = serial in
DATA_L
DATA_H
SER_CLK,PORTA
SER_CLK,PORTA
J9356_LOOP3
CS,PORTA
COPR
SER_IN,PORTA,J9356_W2
CS,PORTA
Go to: www.freescale.com
;init counter for LOOP4
;ser_out = 1
;goto L4_3
;ser_out = 0
;ser_clk = 1
;ser_clk = 0
;rotate the DATA_L
;rotate the DATA_H
;decrease counter loop
;is LOOP4 finished?
;return
;init counter for LOOP3
;rotate left result
;ser_clk = 1
;ser_clk = 0
;decrease counter loop
;is LOOP3 finished?
;return
;CS line is high
;kick the wdog
;CS line is low
;return
;if addr bit7 = 0, goto L4_2
17

Related parts for AN1241