





















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Notes; Class: COMPUTER SYSTEMS; Subject: Electrical and Computer En; University: Auburn University - Main Campus; Term: Unknown 1989;
Typology: Study notes
1 / 29
This page cannot be seen from the preview
Don't miss anything!






















Asynchronous events (Fig. 12-2)
Timeline:
Expanded Timeline:
Disble IRQ: ORCC #%00010000 (formerly SEI)
Enable IRQ: ANDCC #%11101111 (formerly CLI)
Enable XIRQ: ANDCC #%
S X H I N Z V C
Mask XIRQ Mask IRQ
1 “masks” (disables) IRQ/XIRQ
0 “unmasks” (enables) IRQ/XIRQ [default state]
X bit cannot be set to 1 after it has been cleared.
Therefore, once enabled, XIRQ cannot be disabled.
Condition Code Register (CCR)
CPU actions in an interrupt sequence
FFFE,FFFF: Reset vector
FFFC,FFFD: Clock monitor fail (reset) FFFA,FFFB: COP failure (reset) FFF8,FFF9: Unimplemented opcode trap FFF6,FFF7: SWI FFF4,FFF5: XIRQ pin
FFF2,FFF3: IRQ pin FF00…FFF1: Built-in functions (device-specific)
Interrupt vector assignments for HCS
Creating the reset vector
(Code Warrior sample program)
; code section ORG ROMStart Entry: LDS #RAMEnd+1 ; initialize the stack pointer CLI ; enable interrupts mainLoop: …….
;************************************************************** ;* Interrupt Vectors * ;************************************************************** ORG $FFFE ; Address for storing reset vector DC.W Entry ; Reset Vector
Initializing HCS12 Interrupt Vectors
; Initialize Timer Channel 0 Interupt vector
TC0 EQU $FFEE ; Address of the vector
; Put in the main program
ORG ROMstart
Entry: (main program)
; The interrupt service routine starts with a label
; at the first instruction to be executed
TC0ISR:
Timer ISR Instructions rti ; The isr ends with a RTI
; Locate the vectors
ORG TC DC.W TC0ISR ; The label is the address of the ISR ORG $FFFE ; Address of reset vector DC.W PROG
Highest priority interrupt register
(HPRIO)
PSEL7 PSEL6 PSEL5 PSEL4 PSEL3 PSEL2 PSEL1 0
IRQ and lower-priority interrupts
hprio1c.asm Assembled with CASM 05/28/1998 02:20 PAGE 1
0000 1 HPRIO: EQU $1F ; HPRIO address 0000 2 TC2VECT: EQU $FFEA ; Channel 2 Vector 3 ;... 4 ; Mask interrupts while setting HPRIO 0000 1410 5 sei ; Set I-bit 6 ; Raise Timer Channel 2 to the highest priority 0002 CCFFEA 7 ldd #TC2VECT 0005 5B1F 8 stab HPRIO 0007 10EF 9 cli ; Clear interrupt mask
hprio1c.asm Assembled with CASM 05/28/1998 02:20 PAGE 1
0000 1 HPRIO: EQU $1F ; HPRIO address 0000 2 TC2VECT: EQU $FFEA ; Channel 2 Vector 3 ;... 4 ; Mask interrupts while setting HPRIO 0000 1410 5 sei ; Set I-bit 6 ; Raise Timer Channel 2 to the highest priority 0002 CCFFEA 7 ldd #TC2VECT 0005 5B1F 8 stab HPRIO 0007 10EF 9 cli ; Clear interrupt mask
Interrupt control register (INTCR)
IRQE IRQEN DLY 0 0 0 0 0
•DLY : oscillator startup delay on exiting “stop mode”
Example: Interrupt-driven printing
DATA8-
STRB*
BUSY
ACK*
PA7-
PB 0
PB 1
IRQ
Printer
DATA8-
STRB*
BUSY
ACK*