230 likes | 334 Vues
Interrupts CML-12C32. Lecture L4.2. References. S12CPUV2 Reference Manual Section 7. S12CPUV2.pdf. CML-12C32 Development Board for Motorola MC9S12C32. CML12C32_UG.pdf. Interrupt (INT) Module V1. S12INTV1.pdf. S12CRGV4.pdf. CRG Block User Guide V04.05. Interrupts.
E N D
InterruptsCML-12C32 Lecture L4.2
References S12CPUV2 Reference Manual Section 7 S12CPUV2.pdf CML-12C32 Development Board for Motorola MC9S12C32 CML12C32_UG.pdf Interrupt (INT) Module V1 S12INTV1.pdf S12CRGV4.pdf CRG Block User Guide V04.05
Interrupts • 68HC12 Interrupts • Real-Time Interrupts
Interrupt Vector Table Ref: MC9S12C Family Device User Guide 9S12C128DGV1.pdf
Interrupt (INT) Module V1 S12INTV1.pdf
Monitor Interrupt Vector Table Off by 2
S12MEBIV3.pdf Multiplexed External Bus Interface (MEBI) Block User Guide Module V3
Interrupts • 68HC12 Interrupts • Real-Time Interrupts
; RTI test outa equ $FF4F rti_ivec equ $0FF2 crgflg equ $0037 crgint equ $0038 rtictl equ $003b org $800 ticks dw 0 Note: Should be $0FF0. Monitor error Interrupt routine increments ticks
rti_init sei ;disable interrupts ldaa #$59 staa rtictl ;set rti to 10.24 ms ldaa #$80 staa crgint ;enable rti ldx #rti_intser stx rti_ivec ;store rti int vector cli ;enable interrupts rts rti_intser ldd ticks addd #1 ;inc ticks std ticks ldaa #$80 staa crgflg ;clear rti flag rti
ORG $4000 main jsr rti_init ldab #10 mn1 tba jsr hexasc jsr outa bsr sec_delay decb bne mn1 swi
sec_delay pshb ;save B ldd ticks std 2,-sp ;store tick0 sd1 ldd ticks ;read ticks subd 0,sp ;diff = ticks-ticks0 cpd #100 ;repeat until 100 ticks blo sd1 leas 2,sp ;fix stack pulb ;restore B rts