CAN : Controller Area Network
- CAN ํต์ ์ busํ topology.
๋ชจ๋ message๋ broadcast ๋ฐฉ์์ผ๋ก ์ก์ -> network์ ์ฐ๊ฒฐ๋ ๋ชจ๋์๊ฒ ์ ๋ฌ
- CAN์ high, low 2๊ฐ๋ฅ ์ ์ฌ์ฉ : noise์ ๊ฐ์ธํ๊ฒ ๋์ํ๋๋ก ํ๊ธฐ ์ํ ๋ฐฉ๋ฒ ์ค ํ๋(noise๊ฐ ์ ์ฉ๋์ด๋ ๋ ์ ์ ๋ชจ๋ ์ ์ฉ๋์ด ์ ์ ์ฐจ๋ ๋์ผ)
CAN ํต์ ์ปค๋ฅํฐ
: D-sub 9 pin connector
- CAN high๋ 2๋ฒ, low๋ 7๋ฒ pin์ ์ฐ๊ฒฐ
์ข ๋จ์ ํญ
- 120์ด
- ๋ฐ์ฌํ์ ์ํ ์๊ณก ๋ฐฉ์ง์ํด
์ค์ CAN ์ ํธ๋ฅผ ์ป์ผ๋ ค๋ฉด ์ฐจ๋์ด ์์ด์ผํ๋๋ฐ cost๊ฐ ๋ง์ด ๋ค๊ธฐ ๋๋ฌธ์ ์๋ฎฌ๋ ์ด์ ์ ํตํด CAN signal ์ก์์ .
-> ex) vector VN1640A
voltage ์ฐจ
reference voltage : 2.5v
- 0.9v ~ 5v : 0(dominant)
- -0.1v ~ 0.5v : 1(recessive)
* dominant๊ฐ recessive๋ณด๋ค ์ฐ์ ์์ ๋์
CAN transceiver & CAN controller
transceiver : transmitter + receiver
- peripheral : MCU ๋ด ๋ค์ํ hw ์ฅ์น๋ค
- periphera : CAN controller
CAN controller๋ micro controller ๋ด ์กด์ฌ
controller ๊ธฐ์ค
- Tx : controller -> transceiver
- Rx : transceiver -> controller
CAN transceiver(ex. NXP TJA1043)๋ state machine(sleep, normal, listen only mode)์ด ์๋ ๊ฒฝ์ฐ ์์ด์ normal mode๋ก ์ ํํด์ฃผ์ด์ผ message ์ก์์ ๊ฐ๋ฅ
- controller : data link layer
- transceiver : physical layer
BaudRate(ํต์ ์๋)
- ๋จ์ : bps
bus์ ์ฐธ์ฌํ๋ ๋ชจ๋ ์ ์ด๊ธฐ๋ ๋ชจ๋ ๊ฐ์ baud rate(oem์์ ์ ์. candb์ ์์)๋ก ํต์ ํด์ผํจ
- low-speed : ~ 125kbps(500m)
- high-speed : ~ 1Mbps(๋ณดํต 500kbps)(100m)
- CAN FD : ~ 8Mbps(40m)
sampling point
: ํ๋์ bit๊ฐ์ด 0์ธ์ง 1์ธ์ง ํ๋จํ๋ ์ง์ . ๋จ์๋ %
- oem์์ ์ ํด์ฃผ๋ spec
- sampling point์ ๋ฐ๋ผ CAN controller sw ๊ตฌํ ์ setting ๊ฐ ๋ฌ๋ผ์ง
- CAN simulation ์ฅ๋น ์ฌ์ฉ ์ baud rate์ ํจ๊ป sampling point๋ ์ธํ ํ์
CAN์์ 1 bit๋ sync, TSEG_1(Prop,phase1), TSEG_2(phase 2)๋ก ๋ถ๋ฅ
- sync๋ ๊ณ ์ ๊ฐ(1)
- prop, phase1, phase2๋ ์ ํ๋ ๊ฐ์ผ๋ก sampling point๋ฅผ ๊ธฐ์ค์ผ๋ก ์ค์
- TSEG1, TSEG2์ ๊ธธ์ด ์ธ๋ ๋จ์ : time quanta

SJW(Synchronization Jump Width)
CAN clock์ ๊ณต๊ธํ๋ hw์ธ ํฌ๋ฆฌ์คํ์๋ ์ค์ฐจ ์กด์ฌํ๊ธฐ ๋๋ฌธ์ sync ๋ง์ถฐ์ฃผ์ด์ผ ํจ.
-> sync๊ฐ ๋ง์ง ์๋ ๊ฒฝ์ฐ
- clock ์๋ ๋น ๋ฅธ ๊ฒฝ์ฐ, phase1์ ์ฐ์ฅํ์ฌ ๋ง์ถค
- clock ์๋ ๋๋ฆฐ ๊ฒฝ์ฐ, phase2๋ฅผ ์๋ฆ
message
id : arbitration field
- standard format : 11bit
- extended format : 29 bit

* id๊ฐ ์์์๋ก ์ฐ์ ์์ ๋์
signal
CAN frame์์ data์์ญ์ ๋ด์. ๋จ์๋ byte(์ต๋ 8 byte)
- DLC(Data Length Code) : data byte ํฌ๊ธฐ
* start bit, length, unit, signal comment, factor, offset(factor, offset์ float(4 byte ํ์) ๋ณด๋ผ ๋ ํจ์จ์ ์ผ๋ก ๋ณด๋ด๊ธฐ ์ํด ์ถ๊ฐ). factor๊ฐ ํฌ๋ฉด ์ ๋ฐ๋ ๋จ์ด์ง๊ณ ๋ฐ์ดํฐ ์๋ ์ ์์
Error
- bit error : ๋ณด๋ธ bit์ ๋ค๋ฅธ ๊ฒฝ์ฐ
- stuff error(bit stuffing) : 6๊ฐ ์ด์ ์ฐ์ ๊ฐ์ bit(physically)
- ack error : receiver๊ฐ ack ๋ณด๋ผ ๋ bit error ์ฒดํฌ
- CRC(Cyclic Redundancy Code) : CRC ๊ฐ ์ด์ํ ๋ 1
- structure error : ๋ฐ์ดํฐ ์์ ์ด๊ธ๋ฌ์ ๋
error state
- passive(1)
- active(0)
์ก์ ํ๋ ์ ์ด๊ธฐ๊ฐ error ๋ฐ๊ฒฌํ๋ฉด TEC(Transmitter Error Count) ์ฌ๋ฆฌ๊ณ , erorr ์์ ํ ์ ์ด๊ธฐ๋ REC(Receiver Error Counter) ์ฌ๋ฆผ

CAN FD(Fast Data-Rate)
: high speed CAN์ ๋ฎ์ baud rate๊ณผ ์์ ํฌ๊ธฐ์ data์์ญ ๋ณด์
- data ์์ญ ์๋ ์ต๋ 8Mbps, data์์ญ ํฌ๊ธฐ ์ต๋ 64 byte ๊ฐ๋ฅ