2023年全國碩士研究生考試考研英語一試題真題(含答案詳解+作文范文)_第1頁
已閱讀1頁,還剩9頁未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)

文檔簡介

1、<p>  CAN Bus Protocol</p><p>  Introduction</p><p>  Controller Area Network (CAN) was initially created by German automotive system supplier Robert Bosch in the mid-1980s for automotive a

2、pplications as a method for enabling robust serial communication. The goal was to make automobiles more reliable, safe and fuel-efficient while decreasing wiring harness weight and complexity. Since its inception, the CA

3、N protocol has gained widespread popularity in industrial automation and automotive/truck applications. Other markets where networked solutions c</p><p>  CAN Overview</p><p>  Most network appl

4、ications follow a layered approach to system implementation. This system etic approach enables sinter operability between products from different manufacturers. A standard was created by the International Standards Organ

5、ization (ISO) as a template to follow for this layered approach. It is called the ISO Open Systems Interconnection (OSI) Network Layering Reference Model. The CAN protocol itself implements most of the lower two layers o

6、f this reference model. The communication m</p><p>  ISO11898 is a standard for high-speed applications, ISO11519 is a standard for low-speed applications, and J1939 (from SAE) is targeted for truck and bus

7、applications. All three of these protocols specify a 5V differential electrical bus as the physical interface. The rest of the layers of the ISO/OSI protocol stack are left to be implemented by the system software develo

8、per. Higher Layer Protocols (HLPs) are generally used to implement the upper five layers of the OSI Reference Model.</p><p>  HLPs are used to:</p><p>  1) Standardize startup procedures includi

9、ng bit rates used,</p><p>  2) Distribute addresses among participating nodes or types of messages,</p><p>  3) Determine the structure of the messages, and</p><p>  4) Provide syst

10、em-level error handling routines. This is by no means a full list of the functions HLPs perform; however it does describe some of their basic functionality.</p><p>  CAN Protocol Basics</p><p> 

11、 Carrier Sense Multiple Access with Collision Detection (CSMA/CD)</p><p>  The CAN communication protocol is a CSMA/CD protocol. The CSMA stands for Carrier Sense Multiple Access. What this means is that eve

12、ry node on the network must monitor the bus for a period of no activity before trying to send a message on the bus (Carrier Sense). Also, once this period of no activity occurs, every node on the bus has an equal opportu

13、nity to transmit a message (Multiple Access). The CD stands for Collision Detection. If two nodes on the network start transmitting at the same time</p><p>  There are a couple of things that are required to

14、 support non-destructive bitwise arbitration. First, logic states need to be defined as dominant or recessive. Second, the transmitting node must monitor the state of the bus to see if the logic state it is trying to sen

15、d actually appears on the bus. CAN define a logic bit 0 as a dominant bit and a logic bit 1 as a recessive bit.</p><p>  A dominant bit state will always win arbitration over a recessive bit state, therefore

16、 the lower the value in the Message Identifier (the field used in the message arbitration process), the higher the priority of the message. As an example, suppose two nodes are trying to transmit a message at the same ti

17、me. Each node will monitor the bus to make sure the bit that it is trying to send actually appears on the bus. The lower priority message will at some point try to send a recessive bit and the m</p><p>  Mes

18、sage-Based Communication</p><p>  CAN protocol is a message-based protocol, not an address based protocol. This means that messages are not transmitted from one node to another node based on addresses. Embed

19、ded in the CAN message itself is the priority and the contents of the data being transmitted. All nodes in the system receive every message transmitted on the bus (and will acknowledge if the message was properly receive

20、d). It is up to each node in the system to decide whether the message received should be immediately discar</p><p>  Another useful feature built into the CAN protocol is the ability for a node to request in

21、formation from other nodes. This is called a Remote Transmit Request(RTR). This is different from the example in the previous paragraph because instead of waiting for information to be sent by a particular node, this nod

22、e specifically requests data to be sent to it.</p><p>  One additional benefit of this message-based protocol is that additional nodes can be added to the system without the necessity to reprogram all other

23、nodes to recognize this addition. This new node will start receiving messages from the network and, based on the message ID, decide whether to process or discard the received information.</p><p>  CAN Messag

24、e Frame Description</p><p>  CAN protocol define four different types of messages (or Frames). The first and most common type of frame is a Data Frame. This is used when a node transmits information to any o

25、r all other nodes in the system. Second is a Remote Frame, which is basically a Data Frame with the RTR bit set to signify it is a Remote Transmit Request. The other two frame types are for handling errors. One is called

26、 an Error Frame and one is called an Overload Frame. Error Frames are generated by nodes that detect a</p><p>  Data Frames consist of fields that provide additional information about the message as defined

27、by the CAN specification. Embedded in the Data Frames are Arbitration Fields, Control Fields, Data Fields, CRC Fields, a 2-bit Acknowledge Field and an End of Frame.</p><p>  The Arbitration Field is used to

28、 prioritize messages on the bus. Since the CAN protocol defines a logical 0 as the dominant state, the lower the number in the arbitration field, the higher priority the message has on the bus. The arbitration field cons

29、ists of 12-bits (11 identifier bits and one RTR bit) or 32-bits (29 identifier bits, 1-bit to define the message as an extended data frame, an SRR bit which isunused, and an RTR bit), depending on whether Standard Frames

30、 or Extended Frames are bein</p><p>  As described in the preceding section, the Remote Transmit Request (RTR) is used by a node when it requires information to be sent to it from another node. To accomplish

31、 an RTR, a Remote Frame is sent with the identifier of the required Data Frame. The RTR bit in the Arbitration Field is utilized to differentiate between a Remote Frame and a Data Frame. If the RTR bit is recessive, then

32、 the message is a Remote Frame. If the RTR bit is dominant, the message is a Data Frame. </p><p>  The Control Field consists of six bits. The MSB is the IDE bit (signifies Extended Frame) which should be do

33、minant for Standard Data Frames. This bit determines if the message is a Standard or Extended Frame. In Extended Frames, this bit is RB1 and it is reserved.The next bit is RB0 and it is also reserved. The four LSBs are t

34、he Data Length Code (DLC) bits. The Data Length Code bits determine how many data bytes are included in the message. It should be noted that a Remote Frame has no data fiel</p><p>  The Acknowledge Field is

35、utilized to indicate if the message was received correctly. Any node that has correctly received the message, regardless of whether the node processes or discards the data, puts a dominant bit on the bus in the ACK Slot

36、bit time </p><p>  The last two message types are Error Frames and Overload Frames. When a node detects one of the many types of errors defined by the CAN protocol, an Error Frame occurs. Overload Frames tel

37、l the network that the node sending the Overload Frame is not ready to receive additional messages at this time, or that intermission has been violated. These errors will be discussed in more detail in the next section.&

38、lt;/p><p>  Fast, Robust Communication</p><p>  Because CAN was initially designed for use in auto mobiles, a protocol that efficiently handled errors was critical if it was to gain market acceptan

39、ce. With the release of version 2.0B of the CAN specification, the maximum communication rate was increased 8x over the version 1.0 specification to 1Mbit/sec. At this rate, even the most time-critical parameters can be

40、transmitted serially without latency concerns. In addition to this, the CAN protocol has a comprehensive list of errors it can dete</p><p>  CAN nodes have the ability to determine fault conditions and trans

41、ition to different modes based on the severity of problems being encountered. They also have the ability to detect short disturbances from permanent failures and modify their functionality accordingly. CAN nodes can tran

42、sition from functioning like a normal node (being able to transmit and receive messages normally), to shutting down completely (bus-off) based on the severity of the errors detected. This feature is called Fault Co</p

43、><p>  Conclusion</p><p>  The CAN protocol was optimized for systems that need to transmit and receive relatively small amounts of information (as compared to Ethernet or USB, which are designed t

44、o move much larger blocks of data) reliably to any or all other nodes on the network. CSMA/CD allows every node to have an equal chance to gain access to the bus, and allows for smooth handling of collisions. Since the p

45、rotocol is message-based, not address based, all messages on the bus receive every message and acknowledge eve</p><p>  Fast, robust message transmission with fault confinement is also a big plus for CAN bec

46、ause faulty nodes will automatically drop off the bus not allowing any one node from bringing a network down. This effectively guarantees that bandwidth will always be available for critical messages to be transmitted. W

47、ith all of these benefits built into the CAN protocol and its momentum in the automotive world, other markets will begin to see and implement CAN into their systems.</p><p><b>  CAN 總線協(xié)議</b></

48、p><p><b>  簡介</b></p><p>  控制器區(qū)域網(wǎng)絡(luò)(CAN)的最初創(chuàng)建者是80年代中期的德國汽車系統(tǒng)供應(yīng)商羅伯特博世,作為汽車應(yīng)用啟用強(qiáng)大的串行通信的方法。其目標(biāo)是讓汽車更可靠,安全,省油同時減少線束的重量和復(fù)雜性。公司自成立以來,已取得了CAN協(xié)議廣泛普及和其在工業(yè)自動化汽車/卡車方面的應(yīng)用。該總線在其他市場網(wǎng)絡(luò)解決方案一樣能夠帶來強(qiáng)有力的利潤,例

49、如醫(yī)療設(shè)備,測試設(shè)備和移動機(jī)器也開始利用CAN總線的優(yōu)勢。本文的目的是解釋一些CAN的基本知識,和選擇CAN通信作為嵌入式系統(tǒng)網(wǎng)絡(luò)應(yīng)用的好處。</p><p>  CAN總線概述大多數(shù)網(wǎng)絡(luò)應(yīng)用程序遵循分層方法實(shí)施。這一系統(tǒng)的方法使不同產(chǎn)品之間的制造商共同創(chuàng)建一個標(biāo)準(zhǔn)的國際標(biāo)準(zhǔn)化組織(ISO)的為模板遵循這種分層方法。這就是所謂的國際標(biāo)準(zhǔn)組織開放系統(tǒng)互連(OSI)網(wǎng)絡(luò)分層參考模型。CAN協(xié)議本身實(shí)現(xiàn)了較低的最基

50、本參考模型層的通信模型中的一部分,是故意忽略CAN規(guī)范,使系統(tǒng)設(shè)計調(diào)整和優(yōu)化的通信協(xié)議最大程度的靈活性(雙絞線多種媒體,單絲,光隔離,射頻,紅外線等)。有了這個靈活性,但是,隨之而來的互操作的可能性成為關(guān)注。為了緩解這些問題一些國際標(biāo)準(zhǔn)組織與國際汽車工程師學(xué)會(SAE)在原來的基礎(chǔ)上定義了一些在CAN協(xié)議基礎(chǔ)上的定義,這包括在指定兩個底層媒體獨(dú)立接口的定義。</p><p>  ISO11898是一個用于高速應(yīng)用

51、的標(biāo)準(zhǔn),ISO11519是一個低速應(yīng)用標(biāo)準(zhǔn),J1939的(從SAE)對象是卡車和總線的應(yīng)用。所有這些協(xié)議的物理接口指定為一個5V的差分電氣總線。其余剩下ISO / OSI協(xié)議棧層由系統(tǒng)軟件開發(fā)商來實(shí)現(xiàn),更高一層的協(xié)議(HLPs)一般用來實(shí)現(xiàn)上面五層的OSI參考模型。</p><p>  HLPs用于:1)規(guī)范程序,包括比特率啟動使用時,2)參與節(jié)點(diǎn)之間分配地址消息或類型,3)確定的消息結(jié)構(gòu),4)提供系統(tǒng)級

52、的錯誤處理例程。這絕不是一個執(zhí)行的職能HLPs完整列表,但它確實(shí)描述了他們的基本的一些功能。</p><p><b>  CAN總線協(xié)議基礎(chǔ)</b></p><p>  載波偵聽多路訪問沖突檢測(CSMA / CD)</p><p>  CAN通訊協(xié)議是CSMA / CD協(xié)議,CSMA代表載波偵聽多路訪問。這意味著,每一個網(wǎng)絡(luò)節(jié)點(diǎn)在嘗試往總線上

53、發(fā)送一個消息期間,必須監(jiān)測總線并保證總線處于不活動狀態(tài)(載波監(jiān)聽);另外,當(dāng)總線處于空閑狀態(tài),總線上的每一個節(jié)點(diǎn)傳輸消息的機(jī)會是平等的(多址接入)。CD代表沖突檢測。如果兩個網(wǎng)絡(luò)上的節(jié)點(diǎn)在同一時間開始發(fā)送數(shù)據(jù),節(jié)點(diǎn)將檢測到?jīng)_突并采取適當(dāng)?shù)男袆?。在CAN協(xié)議中,利用無損逐位仲裁的方法。這也就是說,即使完成沖突檢測,仲裁后消息仍然保持完整,所有這一切仲裁均無損壞或延誤的最高優(yōu)先級的消息。</p><p>  無損逐位

54、仲裁的實(shí)現(xiàn)需要兩個條件。第一,邏輯狀態(tài)必須定義為顯性或隱性。第二,發(fā)送節(jié)點(diǎn)必須監(jiān)視總線狀態(tài),以此觀察正在試圖發(fā)送到總線上的實(shí)際邏輯狀態(tài)。CAN總線定義為一個邏輯顯性位0和邏輯隱性位1。一個顯性位的狀態(tài)總能仲裁隱性位的狀態(tài),因此,較低的消息標(biāo)識符值(消息中的仲裁過程中使用的字段),消息的優(yōu)先級越高。例如,假設(shè)兩個節(jié)點(diǎn)試圖在同一時間發(fā)送消息。每個節(jié)點(diǎn)會監(jiān)察總線,以保證它正試圖發(fā)送的位確確實(shí)實(shí)出現(xiàn)在總線上。</p><p&

55、gt;  較低的優(yōu)先級的消息將在某個點(diǎn)嘗試發(fā)送一個隱性位,并監(jiān)視總線狀態(tài)使自己成為主節(jié)點(diǎn)。此時,這個節(jié)點(diǎn)失去仲裁,并立即停止發(fā)送。更高的優(yōu)先級消息將持續(xù)發(fā)送直到完成,失去仲裁的節(jié)點(diǎn)將等待總線的下一個空閑周期,并嘗試發(fā)送數(shù)據(jù)。</p><p>  基于消息的通信CAN協(xié)議是一個基于消息的協(xié)議,而不是一個基于地址的協(xié)議,這意味著消息不能從一個節(jié)點(diǎn)地址傳送到另一個節(jié)點(diǎn)地址上。嵌入式CAN消息本身就是優(yōu)先和正在傳輸數(shù)

56、據(jù)的內(nèi)容。所有系統(tǒng)中的節(jié)點(diǎn)將接收每個傳遞在總線上的消息(如果消息正確接收并確認(rèn))。它是由系統(tǒng)的每個節(jié)點(diǎn)決定是否將接收到的數(shù)據(jù)立即丟棄還是保存處理。一個單一的消息可以設(shè)計成指定接受一個特定的節(jié)點(diǎn),或許多建立在網(wǎng)絡(luò)和系統(tǒng)上的節(jié)點(diǎn)。例如,汽車安全氣囊傳感器只能通過CAN連接到安全系統(tǒng)的路由器節(jié)點(diǎn),此路由器節(jié)點(diǎn)接收其他系統(tǒng)安全信息并轉(zhuǎn)發(fā)到安全系統(tǒng)網(wǎng)絡(luò)的其他節(jié)點(diǎn)上。安全系統(tǒng)網(wǎng)絡(luò)上的所有其他節(jié)點(diǎn)可以在同一時間從路由器上收到最新的安全氣囊傳感器的信息

57、,確認(rèn)是否被正確接收后,決定是否利用這些信息,或遺棄它。</p><p>  另外一個內(nèi)置在CAN協(xié)議中的有用的特性是,可以要求一個節(jié)點(diǎn)向另一個節(jié)點(diǎn)發(fā)送消息,這就是所謂的遠(yuǎn)程發(fā)送請求(RTR)。這個與前面的例子不同,因為,此時節(jié)點(diǎn)在等待一個特定的節(jié)點(diǎn)的消息,這個特定節(jié)點(diǎn)發(fā)出的消息是被動的。</p><p>  這種基于消息的協(xié)議的一個額外的好處是,可以添加額外的節(jié)點(diǎn),系統(tǒng)沒有必要對所有其他

58、節(jié)點(diǎn)進(jìn)行重新編程,也可以識別這個節(jié)點(diǎn)。這個新的節(jié)點(diǎn)將開始接收來自網(wǎng)絡(luò)的消息,根據(jù)消息ID,決定是否要處理或丟棄收到的信息。</p><p>  CAN消息幀描述CAN協(xié)議定義了四種不同類型的信息(或幀)。第一個也是最常見的類型是數(shù)據(jù)幀,這是用來當(dāng)一個節(jié)點(diǎn)發(fā)送信息系統(tǒng)中的任何或所有其他節(jié)點(diǎn);二是遠(yuǎn)程幀,這基本上是一個用來設(shè)置表示,它是一個遠(yuǎn)程發(fā)送請求RTR位的數(shù)據(jù)幀。其他兩個錯誤處理的幀,一個為錯誤幀和一個為過

59、載幀。檢測出CAN協(xié)議定義的錯誤都將產(chǎn)生錯誤幀,產(chǎn)生超載錯誤的節(jié)點(diǎn),需要更多的時間來處理已經(jīng)接收的數(shù)據(jù)。</p><p>  數(shù)據(jù)幀中包括的有關(guān)數(shù)據(jù)信息的額外字段由CAN定義規(guī)范,數(shù)據(jù)幀中嵌入仲裁場,控制場,數(shù)據(jù)區(qū),CRC場,一個2位的應(yīng)答場和一個幀結(jié)束。</p><p>  仲裁字段用于總線消息的優(yōu)先,由于CAN協(xié)議定義為邏輯0為顯性狀態(tài),在仲裁場的數(shù)字越低,在總線上的消息優(yōu)先級更高。該

60、仲裁場由仲裁場由12位(11位標(biāo)識符和RTR位)或32位(29個標(biāo)識符位,1位擴(kuò)展數(shù)據(jù)幀定義位,未使用的SRR位,RTR位),這取決于是否用到標(biāo)準(zhǔn)幀或擴(kuò)展幀。當(dāng)前版本的CAN規(guī)范2.0B版,定義了29位的標(biāo)識符,并稱其為擴(kuò)展幀。之前的CAN規(guī)范版本中定義的11位標(biāo)識符就是所謂的標(biāo)準(zhǔn)幀標(biāo)識符。正如上一節(jié)中所述,遠(yuǎn)程發(fā)送請求(RTR)用于一個節(jié)點(diǎn)時,要求信息發(fā)送給它從另一個節(jié)點(diǎn)。為了完成一個遠(yuǎn)程請求,遠(yuǎn)程幀發(fā)送與標(biāo)識符相同的數(shù)據(jù)幀。RT

61、R位仲裁字段是用來區(qū)分遠(yuǎn)程幀和數(shù)據(jù)幀,如果RTR位隱性的,則該消息是一個遠(yuǎn)程幀,如果RTR位是顯性的,該消息是一個數(shù)據(jù)幀。</p><p>  控制場由6位組成, MSB是IDE位(象征擴(kuò)展幀)大多數(shù)情況下為標(biāo)準(zhǔn)數(shù)據(jù)幀,該位決定如果消息是標(biāo)準(zhǔn)幀還是擴(kuò)展幀。在擴(kuò)展幀中,RB0和RB1位被保留。最低四位有效位是數(shù)據(jù)長度碼(DLC)位,數(shù)據(jù)長度碼位決定在消息中包含多少字節(jié)數(shù)據(jù)。應(yīng)當(dāng)指出,遠(yuǎn)程幀沒有數(shù)據(jù)領(lǐng)域,無論DLC位

62、為多少。數(shù)據(jù)區(qū)就是在控制場中描述的數(shù)據(jù)長度碼的字節(jié)數(shù)量的數(shù)據(jù)。CRC場包含一個15位的CRC字段和一個CRC定界符,用于接收節(jié)點(diǎn)時確定是否發(fā)生傳輸錯誤。</p><p>  應(yīng)答場是用來表示如果消息被正確接收。任何節(jié)點(diǎn)已正確收到的消息,不論節(jié)點(diǎn)處理或丟棄的數(shù)據(jù),都會在幀間間隔發(fā)送一個顯性位到總線上。</p><p>  最后兩個消息類型,錯誤幀和過載幀。當(dāng)一個節(jié)點(diǎn)檢測到一個由CAN協(xié)議定義

63、的錯誤時,會產(chǎn)生一個錯誤幀。過載幀告訴網(wǎng)絡(luò)該節(jié)點(diǎn)發(fā)送數(shù)據(jù)過載,該節(jié)點(diǎn)并沒有準(zhǔn)備好在這個時候接收更多的數(shù)據(jù),或在幀間間隔檢測到非法顯性位。</p><p><b>  快速,可靠的通信</b></p><p>  因為CAN協(xié)議最初設(shè)計用于汽車的使用,如果它要得到市場的認(rèn)可,關(guān)鍵是有效地處理錯誤。隨著發(fā)布2.0B版的CAN規(guī)范,相對1.0版本規(guī)范,最高通信速率增加8倍以

64、上達(dá)到1Mbit/sec。按照這一速度,大多數(shù)關(guān)鍵時間參數(shù)也可以連續(xù)無延時地傳輸。除了這個,CAN協(xié)議的有一個全面的錯誤檢測列表,以確保消息的完整性。CAN節(jié)點(diǎn)有能力根據(jù)故障狀況和所遇到的問題的嚴(yán)重性過渡到不同的模式。他們還有能力在檢測永久中檢測到短期擾動,從而相應(yīng)地修改它們的功能。CAN節(jié)點(diǎn)通能夠從像一個正常運(yùn)作的節(jié)點(diǎn)(即能夠發(fā)送和接收消息),也能根據(jù)檢測到的錯誤的嚴(yán)重性過渡到完全關(guān)閉的狀態(tài)(總線關(guān)閉),此功能被稱為故障隔離。無故

65、障節(jié)點(diǎn)將占用所有的帶寬,因為網(wǎng)絡(luò)將限制故障節(jié)點(diǎn),并在網(wǎng)絡(luò)癱瘓之前關(guān)閉故障節(jié)點(diǎn)和。這是非常強(qiáng)大,因為故障界定保證系統(tǒng)關(guān)鍵信息的帶寬。</p><p>  結(jié)論CAN協(xié)議對系統(tǒng)進(jìn)行了優(yōu)化,依靠任意網(wǎng)絡(luò)上的節(jié)點(diǎn),發(fā)送和接收信息量相對較少(與之相比,以太網(wǎng)或USB接口,其宗旨在移動更大的數(shù)據(jù)塊)。CSMA/CD的通信方式允許每個節(jié)點(diǎn)有平等的獲得訪問總線的機(jī)會,并可以順利處理沖突。由于協(xié)議是基于消息的,而不是基于地

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 眾賞文庫僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論