![Digi Rabbit 5000 User Manual Download Page 193](http://html1.mh-extra.com/html/digi/rabbit-5000/rabbit-5000_user-manual_2496192193.webp)
Chapter 18 Serial Ports E – F
193
A sample HDLC interrupt handler is shown below for Serial Port E.
hdlc_sere_isr::
push af
ioi ld a, (SESR) ; get status
bit 7,a ; check if byte ready in RX buffer
push af ; save status for next check
jr z, check_for_tx
rx_ready:
; check status byte in A for abort or invalid CRC flags
ioi ld a, (SEDR) ; read byte and clear interrupt
; store byte in A here
check_for_tx:
pop af
bit 3,a ; check if TX buffer was emptied
jr nz, done
; check status byte in A for transmit finish reason (CRC, abort, etc.)
; get next byte to be transmitted into A here; if it is the last
; byte of the packet, load it into SEAR or SELR instead
ioi ld (SEDR), a ; load next byte into buffer and clear interrupt
done:
pop af
ipres
ret
18.3.3 More on Clock Synchronization and Data Encoding
The transmitter is not capable of sending an arbitrary number of bits, but only a multiple
of bytes. However, the receiver can receive frames of any bit length. If the last “byte” in
the frame is not eight bits, the receiver sets a status flag that is buffered along with this last
byte. Software can then use the table below to determine the number of valid data bits in
this last “byte.” Note that the receiver transfers all bits between the opening and closing
flags, except for the inserted zeros, to the receiver data buffer.
Last Byte Bit Pattern
Valid Data Bits
bbbbbbb0
7
bbbbbb01
6
bbbbb011
5
bbbb0111
4
bbb01111
3
bb011111
2
b0111111
1
Summary of Contents for Rabbit 5000
Page 1: ...Rabbit 5000 Microprocessor User s Manual 019 0168_E...
Page 11: ...Table of Contents Appendix B Rabbit 5000 Errata 401 B 1 Errata 401 Index 405...
Page 12: ...Rabbit 5000 Microprocessor User s Manual...
Page 20: ...20 Rabbit 5000 Microprocessor User s Manual...
Page 36: ...36 Rabbit 5000 Microprocessor User s Manual...
Page 56: ...56 Rabbit 5000 Microprocessor User s Manual...
Page 92: ...92 Rabbit 5000 Microprocessor User s Manual...
Page 104: ...104 Rabbit 5000 Microprocessor User s Manual...
Page 122: ...122 Rabbit 4000 Microprocessor User s Manual...
Page 142: ...142 Rabbit 5000 Microprocessor User s Manual...
Page 214: ...214 Rabbit 5000 Microprocessor User s Manual...
Page 228: ...228 Rabbit 5000 Microprocessor User s Manual...
Page 280: ...280 Rabbit 5000 Microprocessor User s Manual...
Page 298: ...298 Rabbit 5000 Microprocessor User s Manual...
Page 306: ...306 Rabbit 5000 Microprocessor User s Manual...
Page 314: ...314 Rabbit 5000 Microprocessor User s Manual...
Page 368: ...368 Rabbit 5000 Microprocessor User s Manual...
Page 388: ...388 Rabbit 5000 Microprocessor User s Manual...
Page 396: ...396 Rabbit 5000 Microprocessor User s Manual...
Page 404: ...404 Rabbit 5000 Microprocessor User s Manual...