207
20.3.4 Handling Interrupts
The network port interrupt is automatically cleared by reading NACSR.
A sample interrupt handler is shown below.
network_isr::
push af
ioi ld a, (NACSR) ; read the interrupt status
push af ; save status byte for later
bit 6,a ; did receive error occur?
jp nz, handle_rx_err
pop af ; recover network status byte
bit 4,a ; did transmit error occur?
jp nz, handle_tx_err
pop af
bit 2,a ; did link change or jabber occur?
ioi ld a, (NASR) ; get current status to check which one
bit 0,a
jp nz, handle_jabber ; did jabber condition occur?
done:
pop af
ipres
ret
handle_rx_err:
ioi ld a, (NARSR) ; get receiver status
; check why error occurred and respond accordingly
ret
handle_tx_err:
ioi ld a, (NATSR) ; get transmitter status
; check why error occurred and respond accordingly
ret
handle_jabber:
ld a, 0x00
ioi ld (NATCR), a ; disable transmitter
ld a, 0x80
ioi ld (NARR), a ; reset transmitter
ld a, 0x80
ioi ld (NATCR), a ; enable transmitter
ret
Содержание Rabbit 4000
Страница 1: ...Rabbit 4000 Microprocessor User s Manual 019 0152 070720 H...
Страница 18: ...8 Rabbit 4000 Microprocessor User s Manual...
Страница 40: ...30 Rabbit 4000 Microprocessor User s Manual...
Страница 74: ...64 Rabbit 4000 Microprocessor User s Manual...
Страница 82: ...72 Rabbit 4000 Microprocessor User s Manual...
Страница 86: ...76 Rabbit 4000 Microprocessor User s Manual...
Страница 96: ...86 Rabbit 4000 Microprocessor User s Manual...
Страница 182: ...172 Rabbit 4000 Microprocessor User s Manual...
Страница 240: ...230 Rabbit 4000 Microprocessor User s Manual...
Страница 248: ...238 Rabbit 4000 Microprocessor User s Manual...
Страница 256: ...246 Rabbit 4000 Microprocessor User s Manual...
Страница 310: ...300 Rabbit 4000 Microprocessor User s Manual...
Страница 330: ...320 Rabbit 4000 Microprocessor User s Manual...
Страница 348: ...338 Rabbit 4000 Microprocessor User s Manual...