![Rabbit Rabbit 4000 Скачать руководство пользователя страница 161](http://html1.mh-extra.com/html/rabbit/rabbit-4000/rabbit-4000_user-manual_3116714161.webp)
151
A sample HDLC interrupt handler is shown below for Serial Port E.
hdlc_sere_isr::
push af
ioi ld a, (SESR) ; 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:
; check status byte in A for abort or invalid CRC flags
ioi ld a, (SADR) ; read byte and clear interrupt
; store byte in A here
check_for_tx:
pop af
bit a,3 ; 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
17.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
Содержание 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...