Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
1 of 16

MCP2515: Stand-Alone CAN Controller

5

Share

An overview study on Stand-Alone CAN Controller: MCP2515

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all

MCP2515: Stand-Alone CAN Controller

  1. 1. MCP2515: Stand-Alone CAN Controller <ul><li>Source: Microchip Technology </li></ul>
  2. 2. Introduction <ul><li>Purpose </li></ul><ul><ul><li>An overview study on Stand-Alone CAN Controller: MCP2515 </li></ul></ul><ul><li>Outline </li></ul><ul><ul><li>Features and target application </li></ul></ul><ul><ul><li>Block diagram standalone CAN controller. </li></ul></ul><ul><ul><li>Basics of CAN, Layers. </li></ul></ul><ul><ul><li>CAN Message Frames, receive buffers </li></ul></ul><ul><ul><li>CAN Bit time and Modes of operation </li></ul></ul><ul><li>Content </li></ul><ul><ul><li>16 pages </li></ul></ul>
  3. 3. Features <ul><li>Implements CAN V2.0B at 1 Mb/s </li></ul><ul><li>Three transmit buffers with prioritization and abort features </li></ul><ul><li>High-speed SPI Interface (10 MHz): </li></ul><ul><li>Two receive buffers with prioritized message storage, Six 29-bit filters, Two 29-bit masks. </li></ul><ul><li>Start-of-Frame (SOF) signal is available for monitoring the SOF signal </li></ul><ul><li>Buffer Full output pins configurable as: Interrupt output and General purpose output </li></ul><ul><li>Request-to-Send (RTS) input pins individually configurable as: Control pins to transmission of buffer and General purpose inputs. </li></ul><ul><li>One-shot mode ensures message transmission is attempted only one time </li></ul>
  4. 4. Target Applications <ul><li>■ Industrial control </li></ul><ul><li>■ Maritime electronics </li></ul><ul><li>■ Avionics/aerospace electronics </li></ul><ul><li>■ UPS (Uninterruptible Power Supply) </li></ul><ul><li>■ Heavy machinery and earth moving equipment </li></ul><ul><li>■ Factory automation </li></ul><ul><li>■ Medical equipment </li></ul><ul><li>■ Elevator control </li></ul><ul><li>■ Exercise equipment </li></ul><ul><li>■ Automotive passenger car </li></ul><ul><li>■ Trucks/buses </li></ul><ul><li>■ Off-highway and off-road vehicles </li></ul>
  5. 5. Block Diagram Of MCP2515 <ul><li>The CAN module, which includes the CAN protocol engine, masks, filters, transmit and receive buffers. </li></ul><ul><li>The control logic and registers that are used to configure the device and its operation. </li></ul><ul><li>It contains SPI protocol block </li></ul>
  6. 6. Standalone CAN Controller Simple Sensor Node Using MCP2515 Standalone CAN Controller <ul><li>Communication between the Control Logic block and the CAN interface block is done by built-in support SPI Protocol. </li></ul><ul><li>The CAN controller provides a full CAN 2.0 implementation with message filtering, which relieves the host microcontroller from having to perform any CAN bus related overhead. </li></ul>
  7. 7. Layers of CAN <ul><li>The CAN functionality is divided into two layers. </li></ul><ul><li>                     </li></ul><ul><li>Data link layer: </li></ul><ul><ul><li>Logical link layer: </li></ul></ul><ul><ul><li>     Accept the messages by filtering process, overload notification and recovery management tasks will be taken care by this layer. </li></ul></ul><ul><ul><li>MAC (medium access control) layer: </li></ul></ul><ul><ul><li>This layer will do the data encapsulation; frame coding, media access management, error detection and signaling and acknowledgment tasks. </li></ul></ul><ul><li>  Physical layer: </li></ul><ul><ul><li>This layer deals with the bit encoding and de- coding, bit timing, synchronization processes </li></ul></ul>
  8. 8. CAN Buffers And Protocol Engine Block Diagram
  9. 9. CAN Message Frames: Standard Format <ul><li>The CAN protocol supports two message frame formats. Standard Format and Extended Format. </li></ul><ul><li>In the standard format the length of the ID is11 bits, (Version 2.0A). </li></ul><ul><li>The message frame for transmitting messages on the bus comprises seven main fields. </li></ul><ul><li>A message in the standard format begins with the start bit ”start of frame” </li></ul><ul><li>The ”control field” contains the IDE (identifier extension) bit, which indicates either standard format or extended format. </li></ul><ul><li>The ”data field” ranges from 0 to 8 bytes in length and is followed by the ”CRC field” </li></ul>
  10. 10. CAN Message Frames: Extended Format <ul><li>To support SAE ”Truck and Bus” subcommittee standardized signals, the CAN protocol was extended by the introduction of a 29-bit identifier. </li></ul><ul><li>In the extended CAN data frame, the SOF bit is followed by the arbitration field. which consists of 32 bits. </li></ul><ul><li>This identifier is made up of the existing 11-bit identifier (base ID) and an 18-bit extension (ID extension). </li></ul><ul><li>The SRR bit is followed by the lDE bit, which is recessive to denote an extended CAN frame. These are followed by 18 bit of id and RTR bit. </li></ul>
  11. 11. Detecting and signalling errors <ul><li>Cyclic Redundancy Check (CRC) </li></ul><ul><ul><li>The CRC safeguards the information in the frame by adding redundant check bits at the transmission end. </li></ul></ul><ul><ul><li>At the receiver end these bits are re-computed and tested against the received bits. </li></ul></ul><ul><li>Frame check </li></ul><ul><ul><li>This mechanism verifies the structure of the transmitted frame by checking the bit fields against the fixed format and the frame size. </li></ul></ul><ul><ul><li>Errors detected by frame checks are designated ”format errors”. </li></ul></ul><ul><li>ACK errors </li></ul><ul><ul><li>Frames received are acknowledged by all recipients through positive acknowledgement. </li></ul></ul><ul><ul><li>If no acknowledgement is received by the transmitter of the message (ACK error) there is a transmission error detected by the recipients. </li></ul></ul>
  12. 12. Receive Buffer Block Diagram
  13. 13. CAN Bit Time CAN BIT TIME SEGMENTS TQ AND THE BIT PERIOD <ul><li>The Nominal Bit Time (NBT) (tbit) is made up of non-overlapping segments. </li></ul><ul><li>Each of the segments that make up a bit time are made </li></ul><ul><li>up of integer units called Time Quanta (TQ). </li></ul>
  14. 14. CAN Interrupts CANINTE – INTERRUPT ENABLE CANINTF – INTERRUPT FLAG <ul><li>The MCP2515 has eight sources of interrupts. The CANINTE register contains the individual interrupt enable bits for each interrupt source. </li></ul><ul><li>Interrupts are Transmit Interrupt, Receive Interrupt, Message Error Interrupt, Bus Activity Wakeup Interrupt, Error Interrupt, Interrupt Acknowledge. </li></ul><ul><li>The CANINTF register contains the corresponding interrupt flag bit for each interrupt source. </li></ul>
  15. 15. Modes Of Operation <ul><li>The MCP2515 has five modes of operation. These modes are: </li></ul><ul><ul><li>1) Configuration mode 2) Normal mode 3) Sleep mode 4) Listen-only mode. 5) Loopback mode. </li></ul></ul><ul><li>The operational mode is selected via the CANCTRL. REQOP bits as shown below. </li></ul><ul><li>Normal mode is the standard operating mode, here the device actively monitors all bus messages and generates acknowledge bits, error frames, etc. </li></ul><ul><li>Configuration mode is automatically selected after power-up. </li></ul><ul><li>Sleep mode is used to minimize the current consumption of the device </li></ul>CANCTRL – CAN CONTROL REGISTER
  16. 16. Additional Resource <ul><li>For ordering MCP2515, please click the part list or </li></ul><ul><li>Call our sales hotline </li></ul><ul><li>For more product information go to </li></ul><ul><ul><li>http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en010406 </li></ul></ul><ul><li>For additional inquires contact our technical service hotline or even use our “Live Technical Chat” online facility </li></ul>Newark Farnell

Editor's Notes

  • Welcome to the training module on MCP2515 Stand-alone CAN controller. In this training module, we will discuss the basic features, layers, operation and applications of this device.
  • CAN stands for Controller Area Network. Microchip Technology’s MCP2515 is a stand-alone CAN controller that implements the CAN specification, version 2.0B. It is capable of transmitting and receiving both standard &amp; extended data as well as remote frames. The MCP2515 has 2 acceptance masks and 6 acceptance filters that are used to filter out unwanted messages, thereby reducing the host MCU’s overhead. This device interfaces with microcontrollers via an industry standard Serial Peripheral Interface or SPI for short.
  • CAN is being designed into a wide range of applications that use command and control networks. Some of these applications include: industrial control, maritime electronics, avionics &amp; aerospace electronics, UPS’s, heavy machinery and earth moving equipment. Others include: factory automation, medical equipment, exercise equipment, elevator control and automotives just to mention a few. The CAN serial bus protocol is a high-speed, reliable communication protocol for applications requiring robust communications at bit rates reaching 1 Mbps
  • This is the block diagram of the CAN controller. The CAN module handles all functions for receiving and transmitting messages on the CAN bus. Messages are transmitted by first loading the appropriate message buffer and control registers. Transmission is initiated by using control register-bits via the SPI interface or by using the transmit-enable pins. The control logic block, controls the setup and operation of the MCP2515 by interfacing to the other blocks in order to pass information and control. Interrupt pins are provided, to allow greater system flexibility. The MCU interfaces to the device via the SPI interface. Writing to, and reading from all registers is accomplished using standard SPI read &amp; write commands, in addition to specialized SPI commands.
  • Connectivity within a vehicle is dominated today by two main network protocols: CAN or Controller Area Network is one and the other is LIN or Local Interconnect Network. CAN utilizes a robust, high-speed protocol, usually linking major nodes or subsystems within the vehicle, such as ABS, airbag, power-train and suspension control modules. LIN is a low speed, single-wire network, that usually links nodes within a vehicle’s subsystem, such as body electronics, headlight controls and occupant detection.
  • Most network applications follow a layered approach to system implementation. As a result a standard was created. This standard is known as the ISO Open Systems Interconnection or OSI Network Layering Reference Model. The CAN protocol itself, implements most of the lower two layers of this reference model. This enabled system designers to adapt and optimize the communication protocol on multiple media for maximum flexibility.
  • The MCP2515 has three transmit and two receive buffers, two acceptance masks; one for each receive buffer, and a total of 6 acceptance filters. The heart of the engine is the Finite State Machine or FSM. The FSM is a sequencer that controls the sequential data stream between the Tx Rx shift register, the CRC register and the bus line. The FSM also controls the Error Management Logic or EML and the parallel data stream between the Tx Rx shift registers and the buffers. The Cyclic Redundancy Check or CRC register generates the Cyclic Redundancy Check code, which is transmitted after either the Control Field or the Data Field, and is used to check the CRC field of incoming messages.
  • The MCP2515 supports standard data frames, extended data frames and remote frames), as defined in the CAN 2.0B specification. A message in the standard format begins with the start bit ”start of frame”. This is followed by the ”arbitration field”, which contains the identifier and the ”RTR” or remote transmission request-bit, which indicates whether it is a data frame or a request frame without any data bytes. The ”control field” contains the IDE or identifier extension-bit, which indicates either standard format or extended format. The ”data field” ranges from 0 to 8 bytes in length and is followed by the ”CRC field”, which is used as a frame security check for detecting bit-errors. The ”ACK field”, comprises the ACK slot (1 bit) and the ACK de-limiter.
  • In the extended CAN data frame, the SOF bit is followed by the arbitration field, which consists of 32 bits. The first 11 bits are the Most Significant bits of the 29-bit identifier. These 11 bits are followed by the Substitute Remote Request or SRR bit, which is defined to be recessive. The SRR bit is followed by the l-D-E bit, which is recessive to denote an extended CAN frame. The SRR bit in an extended CAN frame must be recessive to allow the assertion of a dominant RTR bit by a node that is sending a standard CAN remote frame. The SRR and l-D-E bits are followed by the remaining 18 bits of the identifier and the remote transmission request bit.
  • The CAN protocol does not use acknowledgement messages but instead signals any errors that occur. For error detection, the CAN protocol implements three mechanisms at the message level. They are Cyclic Redundancy Check, Frame check and ACK errors. The CAN protocol also implements two mechanisms for error detection at the bit level. They are Monitoring and Bit Stuffing.
  • The device also includes two full receive buffers with multiple acceptance filters for each. There is also a separate Message Assembly Buffer or MAB that acts as a third receive buffer. The MAB is always committed to receiving the next message from the bus. The MAB assembles all messages received. The remaining two receive buffers, called Rx B0 and Rx B1, can receive a complete message from the protocol engine via the MAB. The MCU can access one buffer, while the other buffer is available for message reception, or for holding a previously received message.
  • The CAN protocol uses Non Return to Zero (NRZ) coding, which does not encode a clock within the data stream. Therefore, the receive clock must be recovered by the receiving nodes and synchronized to the transmitter’s clock. Each of the segments that make up a bit time are made up of integer units called Time Quanta or TQ. The length of each Time Quantum is based on the oscillator period (tOSC). The base TQ equals twice the oscillator period. The Synchronization Segment is the first segment in the NBT and is used to synchronize the nodes on the bus. This segment is fixed at 1 TQ. All devices on the CAN bus must use the same bit rate. For the different clock frequencies of the individual devices, the bit rate has to be adjusted by appropriately setting the baud rate pre-scaler and number of time quanta in each segment.
  • The MCP2515 has eight sources of interrupts. The CAN INT E register contains the individual interrupt enable bits for each interrupt source. The CAN INT F register contains the corresponding interrupt flag bit for each interrupt source. When an interrupt occurs, the INT pin is driven low by the MCP2515 and will remain low until the interrupt is cleared by the MCU. An interrupt cannot be cleared if the respective condition still prevails. The CAN INT F flags are read/write and an interrupt can be generated by the MCU setting any of these bits, provided the associated CAN INT E bit is also set.
  • The MCP2515 has 5 modes of operation. Configuration mode is automatically selected after power-up, a reset can be entered from any other mode by setting the CAN CONTROL REGISTER REQ-OP bits. When Configuration mode is entered, all error counters are cleared. Sleep mode is used to minimize the current consumption of the device. The SPI interface remains active for reading even when the MCP2515 is in Sleep mode, allowing access to all registers. Listen-only mode provides a means for the MCP2515 to receive all messages. This mode can be used for bus monitor applications or for detecting the baud rate in ‘hot plugging’ situations.
  • Thank you for taking the time to view this presentation on “ MCP2515” . If you would like to learn more or go on to purchase some of these devices, you may either click on the part list link, or simply call our sales hotline. For more technical information you may either visit the Microchip Technology site, or if you would prefer to speak to someone live, please call our hotline number, or even use our ‘live chat’ online facility.
  • ×