Motorola Axiom CMD11E1 Uživatelská příručka Strana 81

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 101
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 80
7.4. THE REAL TIME INTERRUPT 81
; INTERRUPT SERVICE
SERVICE
; TOGGLE PA4
LDAA #%00010000
EORA PORTA
STAA PORTA
; TURN OFF THE FLAG!
LDAA #%10000000
STAA TFLG2
; END WITH AN RTI
RTI
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Connect the service to the interrupt ;
ORG $00D0 ; $00D0 WHERE THE SERVICE STARTS
JMP SERVICE ; JUMP TO WHERE THE SERVICE CODE ACTUALLY IS
How does this code differ from the previous one? We don’t wait for the clock
to rollover. Instead, the main program goes about its task (in this case not a
very interesting one!). Note that although the service routine uses the A register,
this does not affect the value the main routine has stored in the A register (the
character Z).
7.4 The Real time interrupt
The real time interrupt, RTI (not to be confused with the RTI instruction) acts
exactly like the timer overflow interrupt, except you can control the time between
interrupts using the last two bits (0 and 1) of
PACTL
at location
$1026
. If the
both the bits are set, the time between the interrupts is is 32.768 ms, i.e. same
as timer overflow. However, you can decrease the time between the interrupts
(increase the rate) by changing the last two bits as PACTL as shown below:
Zobrazit stránku 80
1 2 ... 76 77 78 79 80 81 82 83 84 85 86 ... 100 101

Komentáře k této Příručce

Žádné komentáře