![Rabbit Rabbit 4000 User Manual Download Page 147](http://html1.mh-extra.com/html/rabbit/rabbit-4000/rabbit-4000_user-manual_3116714147.webp)
137
A sample clocked serial interrupt handler is shown below for Serial Port B.
clocked_serb_isr::
push af ; save used registers
ioi ld a, (SASR) ; get status
bit a,7 ; check if byte ready in RX buffer
push af ; save status for next check
jr z, check_for_tx
rx_ready:
ioi ld a, (SADR) ; read byte and clear interrupt
; do something with received byte here
ld a, 0x41 ; set bits 6-7 to 01, the other bits should
; represent the desired SACR setup
ioi ld (SACR), a ; start a new receive operation
check_for_tx:
pop af
bit a,3 ; check if TX buffer was emptied
jr nz, done
; get next byte to be transmitted into A here
ioi ld (SADR), a ; load TX buffer with next byte and clear interrupt
done:
pop af ; restore used registers
ipres
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...