![Rabbit Rabbit 4000 User Manual Download Page 217](http://html1.mh-extra.com/html/rabbit/rabbit-4000/rabbit-4000_user-manual_3116714217.webp)
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
Summary of Contents for Rabbit 4000
Page 1: ...Rabbit 4000 Microprocessor User s Manual 019 0152 070720 H...
Page 18: ...8 Rabbit 4000 Microprocessor User s Manual...
Page 40: ...30 Rabbit 4000 Microprocessor User s Manual...
Page 74: ...64 Rabbit 4000 Microprocessor User s Manual...
Page 82: ...72 Rabbit 4000 Microprocessor User s Manual...
Page 86: ...76 Rabbit 4000 Microprocessor User s Manual...
Page 96: ...86 Rabbit 4000 Microprocessor User s Manual...
Page 182: ...172 Rabbit 4000 Microprocessor User s Manual...
Page 240: ...230 Rabbit 4000 Microprocessor User s Manual...
Page 248: ...238 Rabbit 4000 Microprocessor User s Manual...
Page 256: ...246 Rabbit 4000 Microprocessor User s Manual...
Page 310: ...300 Rabbit 4000 Microprocessor User s Manual...
Page 330: ...320 Rabbit 4000 Microprocessor User s Manual...
Page 348: ...338 Rabbit 4000 Microprocessor User s Manual...