beautypg.com

Rainbow Electronics AT75C310 User Manual

Page 127

background image

AT75C310

127

B fiqvec

; FIQ

;

-----------------------------------------------------------------------------

; Entry point.

;-----------------------------------------------------------------------------

InitReset

; Setup the SVC mode and stack pointer on the top of the internal RAM

mov rO, #ARM - MODE_SVC:OR:I_BIT:OR:F_BIT ; No interrupts

msr cpsr, rO

ldr r13, =RAM-LIMIT

;------------------------------------------------------------------------------

; Configure USARTO with the following parameters:

;

Baud Rate 9600

;

Mode:

1 Stop bit, Even Parity, 8 Data Bits, Clock = MCKI

;

Channel = Normal Mode

;------------------------------------------------------------------------------

ldr rl,

USARTO-CR-Reg

; Disable and Reset the Transmitter and Receiver

ldr r2,

= OXAC

str r2,

[r1]

ldr rl,

USARTO_MR-Reg

; Set up the mode register with the

ldr r2,

= OXCO

; parameters given above.

str r2,

[r1]

ldr rl,

USARTO_ID_Reg

; Disable All Interrupts

ldr r2,

= Ox7FF

str r2,

[r1]

ldr rl,

USARTO_BR_Reg

; Setup the Baud Rate to 9600bps

ldr r2,

= Ox9C

str r2,

[r1]

ldr rl,

USARTO_CR.Reg

; Enable the transmitter and receiver

ldr r2,

= Ox5O

str r2,

[r1]

;-----------------------------------------------------------------------------

; Read Modem Status and check that DSR is set. If it is not set then remap

;-----------------------------------------------------------------------------

ldr rl, USARTO-ModS_Reg

ldr r2, [rl]

tst r2, #Ox2O

beq remap

;-----------------------------------------------------------------------------

; Set RTS which indicates to the other end that we have seen the DSR and can proceed.

;-----------------------------------------------------------------------------

ldr rl, USARTO_ModC_Reg

ldr r2, =OxO2

str r2, (r1]

;-----------------------------------------------------------------------------

; Setup a value in r6 for the TIMEOUT. If this value goes to zero then this

; code performs a REMAP booting from CSO.

;-----------------------------------------------------------------------------

ldr r6, = WAIT_TIME

;-----------------------------------------------------------------------------

; Read the Initial sequence from the USART. The code will branch to REMAP if

; it has to wait for longer than approx 3 secs, or if any of the received

; characters are incorrect.

;---------------------------------------------------------------------------