Rainbow Electronics AT75C310 User Manual
Page 128

AT75C310
128
bl rx-poll-timed
cmp r2, #Ox16
bne remap
;
; A synch has been received look for the rest of the activation sequence
;
bl rx_poll_timed
cmp r2, #Ox42
bne remap
bl rx_poll_timed
cmp, r2, #Ox6f
bne remap,
bl rx_poll_timed
cmp r2, #Ox6f
bne remap,
bl rx_poll_timed
cmp r2, #Ox74
bne remap
bl rx_poll_timed
cmp r2, #Oxl6
bne remap
;Activation sequence received send the response
mov r2, #Ox16
bl sendbyte
mov r2, #Ox52
bl send_byte
mov r2, #Ox4f
bl send_byte
mov r2, #Ox4d
bl send_byte
mov r2, #Oxl6
bl send_byte
; Read the 16 bit length most significant byte first
bl rx_poll mov r3, r2, LSL #8
bl rx_poll
add r3, r3, r2
; Respond with the received length
mov r2, r3, lsr #8
bl sendbyte
mov r2, r3
bl send_byte
; Put the downloaded code in the SRAM
mov r6, #RAM_BASE
;-----------------------------------------------------------------------------
; Now download all the code bytes. Every time a byte is read it is X’ored with
; the previous total to get a checksum. Each group of four bytes is shifted in
; to form a word which is then copied to the Oak PRAM.
;-----------------------------------------------------------------------------
mov r5, #0
cmp r3, #0
read.loop
beq sendcsum
; Read 4 bytes to form a little endian 32 bit value
bl rx_poll
eor r5, r5, r2
mov r4, r2
bl rx_poll