Motorola Axiom CMD11E1 Guia do Utilizador Página 85

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 101
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 84
7.5. THE OUTPUT COMPARE INTERRUPT 85
SERVICE
; TOGGLE PA4
LDAA #%00010000
EORA PORTA
STAA PORTA
; TURN OFF THE FLAG!
LDAA #%01000000 <= This is different
STAA TFLG1
; END WITH AN RTI
RTI
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Connect the service to the interrupt ;
ORG $00DC ; $00DC WHERE THE SERVICE STARTS
JMP SERVICE ; JUMP TO WHERE THE SERVICE CODE ACTUALLY IS
Verify that the above code also generates a 30.5 Hz square wave. Now we can
reset the alarm to get a different frequency. For example, if we modify the service
routine as follows, we will get an interrupt every 2000 clock ticks or every 1 ms
for a 1 K Hz signal.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; INTERRUPT SERVICE
SERVICE
; TOGGLE PA4
LDAA #%00010000
EORA PORTA
STAA PORTA
; TURN OFF THE FLAG!
LDAA #%01000000
STAA TFLG1
Vista de página 84
1 2 ... 80 81 82 83 84 85 86 87 88 89 90 ... 100 101

Comentários a estes Manuais

Sem comentários