Feature
FROM EDN EUROPE: CANbus networks break into mainstream use
It takes years for some technologies to reach commodity status. CAN is one that's now enjoying acceptance. Cost-effective development kits and test equipment ease your entry into this robust networking environment.
By David Marsh, Contributing Technical Editor -- EDN Europe, 8/8/2002
|

It has now been more than 15 years since auto-electronics maker Robert Bosch developed the CAN (controller-area-network) protocol to communicate between electronic-control units within powertrain-control applications. Following its introduction at the SAE (Society of Automotive Engineers) Congress in 1986, Bosch licenced the protocol to a variety of equipment manufacturers and silicon fabricators. The first licencee was Intel, whose 82526 in 1987 became the first commercially available CANbus controller; other early adopters include Philips and Motorola. Bosch has since signed more than 40 licencees, and the protocol enjoys established ISO status (Reference 1). The technology's applications have broken free of the automotive arena to include industrial networking, medical equipment, numerical machine control, railway signalling, controlling building services, and even vending machines—any application that requires robust communications with predictable latencies at bit rates reaching 1 Mbps.
CAN has only recently become a true commodity networking technology. As with many electronics-design technologies and, despite possessing unique technical advantages, it has taken time for CAN to gain widespread commercial off-the-shelf acceptance. Compared with the previous year's statistics, figures for 2000 reveal that CAN-enabled microcontroller shipments doubled to more than 100 million units, and similar growth continues. Of course, CAN's maturity offers huge advantages. Apart from ISO and SAE standardisation, time-proven performance, and falling hardware costs, you can purchase CAN silicon from approximately 15 chip makers that offer more than 50 controller chips. Several of these vendors and many third-party vendors offer fast-track development boards to help you get started, and—whereas until recently you could choose only expensive units—a broad selection of test equipment is now available to suit wide-ranging application profiles. From the technical viewpoint, CAN's continuous development and standardisation work means that the technology can now address emerging applications. Significantly, papers presented at February 2002's Eighth International CAN Congress in Las Vegas focused on TTCAN (time-triggered communication via CAN) and CAN-gateway technology for wireless networks (Reference 2).
CAN's popularity results from the elegant ways that the developers found to guarantee predictable error-free communications within the safety-conscious automotive environment. You can freely download the protocol specifications from www.can-cia.de, but a quick review of the key features and limitations helps you to assess the technology's suitability to your projects. At first glance, a serial multimaster bus system with a maximum 1-Mbps rate sounds less than exciting when today's desktop PC users commonly enjoy 100-Mbps Ethernet connections. But, although an office Ethernet network might every hour shuffle gigabytes of data between file servers and users, the average CAN-transmission packet that exchanges relatively simple control and measurement parameters comprises less than 100 bits (see sidebar "CAN primer").
Hardware requirementsEarly CAN controllers divided into BasicCAN and FullCAN types, with the BasicCAN version handling the protocol conversions and providing minimal message filtering. Citing lower silicon costs and maximum message-reception bandwidth, Philips originally championed the BasicCAN approach. In contrast, Intel argued in favour of FullCAN's ability to reduce host-processor load by assuming responsibility for communications overhead, such as error recovery. Today's silicon blurs these distinctions, typically making such considerations unnecessary, yet some legacy evidence remains, as Philips' ubiquitous SJA1000 stand-alone CAN controller illustrates (Figure 1). At power-up, the SJA1000 defaults to BasicCAN mode to maintain compatibility with the company's first-generation 82C200 controller. You can then program the SJA1000 into "PeliCAN mode," in which the chip supports CAN 2.0B active operation with message-filtering enhancements.
Features of the SJA1000 that ease development include error-handling mechanisms, such as interrupt-on-error, an error-code capture register, read/writable error counters, and a programmable-error-count warning limit. A listen-only mode inhibits writing dominant levels on the bus and, thus, transparently supports bus-traffic analysis. Local and global self-test modes read back the chip's transmission data, respectively ignoring or requiring reception acknowledgment via the ACK bit. The arbitration-lost feature reports bit positions in which the local node loses priority to another device. Also, a single-shot transmission request command defeats the normal CANbus automatic-transmission-retry logic. This feature can be useful in situations in which the data becomes stale while the bus rearbitrates multiple times. To support the SJA1000, Philips publishes a useful application note that includes samples of code to suit 80x51-family microcontrollers (Reference 3). The SJA1000 core also appears within an 80x51-family microcontroller in the guise of the 8xC591 series and costing around €7 (100); the SJA1000 costs around €2.75 (1000).
Kits speed developmentCAN is now so mainstream that catalogue distributors, such as Farnell and RS Components, routinely carry development kits from semiconductor makers, including Atmel, Infineon, Microchip, and Motorola. Atmel is relative latecomer to the CAN market, and its kit is a new product that comprises two boards. The first board serves as an evaluation and flash-programming platform for the company's range of PLCC-packaged C51/C251 microcontrollers. An extension board plugs into the main board to add the CAN-enabled 89C51CC01 microcontroller and a Vishay Siliconix Si9200 transceiver; connection to a CAN bus is via the CiA (CAN in Automation) group's recommended DB9 connector. You also get documentation, including the circuit diagrams, a serial cable, and various demo programs, and the company thoughtfully adds a PLCC extraction tool. The kit is available now from Farnell and costs approximately €150.
Microchip, too, is a recent entrant to the CAN market, offering the MPC2510 stand-alone controller and a new range of CAN-enabled flash-memory microcontrollers, such as the PIC18F248. Kit-level support comes in the form of the company's MPC2510 CAN developer's kit, which serves as a software-development and CAN-communications tool. The board includes two CAN nodes that connect to an onboard bus, making it easy to develop and test a basic network. The conventional DB9 connector serves an external bus. Software tools include two templates that provide an interface to bit- and message-level communications. The kit costs approximately €250.
Courtesy of their connections with the automotive industry, Infineon and Motorola have enjoyed a long presence in CAN market. Infineon offers a range of kits that specialist kit assemblers, such as Phytec and TQ Components, make for the company. These kits encompass the company's microcontroller families. The CAN-enabled members are the 8-bit C515C; the 16-bit C167CR and its dual-CAN-port derivative, the C167CS; and the newly, 32-bit TC1775B TriCore microcontroller, which features dual, independently programmable CAN ports (Reference 4). As well as including comprehensive documentation, each of these kits comes with evaluation versions of tools, such as the Keil and Tasking compilers, which allow sufficient code space to generate rudimentary routines. Available from Farnell and Hitex, Infineon's kits range in price from approximately €250 to €450.
Motorola's kit for the MC68HC912D60 microcontrollerincludes a CAN port that's driven by the company's TouCAN controller implementation. The TouCAN controller includes a three-buffer-deep message queue that supports continuous transmission requests in message-priority order. Following acceptance filtering, the TouCAN hardware stores reception messages in a two-stage input FIFO that decouples the microcontroller from the CAN module, making it easier to implement application software. You can order the kit from RS Components for approximately €650.
Phytec offers its own range of kits for processors from Atmel, Infineon, and Philips. For the Philips 80x51-family, Phytec's 87C591 module plugs into a general-purpose baseboard and includes 128 kbytes each of external flash and SRAM. A serial EEPROM serves as storage for network-configuration data. Development-kit tools include an in-system flash-programming facility and a CD containing code examples that Phytec guarantees to work the first time. You can download the kit's hardware manual and programming examples for Keil and Tasking 80x51 compilers from Phytec's Web site; you can also place an order for approximately €375.
Hitex, too, has recently introduced CAN starter kits with an ISO-11898- compatible, optically isolated physical-layer implementation that suits industrial-automation development. The kits include a processor card that uses Motorola's 20-MHz 68332microcontroller to control two Philips SJA1000 controllers for dual-channel capability. Available in ISA, PCI, and PC/104 formats, the card can time-stamp message receptions with 10-µsec resolution. A separate card that carries analogue-I/O hardware functions as a sensor or as an actuator. Software support includes a 32-bit, Windows-compatible sample application, together with device drivers for Win 95/98/NT, Win CE, and DOS; source-code documentation allows you to develop custom drivers for alternative OSs, such as Linux. The kits are available now for approximately €850. Janz Computer offers a similar kit; other industrial-strength products include Port's CANopen kit, and Kvaser's NMEA2000 kit, which suits maritime-CAN developers.
Boards with dual CAN nodes make it easy to construct a functional network by making a loop-back connection; without this ability, you need external hardware support to get started. And with appropriate software support, a dual-channel board can perform functions such as examining network traffic on either side of a CAN gateway device. Of course, you can link two single-node development boards to build a bus, and Lawicel takes this approach with two-node kits that sell for approximately €275 each. The company offers boards that use Infineon's C505CA and C515C microcontrollers, as well as the combination of Atmel's 8515 AVR microcontroller with Philips' SJA1000 controller. All kits include sample software that gives you a reliable entry point to further software development.
Software drives test analysisVirtually all development projects mandate independent test equipment, and your options for CAN range from simple CANbus interfaces to sophisticated bus-analysis systems. For approximately €100, Lawicel's CAN232 is the least expensive and simplest available PC-to-CANbus interface. The device plugs into a PC's serial port to convert between RS-232 and CAN protocols. Because it's a hardware-gateway device, the CAN232 operates independently of operating-system concerns in any environment that supports an RS-232 driver. But it's your responsibility to write application code. Also, notice that the device best suits networks that operate at 125 kbps or lower; frame capture is erratic at best in a 1-Mbps environment.
National Instruments, Peak System Technik, Softing, and Vector Informatik offer a range of hardware and software that varies in sophistication. Peak's representative range of hardware and software products varies from ISA-bus cards that start at prices of €100 to a €3500 software-development kit. The company's ships its interface hardware as standard with a DOS-compatible CANview software package that lets you send and receive messages at sample rates reaching 1 msec. You also get example source code for read, write, and status-reporting functions in ANSI-C. Recognising that many field buses run legacy applications, the DOS-compatible CANmon utility extends CANview's data-logging facilities for approximately €150. Suiting Windows PCs, the PCAN-Explorer software provides graphical insight into network operation, reporting details such as the message identifier, length, and data content (Figure 2). To simulate network response, you can load and save lists of transmission messages using a simple macro editor. You can assign symbolic definitions to messages to ease visualisation. PCAN-Explorer costs approximately €435.
For top-level development, the PCAN-Developer software-development kit augments programming environments, such as Delphi and Visual Basic. The core of this package is a 32-bit Windows -kernel-mode driver that connects your application program to the underlying physical hardware to provide 1-msec sampling within an NT/2000 environment. You connect devices to "nets" that provide a graphical interface into network configuration. Bundled software tools ease configuration, make performance measurements, and allow you to visualise network operation. The five-driver license-evaluation version costs approximately €550; the unlimited version costs approximately €3500.
Warwick Control Technologies' X-Analyser software runs with Softing's range of interface cards, including the dual-channel PCI and PCMCIA models. The software's principal role is to monitor real-time bus traffic, but you can also transmit messages, including error frames, to accurately simulate network behaviour. You can send messages cyclically at periods of 1 to 65,535 msec to simulate the data streams that devices such as electronic speedometers require, or you can trigger a transmission in response to a message. For transparent bus monitoring, the software includes a mode in which the interface card plays no part in bus arbitration and also refrains from sending error frames. A symbolic database converts bus traffic to meaningful units and works down to the CANbus-bit level. You can store data for later analysis and import data files from other systems in common CAN-database formats. Statistical-analysis abilities include bus-load, frame-rate, and lost-frame information for each interface-card channel. Options are available to support CANopen, DeviceNet, and J1939 automation protocols. Prices for X-Analyser with a single-channel USB-CAN interface start at approximately €2100. The product is now available.
The de facto standard in the automotive industry, Vector Informatik's CANalyser system is available in junior, fundamental, and professional levels. The single-channel junior-version analyser offers data-tracing, -filtering, -logging, and -generation capabilities. The measurement-setup window allows you to configure and display test-run data flow in terms of data sources, sinks, and function blocks. The message-and-signal explorer window makes it easy to map and manage symbol names to their identifiers. A simple statistics window reports bus-traffic information, such as the number of messages and errors per identifier over time, and a database stores bus-traffic information in Vector's CANdb format. The midrange fundamental version allows you to analyse as many as 32 channels by using multiple interface cards. You also get sophisticated functions, such as a replay block that you can use to drive the bus with previously recorded data. You can then test individual elements, such as sensors, by filtering out irrelevant bus traffic. Other facilities include a graphical trace window that displays variable data, such as engine speed and gear selection versus time with cursors that make measurements at one point or relative to two points (Figure 3). The professional version adds the ability to program the system to perform bespoke functions in the C-like CAPL (CAN application-programming language). All versions are Windows-compatible and support a range of hardware interfaces. Prices start at approximately €1900 for the junior version with a parallel-port adapter and approximately €3630 and €5180 for the fundamental and professional versions, respectively, with Vector's dual-channel PCMCIA card.
Scopes still prove invaluableAs waveform quality dominates datacommunications reliability, you'll want to evaluate physical-layer conditions and evaluate cable types, bus transceivers, and termination arrangements. On some occasions, you need to examine the physical layer to track faults in an errant CANbus system. Unless a gross fault, such as a shorted CAN_H bus line, exists, a normal scope offers limited assistance: All you see is frames whizzing past. Agilent's 54600 mixed-signal series of DSOs aims to improve this situation by including CAN, I2C, SPI, and USB serial-bus trigger capabilities within general-purpose scopes. Dedicated CANbus modes comprise start-of-frame, remote-transfer-request, and overload-frame triggers. The new model 54641A is a conventional, 350-MHz, dual-channel analogue-input DSO that has 8 Mbytes of acquisition memory. Although there's no substitute for deep memory to capture signal details in serial bus streams, it can be hard to find what you're looking for. Agilent's proprietary MegaZoom technology helps you to locate details buried in memory. The 54641A also boasts maximum screen-refresh rates of 25 million vectors/sec, outperforming many analogue scopes, plus 32 intensity-graded grey levels that simulate an analogue scope's response to repetitive signals. Prices for the model 54641A start at approximately €5500.
Andy Buxton, sales manager at CAN specialist Accutest, notes that, because receiving nodes signal transmission errors, it can be hard to see the root cause of an error. To help localise faults, you often need multiple CANbus-trigger capabilities. Connecting via a PC's serial port, Vector's CANscope is a logging module that digitises and buffers CANbus traffic for software analysis. You can use it as a stand-alone module to record as much as 32 kbytes of data for later download and analysis. The module samples 160 kHz to 32 MHz, measures voltages with 20-mV resolution, and triggers on programmable maximum/minimum bus-voltage values. A DSO-like pretrigger mode allows you to capture data on and around a CAN message or an error frame. The analysis software displays bus-line voltages and their differential voltage over time and highlights the protocol's stuff bits. The software simultaneously displays CAN messages, message fragments, or error frames in a trace window. You can scroll through this window to select items such as message identifiers, which the scope displays and then reflects. Similarly, a measurement cursor allows you to scroll through the scope window and update the trace information. The system includes Vector's CANdb database for data archiving and exchange with CANalyser systems. Available now, the CANscope costs approximately €4500.
If you need a DSO-based bus analyser, consider Yokogawa's DL7200 CANbus signal analyser. This benchtop instrument layers CAN- and SPI-bus analysis capabilities on the company's 500-MHz, four-channel DSO. In CAN mode, it can record 4M to 16M samples into memory at bit rates of 33.3 kbps to 1 Mbps—sufficient to analyse as many as 8000 frames. The instrument's bandwidth helps you to identify high-frequency noise components, and the 16M-sample memory option allows you to record a 500-kbps bit stream with 100-point-per-bit resolution for 320 msec. You can set a percentage to represent the sample point within a bit time to ensure compliance with CANbus specifications (Figure 4). CANbus-trigger facilities include message identifier, start of frame, remote-transfer request, and error frame. You can also trigger on data-field information and logically combine any or all of these trigger sources. And the multichannel scope allows you to measure physical quantities, such as a sensor's output, synchronously with CAN data acquisition to ease debugging control systems; a 16-channel digital-input option broadens this capability. Prices for the DL7200 start at approximately €19,500.
| For more information... | ||
| When you contact any of the following manufacturers directly, please let them know you read about their products in EDN Europe. |
||
| Accutest www.accutest.co.uk | Agilent www.tm.agilent.com | Hitex www.hitex.com |
| Kvaser www.kvaser.com | Lawicel www.lawicel.com | Motorola www.motorola.com |
| National Instruments www.ni.com | Peak System Technik www.peak-system.com | Phytec www.phytec.com |
| Port www.port.de | Vector Informatik www.vector-informatik.com | Warwick Control Technologies www.warwickcontrol.com |
| Yokogawa www.yokogawa.com | ||
| Other companies and organisations mentioned in this feature | ||
| Atmel www.atmel.com | CiA (CAN in Automation) www.can-cia.de | Farnell www.farnell.com |
| Infineon Technologies www.infineon.com | Intel www.intel.com | Janz Computer www.janz.de |
| Keil www.keil.com | Microchip www.microchip.com | Philips Semiconductors www.semiconductors.philips.com |
| Robert Bosch www.can.bosch.com | RS Components http://rswww.com | Society of Automotive Engineers www.sae.org |
| Softing www.softing.de | Tasking www.tasking.com | TQ Components www.tqc.de |
| Vishay Siliconix www.vishay.com | ||
| Author Information |
| You can reach Contributing Editor David Marsh at forncett@btinternet.com. |
| References |
|
|















