Presentation is loading. Please wait.

Presentation is loading. Please wait.

Interrupts CML-12C32 Lecture L4.2.

Similar presentations


Presentation on theme: "Interrupts CML-12C32 Lecture L4.2."— Presentation transcript:

1 Interrupts CML-12C32 Lecture L4.2

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 CRG Block User Guide V04.05 S12CRGV4.pdf

3 Interrupts 68HC12 Interrupts Real-Time Interrupts

4 HCS12 Interrupts

5 Register Stacking for Interrupts

6 Interrupt Vector Table
Ref: MC9S12C Family Device User Guide 9S12C128DGV1.pdf

7 Interrupt Vector Table (cont.)

8 Interrupt Vector Table (cont.)

9 Interrupt (INT) Module V1 S12INTV1.pdf

10 Monitor Interrupt Vector Table
Off by 2

11

12 S12MEBIV3.pdf Multiplexed External Bus Interface (MEBI) Block User Guide Module V3

13 S12MEBIV3.pdf

14 Interrupts 68HC12 Interrupts Real-Time Interrupts

15 Real-Time Interrupt Registers
$0037

16 $0038

17 $003B

18

19 ; 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

20 rti_init sei ;disable interrupts
ldaa #$59 staa rtictl ;set rti to 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 staa crgflg ;clear rti flag rti

21 ORG $4000 main jsr rti_init ldab #10 mn1 tba jsr hexasc jsr outa bsr sec_delay decb bne mn1 swi

22 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


Download ppt "Interrupts CML-12C32 Lecture L4.2."

Similar presentations


Ads by Google