![](http://datasheet.mmic.net.cn/30000/M30855FHTGP_datasheet_2359399/M30855FHTGP_338.png)
Page 315
4
9
4
f
o
5
0
2
,
1
0
.
l
u
J
3
0
.
1
.
v
e
R
3
0
1
0
-
7
3
0
B
9
0
J
E
R
22. Intelligent I/O (Communication Function)
)
T
5
8
/
C
2
3
M
,
5
8
/
C
2
3
M
(
p
u
o
r
G
5
8
/
C
2
3
M
22.4.3 HDLC Data Processing Mode (Communication Units 0 and 1)
In HDLC data processing mode, bit stuffing, flag detection, abort detection and CRC calculation are avail-
able for HDLC control. f1, f8 or f2n can become the communication unit 0 transfer clock. f1, f8, f2n or clock,
generated in the channel 0 or 1, can become the communication unit 1 transfer clock. No pins are used.
To convert data, data to be transmitted is written to the GiTB register (i=0,1) and the data conversion
result is restored after data conversion. If any data are in the GiTO register after data conversion, the
conversion is terminated. If no data is in the GiTO register, bit stuffing processing is executed regardless
of there being no data in the transmit output buffer. A CRC value is calculated every time one bit is
converted. If no data is in the GiRI register, received data conversion is terminated.
Table 22.25 list specifications of the HDLC data processing mode. Tables 22.26 and 22.27 list clock
settings. Table 22.28 lists register settings.
Table 22.25 HDLC Processing Mode Specifications (Communication Units 0 and 1)
Item
Specification
Input Data Format
8-bit data fixed, bit alignment is optional
Output Data Format
8-bit data fixed
Transfer Clock
See Tables 22.26 and 22.27
I/O Method
During transmit data processing,
value set in the GiTB register is converted in HDLC data processing mode and
transferred to the GiTO register.
During received data processing,
value set in the GiRI register is converted in HDLC data processing mode and
transferred to the GiRB register. The value in the GiRI register is also transferred to
the GiTB register (received data register).
Bit Stuffing
During transmit data processing, "0" following five continuous "1" is inserted.
During received data processing, "0" following five continuous "1" is deleted.
Flag Detection
Write the flag data "7E16" to the GiCMPj register (j=0 to 3) to use the special commu-
nication interrupt (the SRTiR bit in the IIO4IR register)
Abort Detection
Write the masked data "0116" to the GiMSKj register
CRC
The CRC1 and CRC0 bits are set to "112" (X16+X12+X5+1).
The CRCV bit is set to "1" (set to "FFFF16").
During transmit data processing,
CRC calculation result is stored into the GiTCRC register. The TCRCE bit in the
GiETC register is set to "1" (transmit CRC used).
The CRC calculation result is reset when the TE bit in the GiCR register is set to "0"
(transmit disabled).
During received data processing,
CRC calculation result is stored into the GiRCRC register. The RCRCE bit in the
GiERC register is set to "1" (receive CRC used).
The CRC calculation result is reset by comparing the flag data "7E16" and matching
the result with the value in the GiCMP3 register. The ACRC bit in the GiEMR regis-
ter is set to "1" (CRC reset).
Data Processing Start
The following conditions are required to start transmit data processing:
Condition
The TE bit in the GiCR register is set to "1" (transmit enable)
Data is written to the GiTB register
The following conditions are required to start receive data processing:
The RE bit in the GiCR register is set to "1" (receive enable)
Data is written to the GiRI register