2017년 11월 4일 토요일

CAN Standard Frame Format

Base Frame Format



Start-of-frame
1
Denotes the start of frame transmission

Identifier (green)
11
A (unique) identifier which also represents the message priority

Remote transmission request (RTR) (blue)
1
Must be dominant (0) for data frames and recessive (1) for remote request frames (see Remote Frame, below)

Identifier extension bit (IDE)
1
Must be dominant (0) for base frame format with 11-bit identifiers

Reserved bit (r0)
1
Reserved bit. Must be dominant (0), but accepted as either dominant or recessive.

Data length code (DLC) (yellow)
4
Number of bytes of data (0–8 bytes)[a]

Data field (red)
0–64 (0-8 bytes)
Data to be transmitted (length in bytes dictated by DLC field)

CRC
15
Cyclic redundancy check

CRC delimiter
1
Must be recessive (1)

ACK slot
1
Transmitter sends recessive (1) and any receiver can assert a dominant (0)

ACK delimiter
1
Must be recessive (1)

End-of-frame (EOF)
7
Must be recessive (1)


Terminology
1. dominant, recessive
recessive(1): 열성
dominant(0): 우성
이라고 해석이 된다. low 나 high 가 아니라 recessive 나 dominant 라고 부르는 이유는 network 에서 통신을 할 때 ID 가 더 낮은 ECU 가 먼저 통신을 한다는 것이다. CAN 통신에서는 메시지를 받는 ECU 가 알아서 처리를 하므로 ID 가 낮은걸 먼저 처리할 것인다( 동시에 왔을 때 어떻게 동작하는지 실제 예를 알 고 싶다.)
2. bus network
    - 하나의 버스 선에 각 Node(ECU 등) 를 연결해서 통신하는 network 방식
3. 종단 저항
    - 반사 현상을 막기 위하여 끝에 연결한 저항(통신 라인의 임피던스와 동일하다)
4. CRC
an error-detecting code commonly used in digital networks and storage devices to detect accidental changes to raw data.
Blocks of data entering these systems get a short check value attached, based on the remainder of a polynomial division of their contents.
CRCs are so called because the check (data verification) value is a redundancy (it expands the message without adding information) and the algorithm is based on cyclic codes.
CRC 가 왜 15bit 냘고 하면 CRC-16 알고리즘을 썼기 때문이다. 16bit 짜리로 나누어서 15자리가 남게되면 그 15bit을 뒤에 붙여서 나누면 0이 남는다. CRC 가 동작하는 원리가 그것.
5. arbitration
다중 노드가 동시에 메시지를 CAN 버스로 전송하려는 경우 최우선 순위를 가진 노드 (가장 낮은 중재 ID)가 자동적으로 버스에 액세스됩니다. 최저 우선 순위를 가진 노드는 버스가 사용 가능할 때까지 반드시 대기해야 합니다. 이러한 방식으로 CAN 네트워크를 실행하면 CAN 노드 사이에 결정성있는 통신을 구현할 수 있습니다.
다른 아이디가 동시에 시그널을 보내면 우선순위가 높은 노드가 메시지를 보내고 다른 노드들이 보내지 못하는 것 까지는 이해 하는데 정확히 같은 타이밍이라 메시지를 두개 이상의 노드에서 보내면 우선순위가 가장 낮은것 빼고 나머지의 데이터가 어떻게 되는지 아직 이해하지 못함

댓글 없음:

댓글 쓰기