4.1.31 CAN_BusErrorCode
Description:
This function is used to get the error code capture (ECC) register of
CAN controller. This register obtains information about the type and
location of errors on the bus.
Syntax:
int CAN_BusErrorCode(BYTE BoardNo, BYTE Port,
BYTE *bErrorCode)
Parameter:
BoardNo: [input] PISO-CAN board number (0~7).
Port: [input] CAN port number (1~8)
*bErrorCode:[output] Error code capture register of CAN controller.
Table 4.4 Bit interpretation of the error code capture register (ECC).
Bit SYMBOL
NAME VALUE
FUNCTION
ECC.7
(1)
ERRC1
Error Code 1
-
-
ECC.6
(1)
ERRC0
Error Code 0
-
-
1
RX; error occurred during
reception
ECC.5
(2)
DIR Direction
0
TX; error occurred during
transmission
ECC.4
(2)
SEG4 Segment
4
-
-
ECC.3
(2)
SEG3 Segment
3
-
-
ECC.2
(2)
SEG2 Segment
2
-
-
ECC.1
(2)
SEG1 Segment
1
-
-
ECC.0
(2)
SEG0 Segment
0
-
-
Notes
1. For bit interpretation of bit ECC.7 and ECC.6, see table 4.5
2. For bit interpretation of bit ECC.4 to ECC.0, see table 4.6
Table 4.5 Bit interpretation of bits ECC.7 and ECC.6
BIT ECC.7
BIT ECC.6
FUNCTION
0 0
Bit
error
0 1
Form
error
1
PISO-CAN/PEX-CAN/PCM-CAN Series User’s Manual (v2.6 Dec/2013) -------
67
0
Stuff
error
1
1
Other type of error
ГК
Атлант
Инжиниринг
–
официальный
представитель
в
РФ
и
СНГ
+7(495)109-02-08 [email protected] www.bbrc.ru