25.08.2015 Views

UM10139

UM10139 Volume 1: LPC214x User Manual - Fab@Home

UM10139 Volume 1: LPC214x User Manual - Fab@Home

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Philips SemiconductorsVolume 1<strong>UM10139</strong>Chapter 24: RealMonitor; * Setup Vectored Interrupt controller. DCC Rx and Tx interrupts; * generate Non Vectored IRQ request. rm_init_entry is aware; * of the VIC and it enables the DBGCommRX and DBGCommTx interrupts.; * Default vector address register is programmed with the address of; * Non vectored app_irqDispatch mentioned in this example. User can setup; * Vectored IRQs or FIQs here.; *********************************************************************/VICBaseAddrEQU 0xFFFFF000 ; VIC Base addressVICDefVectAddrOffset EQU 0x34LDRLDRSTRr0, =VICBaseAddrr1, =app_irqDispatchr1, [r0,#VICDefVectAddrOffset]BL rm_init_entry ;Initialize RealMonitor;enable FIQ and IRQ in ARM ProcessorMRS r1, CPSR ; get the CPSRBIC r1, r1, #0xC0 ; enable IRQs and FIQsMSR CPSR_c, r1 ; update the CPSR; /*********************************************************************; * Get the address of the User entry point.; *********************************************************************/LDR lr, =User_EntryMOV pc, lr; /*********************************************************************; * Non vectored irq handler (app_irqDispatch); *********************************************************************/AREA app_irqDispatch, CODEVICVectAddrOffset EQU 0x30app_irqDispatch;enable interrupt nestingSTMFD sp!, {r12,r14}MRS r12, spsr ;Save SPSR in to r12MSR cpsr_c,0x1F ;Re-enable IRQ, go to system mode;User should insert code here if non vectored Interrupt sharing is;required. Each non vectored shared irq handler must return to;the interrupted instruction by using the following code.; MSR cpsr_c, #0x52 ;Disable irq, move to IRQ mode; MSR spsr, r12 ;Restore SPSR from r12; STMFD sp!, {r0}; LDR r0, =VICBaseAddr; STR r1, [r0,#VICVectAddrOffset] ;Acknowledge Non Vectored irq has finished; LDMFD sp!, {r12,r14,r0} ;Restore registers; SUBS pc, r14, #4 ;Return to the interrupted instruction;user interrupt did not happen so call rm_irqhandler2. This handler;is not aware of the VIC interrupt priority hardware so trick;rm_irqhandler2 to return here© Koninklijke Philips Electronics N.V. 2005. All rights reserved.User manual Rev. 01 — 15 August 2005 326

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!