EasyManuals Logo

Texas Instruments AM335 Series Technical Reference Manual

Texas Instruments AM335 Series
4161 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #196 background imageLoading...
Page #196 background image
Basic Programming Model
www.ti.com
After the return of the relevant IRQ/FIQ subroutine handle:
1. Disable IRQs/FIQs at ARM side.
2. Restore the INTC_THRESHOLD PRIORITYTHRESHOLD field.
3. Restore the ARM critical context registers.
The following sample code shows the three previous steps:
CAUTION
The following code is an assembly code compatible with ARM architecture V6
and V7. This code is developed for the Texas Instruments Code Composer
Studio tool set. It is a draft version, only tested on an emulated environment.
IRQ_ISR_end:
; Step 1 : Read-modify-write the CPSR to disable IRQs/FIQs at ARM side
MRS R0, CPSR ; Read the CPSR
ORR R0, R0, #0x80/0x40 ; Set the I/F bit
MSR CPSR, R0 ; Write it back to disable IRQs
; Step 2 : Restore the INTC_THRESHOLD register from R12
LDR R0, INTC_THRESHOLD_ADDR
STR R12, [R0]
; Step 3 : Restore critical context
MSR SPSR, R11 ; Restore the SPSR from R11
LDMFD SP!, {R0-R12, LR} ; Restore working registers and Link register
; Return after handling the interrupt
SUBS PC, LR, #4
Figure 6-3 shows the nested IRQ/FIQ processing sequence from the originating device peripheral module
to the main program interruption.
196
Interrupts SPRUH73HOctober 2011Revised April 2013
Submit Documentation Feedback
Copyright © 2011–2013, Texas Instruments Incorporated

Table of Contents

Other manuals for Texas Instruments AM335 Series

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments AM335 Series and is the answer not in the manual?

Texas Instruments AM335 Series Specifications

General IconGeneral
BrandTexas Instruments
ModelAM335 Series
CategoryComputer Hardware
LanguageEnglish

Related product manuals