Motorola MSC8101 ADS User's Guide Page 143

  • Download
  • Add to my manuals
  • Print
  • Page
    / 346
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 142
Interrupt Programming Examples
Interrupts and Interrupt Priorities 7-9
...
;Programming the VBA register to address 0x5000
move.l #$5000,vba
;Initializing the stack pointer to address 0x68000
move.l #$68000,r0
nop
tfra r0,sp
...
...
; Masking interrupts of priority 0,1,2.
bmclr #$00a0,sr.h
...
7.4.1 PIC Programming
In the PIC ELIRA–ELIRF registers, you can configure the priority level and select the
trigger mode for each interrupt. On reset, all IRs are masked (set to priority 0) and
configured as level-triggered. The following example shows how to assign priority 5 to
the SIC interrupt, priority 4 to the DMA interrupt, and priority 6 to the SMI interrupt. This
example also configures the SMI interrupt as edge-triggered, and the other two interrupts
as level-triggered.
...
; BASE0 is 0x00f00000
ELIRE equ $00f01c20
IRQ16 equ $50c00
IRQ18 equ $50c80
IRQ19 equ $50cc0
; VBA is set to 0x50000
move.l #$50000,vba
; assign priority 5 to SIC (irq 16) and priority 4 to DMA (irq 18)
; assign priority 6 to SMI (irq 19) and set to edge trigger.
move.w #$e405,ELIRE
...
org p:IRQ16
; interrupt routine for SIC
rte
org p:IRQ18
; interrupt routine for DMA
rte
org p:IRQ19
; interrupt routine for SMI
rte
7.4.2 Clearing Pending Requests
The first task that an interrupt routine normally handles is to clear pending requests by
writing to IPRx. If the size of the interrupt routine is larger then 64 bytes, you can use
Page view 142
1 2 ... 138 139 140 141 142 143 144 145 146 147 148 ... 345 346

Comments to this Manuals

No comments