Download presentation
1
CAN ( Controller Area Network )
RTLAB 김병철 08/03/20
2
개요 CAN 이란? AT91SAM7 의 CAN
3
CAN 이란? BOSCH 에서 자동차용 전자제어 장치들 간의 실시 간 통신을 위해 개발 ( Ex : ABS, 엔진관리, 변속관 리 ) CSMA/CD+AMP (carrier-sense multiple-access protocol with collision detection and arbitration on message priority) Simple 2-wire differential bus Bit rates up to 1Mbit/s 3종류의 CAN 버전 Four Frame Types Five Error Types Fault Confinement
4
CAN 계층 구조
5
CAN 노드 구조
6
CAN 적용 사례 6->7 : 2개의 Bus로 어떻게 데이터 통신을 하는가?
7
Bus Condition 뒤로 The Inverted Logic of a CAN Bus CANH와 CANL의 차가
0.5V 보다 작으면 Recessive ‘1’ 0.9V 보다 크면 Dominant ‘0’ 두개의 Bus값을 검사하여 다르면 “0” 같으면 “1” 뒤로
8
Bus Condition Bus에 대해 Dominant가 Recessive보다 우선순위가 높다!
9
CSMA/CD with AMP CSMA/CD with AMP (arbitration on message priority)
10
CAN Bit Coding & Bit Stuffing
NRZ Bit Coding Stuff Bits are inserted after 5 consecutive bits of the same level for synchronization
11
CAN Bit Timing Configuration
뒤로
12
CAN Frame Formats CAN Versions
Standard CAN ( V2.0A ) : 11-Bit Identifier Extended CAN ( V2.0B ) : 29-Bit Identifier Identifier = Priority
13
CAN Frame Formats 1Mbps의 속도로 data가 전송된다면 Standard의 경우 130us, Extended의 경우 154us의 시간이 소요된다. 1 start bit + 11 Identifier bit + 1 SRR bit + 1 IDE bit + 18 Identifier bit + 1 RTR bits + 6 Control bits + 64 Data bits + 15 CRC bits + 23 (maximum) Stuff bits + 1 CRC delimiter + 1 ACK slot + 1 ACK delimiter + 7 EOF bits + 3 IFS bits = 154 bits 1 start bit + 11 Identifier bit + 1 RTR bits + 6 Control bits + 64 Data bits + 15 CRC bits + 19 (maximum) Stuff bits + 1 CRC delimiter + 1 ACK slot + 1 ACK delimiter + 7 EOF bits + 3 IFS bits = 130 bits Standard Extended
14
Relation between BitRate and Bus Length
15
CAN Frame Formats Four Frame Types Data Frame (RTR=0)
Remote Frame (RTR=1 and no data field) Error Frame (after violation frame format) Overload Frame (Not really used)
16
Error Detection Error Types CRC error Bit-stuffing error Bit error
Form Error Acknowledgment error
17
Fault Confinement ERRA bit is set in the CAN_SR Register
ERRP bit is set in the CAN_SR Register
18
AT91SAM7의 CAN CAN 2.0A and CAN 2.0B Bit rates up to 1Mbit/s
8 Mailboxes Also called channels or buffers The CPU reads or writes data via the CAN controller mailboxes Each mailbox has an ID Several mailboxes can be configured with the same ID Each can be Receive or Transmit one 16-bit Time Stamp
19
CAN Block Diagram
20
Mailbox Receive Mailbox Transmit Mailbox
Mailbox with the lowest number is serviced first Mailbox Object Type Receive Receive with overwrite Consumer Transmit Mailbox Mailbox with the highest priority is serviced first Same priority -> mailbox with lowest number first Transmit Producer
21
Message Acceptance Procedure
MIDx : Mailbox ID register MAMx : Acceptance Mask register
22
Message Acceptance Procedure
23
Receive Mailbox
24
Receive with Overwrite Mailbox
25
Chaining Receive Mailboxes
All mailboxes are configured with same ID The mailbox with the largest number is configured in receive with overwrite mode (others are configured in receive mode)
26
Transmitting Messages
27
Producer/Consumer model
28
Producer / Consumer Handling
29
CAN Controller Timing Modes
Timestamping Modes The value of the internal timer is captured at each Start Of Frame or each End Of Frame
30
CAN Controller Timing Modes
Time Triggered Mode
31
CAN Controller Timing Modes
Time Triggered Mode
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.