While CAN (Controller Area Network) is arguably old technology and was conceived for automotive applications, embedded design teams often find it to be the simplest interconnect choice when combining multiple microcontrollers (MCUs) in a distributed system for industrial or other embedded applications. The two-wire interface is simple yet robust, and bandwidth has increased with the evolution of the standard. CAN is extensible and it is easy to add nodes to a CAN-based system. Moreover, you will find support across the breadth of the MCU landscape. This means you can deploy a mix of low-end 8-bit MCUs with the fastest 32-bit MCUs in a distributed system while easily connecting the distributed network with CAN. In this article we'll review the basics of CAN technology and examine the range of new MCUs that support CAN.
CAN legacy yields reliability
CAN was conceived as a way to connect distributed automotive subsystems such as engine control, anti-lock braking, power steering, and other elements. It is separate from the high-speed networks such as MOST (Media Oriented Systems Transport) which are used for auto infotainment and telematics applications. CAN is primarily used to connect systems critical to the safe operation of the automobile.
Because the CAN specification was developed for the relatively rugged automotive environment, it is a good choice for use in many embedded applications such as distributed industrial-control systems. Over time, promulgation of the standards behind CAN moved from the SAE (Society of Automotive Engineers) to the ISO (International Standards Organization), although the SAE still controls some auto-centric CAN-related standards.
CAN was defined as a data-link layer standard in terms of the seven-layer ISO OSI (Open Systems Interconnection) model for communication networks. That layer is focused on reliable communications between two networked entities.
CAN is a multi-master bus and when it is free, any node can begin transmitting. Messages of up to eight data bytes are encoded in a NRZ (Non Return to Zero) format. The message also includes an ID field that indicates priority. When two nodes attempt to transmit simultaneously, the higher-priority message essentially overwrites the lower-priority one. Communications are single duplex. Nodes cannot send and receive data simultaneously.
Originally, the CAN standard did not define a PHY (physical layer). Subsequently, the ISO has published several PHY standards for CAN. The 2003 ISO 11898-2 standard defines the most broadly used PHY; with a maximum bandwidth of 1 Mbps at network ranges up to 40 m. Nodes are attached to the network anywhere along the two-wire cable. You can back data rate down to lower levels to extend range. For example, a network can cover 500 m with 125 bps rates. Clearly, the speeds pale in comparison to an alternative such as Ethernet, but are more than sufficient for many distributed MCU systems.
If you want to learn more about CAN technology and how it can be applied, you might watch one of several Hotenda multimedia Product Training Modules on CAN. CAN Basics – Part 1 and Can Basics – Part 2, presented by Renesas, are especially helpful.
When auto engineers first conceived CAN, IC density was relatively low. For years design teams utilized dedicated CAN ICs to support the network. Indeed, a typical application might have included an MCU or microprocessor, a CAN IC, and peripheral ICs such as data converters that were connected to sensors and actuators.
Today, MCUs integrate almost all of that system functionality, with the exception of the actual sensor or actuator. For example, if you need to monitor the temperature of something in your application, you would connect a thermocouple to an A/D converter input on the MCU. Likewise, driving a motor would require external drive electronics, but the control algorithm would be captured within the MCU.
We will now discuss the range of MCUs that include CAN support starting with products from Renesas. The R8C 16-bit family relies on CISC (Complex Instruction Set Computer) architecture and is optimized for low-power applications, although the MCUs also offer the ability to handle fairly complex applications with clock speeds as high as 20 MHz.
Figure 1: Renesas' R8C family includes several MCUs with CAN support and can target applications similar to the home- or office-automation which this block diagram depicts.
Renesas, for example, targets motor control among other applications with the R8C family. The combination of 40 MHz timers and 6-channels of PWM (Pulse Width Modulation) controllers enables the MCU to work in a variety of applications including BLDC (Brushless DC) motors. Figure 1 shows the R8C utilized in a home- or office-automation application where CAN is used to link lighting, HVAC, and other distributed systems. The R8C can also support touch-based interfaces via a dedicated SCU (Sensor Control Unit).
Moving to higher end processors, Renesas also supports CAN in its 32-bit MCUs. The RX MCU family is the company's newest and uses a CISC architecture with clock speeds maxing out at 100 MHz. Moreover, the MCUs can execute code from on-chip Flash with zero wait states at that speed. The RX600 MCUs come with 256 bytes to 2 Mbytes of Flash and an abundance of peripherals in addition to CAN. On the RISC (Reduced Instruction Set Computer) side of its product line, Renesas offers the V850 MCU family with CAN support.
PIC family with CAN
You can also get CAN integrated in 8-bit MCUs, as we discussed at the outset of the article. Microchip offers such products and in fact supports CAN in its 8-, 16-, and 32-bit PIC families, including the 16-bit dsPIC family which has added DSP-centric math capabilities.
Microchip's 8-bit PIC18C and PIC18F families include a broad selection of CAN-enabled MCUs. You can specify products with memory ranging from 16 Kbytes to 96 Kbytes. There are broad choices in data converters, and many models include an internal oscillator to minimize the bill of materials. If you want to experiment with CAN, there are many demonstration boards available. For example, Microchip offers two CAN-centric demonstration boards that include members of the PIC18 family (Figure. 2).
Figure 2: Microchip's DM16305 demonstration kit includes a PIC18F MCU and allows designers to experiment with both CAN and LIN (Local Interconnect Network) networks.
Applications increasingly require multiple MCUs, either due to specialized processing requirements or simply to facilitate a need to locate an MCU resource near a sensor or actuator. CAN may be the best choice for connecting those MCUs in a distributed network, even if you application is far removed from the automotive field. It is especially valuable that you can get CAN support across a broad spectrum of MCUs. These choices allow you to match the processing requirements with the most optimized and cost-effective MCU at each node.