Motorola Axiom CMD11E1 Podręcznik Użytkownika Strona 84

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 101
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 83
84 CHAPTER 7. INTERRUPT PROCESSING
7.5 The output compare interrupt
The HC11 has 5 OCx interrupts. These are like alarm clocks. You set a desired
’alarm’ time and when the clock matches the alarm setting, the OCxF flag will be
turned on and could then generate a request for service. Note that if you do not
change the alarm setting, you will still get an interrupt every 32.768 ms. However,
having the alarm gives you greater flexibility. First a co de that does not change
the alarm setting and hence generates 30.5 Hz square wave.
; Various defines go here ...
ORG $3000 don’t forget the $
ME FCC /Your name/
FCB 10
FCC /ECE 372/
FCB 10
FCC /Date the program was last changed/
FCB 10, 10, 4
ORG $2000 DONT FORGET THE $
LDX #ME
JSR OUTSTRG ; MAKE SURE YOU HAVE EQU FOR OUTSTRG
LOOP1
; Enable OC2 interrupt by setting OC2I (bit#6 in TMSK1)
SEI
LDAA #%01000000 <= This is different
STAA TMSK1
CLI
; Now go about your business of printing Z’s
LDAA #’Z’
LOOP JSR OUTA
BRA LOOP
; End of main program
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; INTERRUPT SERVICE
Przeglądanie stron 83
1 2 ... 79 80 81 82 83 84 85 86 87 88 89 ... 100 101

Komentarze do niniejszej Instrukcji

Brak uwag