![Dallas Semiconductor MAXIM DS21354 Manual Download Page 72](http://html1.mh-extra.com/html/dallas-semiconductor/maxim-ds21354/maxim-ds21354_manual_3307537072.webp)
DS21354/DS21554 3.3V/5V E1 Single-Chip Transceivers
72 of 124
14.3.
Basic Operation Details
As a basic guideline for interpreting and sending HDLC messages, the following sequences can be
applied:
14.3.1.
Example: Receive an HDLC Message
1. Enable RPS interrupts
2. Wait for interrupt to occur
3. Disable RPS interrupt and enable either RPE, RNE, or RHALF interrupt
4. Read RHIR to obtain REMPTY status
a. If REMPTY=0, then record OBYTE, CBYTE, and POK bits and then read the FIFO
a1. if CBYTE = 0 then skip to step 5
a2. if CBYTE = 1 then skip to step 7
b. If REMPTY = 1, then skip to step 6
5. Repeat step 4
6. Wait for interrupt, skip to step 4
7. If POK = 0, then discard whole packet, if POK = 1, accept the packet
a. Disable RPE, RNE, or RHALF interrupt, enable RPS interrupt and return to step 1.
14.3.2.
Example: Transmit an HDLC Message
1. Make sure HDLC controller is done sending any previous messages and is current sending flags by
checking that the FIFO is empty by reading the TEMPTY status bit in the THIR register
2. Enable either the THALF or TNF interrupt
3. Read THIR to obtain TFULL status
a. If TFULL = 0, then write a byte into the FIFO and skip to next step (special case occurs when
the last byte is to be written, in this case set TEOM = 1 before writing the byte and then skip
to step 6)
b. If TFULL = 1, then skip to step 5
4. Repeat step 3
5. Wait for interrupt, skip to step 3
6. Disable THALF or TNF interrupt and enable TMEND interrupt
7. Wait for an interrupt, then read TUDR status bit to make sure packet was transmitted correctly.