AN1077 APPLICATION NOTE

Similar documents
New Generation of CAN Controllers Optimized for 8-bit MCUs

AN1369 APPLICATION NOTE

AN1070 APPLICATION NOTE

AN1576 APPLICATION NOTE

Implementation of automotive CAN module requirements

ST7 Benefits versus Industry Standard

APPLICATION NOTE STACK OVERFLOW DETECTION USING THE ST9 TIMER/WATCHDOG

AN1527 APPLICATION NOTE

AN1106 APPLICATION NOTE

AN1601 APPLICATION NOTE

EXECUTING CODE IN ST7 RAM

AN4113 Application note

AN3154 Application note

PSDPRO Parallel Port Programmer for ST s Programmable System Device (PSD) Products

AN2672 Application note

ST6-SW SOFTWARE DEVELOPMENT TOOLS FOR ST6 MCU FAMILY

AN3996 Application Note

AN2667 Application note

STEVAL-CCM002V1. TFT-LCD panel demonstration board based on the STM32 as LCD controller. Features. Description

STEVAL-PCC010V1. ST802RT1A Ethernet PHY demonstration board with STM32F107 controller add-on board. Features. Description

STA bit single chip baseband controller for GPS and telematic applications. Features

AN2548 Application note

ST19WR08 Dual Contactless Smartcard MCU With RF UART, IART & 8 Kbytes EEPROM Features Contactless specific features

ST10F271B/E, ST10F272B/E Errata sheet

STM8 I 2 C optimized examples

OSPlus USB Extension. OSPlus USB 2.0 extension. Description. Features. Application. TCP/IP stack NexGenOS NexGenIP VFS. FAT Ext2 LVM Device layer

AN2825 Application Note

ST21NFCB. Near field communication controller. Features. RF communications. Hardware features. Communication interfaces. Electrical characteristics

Obsolete Product(s) - Obsolete Product(s)

AN1432 APPLICATION NOTE

Description of STM8 LIN software package (STSW-STM8A-LIN) release 4.1. Table 1. Release information. STM8 LIN package

STEVAL-SPBT4ATV3. USB dongle for the Bluetooth class 1 SPBT2632C1A.AT2 module. Features. Description

AN3279 Application Note

UM0792 User manual. Demonstration firmware for the DMX-512 communication protocol transmitter based on the STM32F103Zx.

Description SPC564A-DISP. March 2014 DocID Rev 3 1/5

AN626 Application note

TN0132 Technical note

AN1869 APPLICATION NOTE

AN2676 Application note

UM1084 User manual. CR95HF development software user guide. Introduction. Reference documents

fuzzytech ST6 Explorer Edition

AN1752 APPLICATION NOTE

STM32-MP3NL/DEC. STM32 audio engine MP3 decoder library. Description. Features

UM1572 User manual. STEVAL-IPE020V1: ST energy meter application based on the Android platform. Introduction

AN2855 Application note

MTC20174 AFE. PCI Phone Line. EEPROM (0-16KB) Optional

AN2061 APPLICATION NOTE

EV-VNQ5E050AK VNQ5E050AK evaluation board

ST33F1M. Smartcard MCU with 32-bit ARM SecurCore SC300 CPU and 1.25 Mbytes high-density Flash memory. Features. Hardware features.

AN2430 Application note

AN3250 Application note

ST7MDTx-KIT ST7 MCU STARTER KIT. Software Features (ST7 CDROM) Hardware Features

AN2781 Application note

STLC2500D. Bluetooth V2.1 "Lisbon" + EDR. Features. Description

AN1839 APPLICATION NOTE How to Use a Small Page ST NAND Flash Memory in an Application Designed for a Toshiba Device

AN2594 Application note

ST33F1M, ST33F1M0, ST33F896, ST33F768, ST33F640, ST33F512

AN1656 APPLICATION NOTE

AN2442 Application note

AN2737 Application note Basic in-application programming example using the STM8 I 2 C and SPI peripherals Introduction

AN2673 Application note

STM32 embedded target for MATLAB and Simulink release 3.1. Summary for STM32 embedded target for MATLAB and Simulink release 3.1:

UM0401 User manual. User manual for eight bit port expander STMPE801 demonstration board. Introduction

For more information on this tool or if you need more help, please contact the nearest sales office, see Contact List below.

AN2470 Application note TS4871 low voltage audio power amplifier Evaluation board user guidelines Features Description

AN3980 Application note

AN2202 Application note

AN2143 Application note

AN2261 APPLICATION NOTE

AN4321 Application note

ST19NP18-TPM-I2C Trusted Platform Module (TPM) with I²C Interface Features

AN3354 Application note

AN4290 Application note

STTS V memory module temperature sensor. Features

RN0046 Release note. 1 Introduction. SimpleMAC library for STM32W108xx kits. About this release note

Main components USB charging controller with integrated power switch

AN3362 Application note

STM3210B-SK/KEIL STR91X-SK/KEI, STR7-SK/KEIL

STICE CF/Stice_Connect AD/Stice_Connect AS/Stice_Connect

Obsolete Product(s) - Obsolete Product(s)

STEVAL-IHM028V1. 2 kw 3-phase motor control demonstration board featuring the IGBT intelligent power module STGIPS20K60. Features.

AN2361 Application note

STM32-SK/RAIS,STR91X-SK/RAI,STR7-SK/RAIS STM32-D/RAIS,STR9-D/RAIS,STR7-D/RAIS

STM3220G-SK/KEI. Keil starter kit for STM32F2 series microcontrollers (STM32F207IG MCU) Features. Description

Obsolete Product(s) - Obsolete Product(s)

STM32-SK/KEIL STR91X-SK/KEI, STR7-SK/KEIL

AN2734 Application note S-Touch design procedure Introduction

AN4440 Application note

AN4274 Application note

AN3348 Application note

AN4308 Application note

PROGRAMMING FLASH MEMORY OF THE ST10F166

ESDA25B1 TRANSIL ARRAY FOR ESD PROTECTION. Application Specific Discretes A.S.D. I/O 6 I/O 1 I/O 2 I/O 5

in Berlin (Germany) Sponsored by Motorola Semiconductor NEC Electronics (Europe) Siemens Semiconductors Organized by

AN2474 Application note

UM0693 User manual. 1 Introduction. STM8L101-EVAL demonstration firmware

ESDA6V1-4BC6 QUAD BIDIRECTIONAL TRANSIL SUPPRESSOR FOR ESD PROTECTION ASD

IMS B108 PC HTRAM MOTHERBOARD

SOT23-6L ESDALCL6-2SC6

AN3988 Application note

Transcription:

AN1077 APPLICATION NOTE OVERVIEW OF ENHANCED CAN CONTROLLERS FOR ST7 AND ST9 MCUS by Microcontroller Division Applications ABSTRACT Automotive body network requirements have changed significantly in the last few years due to the introduction of OSEK and the increasing number of ECUs. 8-bit microcontrollers are and will stay widely used in a majority of automotive body applications. While a wide variety of powerful CAN controllers are available on the market for 16- and 32-bit microcontrollers, 8-bit microcontrollers still need too much CPU time for CAN communication management. This application note presents a new generation of CAN controllers optimized for 8-bit microcontrollers and designed to meet the needs of body applications. AN1077/0201 1/14 1

1 INTRODUCTION................................................. 3 1.1 EVOLUTION OF AUTOMOTIVE NETWORKS..................... 3 1.2 IMPACT ON CAN TRAFFIC.................................... 4 1.3 IMPACT ON CAN CONTROLLERS.............................. 4 2 CAN CONTROLLER SOLUTIONS................................... 5 2.1 TRADE-OFF BETWEEN COSTS AND EFFICIENCY................ 5 3 BXCAN AND BECAN: THE NEW CAN SOLUTIONS.................... 6 3.1 BXCAN MAIN FEATURES..................................... 6 3.2 CAN CORE................................................. 6 3.3 TRANSMISSION HANDLING.................................. 7 3.4 MESSAGE FILTERING....................................... 8 3.5 RECEPTION HANDLING..................................... 10 3.6 BECAN MAIN FEATURES.................................... 11 4 VALIDATION.................................................. 12 5 CONCLUSION................................................. 13 2/14 2

1 INTRODUCTION 1.1 EVOLUTION OF AUTOMOTIVE NETWORKS For several years CAN has been the world wide standard automotive communication protocol. Well established in power train applications in its high speed version, CAN is now used to connect a high number of ECUs in each car body. This body network - known as low speed CAN - brought major changes with its introduction. Standardized Higher Layer Today automotive manufacturers and their suppliers are going one step further towards standardization, integrating the OSEK software modules on each ECU. Hierarchical architectures To master the complexity caused by the increasing number of ECUs in car bodies, several networks and sub-networks are required. This limits the number of nodes connected to one network, but requires more nodes with a simple gateway function. Low-end communication protocol Local sub-networks - e.g. within one door module - does not need the full multi- master capabilities, speed and robustness of CAN. For this purpose the LIN communication protocol has been introduced as a low-cost solution. 3/14

1.2 IMPACT ON CAN TRAFFIC These changes have an impact in terms of CAN message traffic. Application Messages Even if the information transmitted by each ECU has not increased significantly, the growing number of ECUs in body applications has led to a drastic increase in CAN traffic. Sometimes the same ECU may be used in several locations in the car - for instance for the right and for the left door module so a node must be able to handle more message identifiers than the application itself would really require. A similar effect occurs when the same ECU is planned to be implemented in different car models or versions, this means the number of identifiers the node has to handle will increase. Network Management Messages In addition to the application messages, management messages like OSEK Network Management are needed to configure the network at start-up time, to control the bus when the nodes enter and exit sleep mode, to monitor the node while running and to handle bus-off conditions. This distributed NM requires the implementation of the OSEK-NM software on each ECU, which has to monitor the NM messages of all the other nodes. This NM is based on the token ring method and each node has its own address. The source and destination addresses are coded in the identifier of the CAN message. This means that there are as many identifiers needed for the NM as nodes in the network. Diagnosis Messages For diagnosis purposes each ECU must be accessible to external diagnosis tools. According to ISO 15765-1 and 2 these diagnosis services are now implemented via CAN. These services require their own CAN messages. 1.3 IMPACT ON CAN CONTROLLERS Just as the introduction of networks has modified automotive application implementations in a major way, modern network architectures have also changed the requirements imposed on CAN controllers. As mentioned earlier, the resource requirements have increased especially on the receiver side: A huge number of identifiers on the bus A high number of identifiers to be handled Various types of messages All Quiet in the 8-bit CAN World? While many CAN controllers for 16- and 32-bit microcontrollers have been recently developed in order to satisfy these new requirements, most of the CAN controllers implemented on 8-bit microcontrollers do not provide the required hardware to support these new functions effi- 4/14

ciently. Therefore software solutions are usually implemented, consuming CPU resources and making the application less independent from the CAN bus traffic. The Overall Tasks of the CAN Interface Considering the receiver part of the CAN interface the following tasks have to be performed: Message checking, error handling and acknowledgement. This task is fully handled by the CAN protocol implemented in all CAN controllers Message filtering indicates receptions addressed to the application and discards the other ones. This task is partially done by hardware but software filtering is often needed. The CPU resources consumed for software filtering depends on the CAN bus traffic. This means that the ECU performance is influenced by events not related to the application. This can make the modification of an entire system or the integration of the ECU in another network very critical. recognition. Once a message has passed through the filters its content must be identified in order to compute the destination address the data must be stored to. Signal extraction. To optimize the bandwidth usage of the CAN bus, the signals are concatenated to have more data transmitted in each message. Thus on message reception the application must extract the signals it is interested in. Signal storage in RAM 2 CAN CONTROLLER SOLUTIONS 2.1 TRADE-OFF BETWEEN COSTS AND EFFICIENCY Nowadays CAN controllers can be classified in two main families: BasicCAN This approach provides only few mailboxes for message transmission and reception. This solution allows very compact implementations on silicon. Advantages: Very cost-effective and therefore well suited to 8-bit microcontrollers Drawbacks: Requires CPU resources for filtering, identifier recognition and signal storage High software real-time constraints on message reception FullCAN This approach provides more mailboxes than messages to handle. In the past, 16 mailboxes were sufficient, today 32 or 64 are standard. Advantages: Autonomous message filtering One static identifier per mailbox 5/14

Drawbacks: 16 mailboxes are not sufficient for body applications 32 mailboxes to expensive for 8-bit microcontrollers Static usage of mailboxes not efficient in body application. 3 BXCAN AND BECAN: THE NEW CAN SOLUTIONS As mentioned previously for cost efficiency reasons, an 8-bit microcontroller cannot afford to have a huge FullCAN controller with 32 mailboxes. Therefore ST s new solutions are based on a BasicCAN architecture, which has been extended to meet body application requirements. 3.1 BXCAN MAIN FEATURES The basic extended CAN - called bxcan - supports: CAN protocol version 2.0 A, B Active Bit rates up to 1Mbit/s at 8MHz Three transmit mailboxes Priority by identifier or FIFOs Two receive FIFO with three stages each Eight scalable filters Can be associated with FIFO 0 or 1 list feature Filter match index 3.2 CAN CORE Although the CAN core is the heart of any CAN controller, this is also the most common part. This means that all CAN cores have to be compliant with the CAN standard and from an application point of view do not differ from each other. The processor interface providing the mailboxes, filters etc. must meet the application requirements and can evolve accordingly. For this reason the bxcan is based on the BOSCH CAN core of the C_CAN product. 6/14

Figure 1. Figure 1: bxcan Block Diagram Master Control Master Status Transmit Control Transmit Status Tx Mailboxes Mailbox 2 Mailbox 1 Receive FIFO 0 2 Mailbox 0 1 Receive FIFO 1 2 Mailbox 0 1 Control/Status/Configuration Transmit Priority Receive FIFO Interrupt Enable Page Select Error Status Error Int. Enable Tx Error Counter Rx Error Counter Mailbox 0 Transmission Scheduler Acceptance Filters 3 4 2 1 Filter 0 5 6 7 Diagnostic Bit Timing CAN 2.0B Active Core Filter Mode Filter Config. 3.3 TRANSMISSION HANDLING Three transmit mailboxes are provided to the application to set-up messages for transmission. Three mailboxes reduce software queuing and allow deterministic transmission. The Transmission Scheduler decides which mailbox has to be transmitted first according to the priority rules. Transmit Priority Rules BxCAN provides two modes for the transmit priority: In identifier mode when more than one transmit mailbox are pending, the identifier of the message stored in the mailbox gives the transmission order. The message with the lowest identifier value has the highest priority according to the arbitration of the CAN protocol. In FIFO mode the priority order is given by the transmit request order. This mode is well suited for segmented transmission. 7/14

3.4 MESSAGE FILTERING Figure 2. Filter Scale and Configuration Filter Scale Configuration One 32-Bit Filter Filter Scale Config. Bits 1 FSCx = 3 Bit Mapping CFxR0 CFxR4 CFxR1 CFxR5 CFxR2 CFxR6 CFxR3 CFxR7 STID10:3 STID2:0 RTR IDE EXID17:15 EXID14:7 EXID6:0 Two 16-Bit Filters Bit Mapping CFxR0 CFxR2 CFxR4 CFxR6 STID10:3 CFxR1 CFxR3 CFxR5 CFxR7 STID2:0 RTR IDE EXID17:15 FSCx = 2 One 16-Bit / Two 8-Bit Filters CFxR0 CFxR2 CFxR1 CFxR3 Bit Mapping CFxR4 CFxR5 CFxR6 CFxR7 Four 8-Bit Filters CFxR0 CFxR1 CFxR2 CFxR3 CFxR4 CFxR5 CFxR6 CFxR7 STID10:3 FSCx = 1 FSCx = 0 x = filter number 1 These bits are located in the CFCR register s One of the bxcan s key improvements is the extended filter mechanism avoiding any message filtering by software. This pure hardware filtering makes the CPU performance independent from the CAN bus traffic. Hardware filtering: Saves CPU resources required for software filtering 8/14

Eases the software development evaluation, as even if the CAN bus traffic is not well defined at the beginning of the project, changes will not impact the CPU behaviour Eases the integration of this ECU in a new system To fulfil this requirement the bxcan Controller provides eight configurable and scalable filters to the application, in order to receive only the messages the application needs. Scalable Width To optimise and adapt the filters to the application needs, each filter can be scaled independently. The following combinations are possible: One 32 bit filter for filtering the STDID[10:0], IDE, EXTID[17:0] and RTR bits. Two16 bit filters for filtering the STDID[10:0], RTR and IDE bits. Four 8 bit filters for filtering the STDID[10:3] bits. The other bits are considered as don t care. One 16 bit filter and two 8 bit filters. Furthermore each filter can be configured in mask mode or in identifier list mode. Mask mode In mask mode the identifier registers are associated with mask registers specifying which bits of the identifier are handled as must match or as don t care. This mode is well suited for selecting a group of identifiers, for instance network management messages. List mode In identifier list mode the mask registers are used as identifier registers. Thus, instead of defining an identifier and a mask, two identifiers are specified, doubling the number of configurable single identifiers. All bits of the incoming identifier must match with the bits specified in the filter registers. This mode is well suited for application messages as their identifiers are quite randomly distributed. Filter Configuration While the scale and mode configuration must be done during the initialization of bxcan, the value of the identifiers and masks registers can be modified on the fly. 9/14

3.5 RECEPTION HANDLING Figure 3. Message Filtering and Storage Message Received Ctrl Data List 0 1 2 #2 Match Receive FIFO Message Stored n & Mask n+1 Mask n+m Mask No Match Found Message Discarded n: number of single identifiers to receive m: number of identifier groups to receive n and m values depend on the configuration of the filters For the reception of CAN messages bxcan provides two FIFOs. Each FIFO can store 3 complete CAN messages without CPU intervention. Each filter can be independently associated with FIFO 0 or FIFO 1. This structure reduces the real-time constraint on message reception on the application side. In order to reduce CPU load, simplify the software and guarantee data consistency, the FIFO is managed completely by hardware. The application accesses the messages stored in the FIFO through the FIFO output mailbox. Message Prioritization A drawback of the FIFO architecture is that at reception time the application does not know the level of priority of these messages. Thus all messages have to be handled with the same urgency. To address this issue bxcan provides two independent FIFOs. This allows differenti- 10/14

ated handling for high priority messages and non-critical messages. This feature helps to reduce the real-time constraint on the application. Filter Match Index Once a message has been stored in the FIFO, the application will transfer the data to the RAM. BxCAN provides a Filter Match Index, FMI, corresponding to the index of the filter the message passed through. The FMI is stored in the FIFO with the received message. Because of their wide spread distribution, CAN identifiers cannot be immediately used as an index to the destination location of the data. The FMI provides a means of accessing a receive message table directly. Valid Message A message is considered as valid when it has been received without error until the last but one bit of the EOF field. And it passes through the identifier filtering successfully. FIFO Overrun The CAN core has its own message buffer and starts transferring the message to the FIFO once the message is considered as valid. Thus an overrun condition will occur if four valid messages have been received in the same FIFO but not handled by the application. Furthermore this mailbox in the CAN core guarantees that no erroneous message will overwrite a correct one already stored in the FIFO. 3.6 becan MAIN FEATURES The basic enhanced CAN - called becan - supports: CAN protocol version 2.0 A, B Active Bit rates up to 1Mbit/s at 8MHz Two transmit mailboxes Priority by identifier or FIFO One receive FIFO with three stages Four scalable filters list feature Filter match index 11/14

Figure 4. Figure 4: becan Block Diagram Control/Status/Configuration Master Control Master Status Transmit Status Transmit Prio Receive FiFO Interrupt Enable Page Select Error Status Error Int. Enable Tx Error Counter Rx Error Counter Diagnostic Tx Mailboxes Mailbox 1 Mailbox 0 Transmission Scheduler Receive FIFO 2 Mailbox 0 1 Acceptance Filters 3 2 1 Filter 0 Bit Timing Filter Master Filter Config. CAN 2.0B Active Core The becan is based on the same FIFO and filter concept as bxcan but targets applications requiring less communication resources. This leads to a reduced processor interface functionality. 4 VALIDATION BxCAN and becan are based on the CAN core of BOSCH s C_CAN controller. This approach limits the development risk, reusing the huge experience BOSCH has gained during more than one decade of CAN controller development. To guarantee the compliance of the BOSCH s CAN core with the CAN standard, the C_CAN has been validated according to the ISO standard 16845 CAN Conformance Testing. The validation has been performed by the c&s group led by Prof. Dr. W. Lawrenz located in Wolfenbüttel, Germany. For several years, c&s has been well accepted world wide as an organisation for CAN controller validation. 12/14

5 CONCLUSION These two new CAN controllers bxcan and becan have been designed to meet the requirements of today s and tomorrow s automotive body applications. In particular CAN message filtering (this CPU resources consuming and difficult to evaluate task) has been optimized by the implementation of the identifier list concept and the increased number of filters. Freed from the filtering task, the CPU can completely focus on the application tasks. With eight filters and two independent receive FIFOs, bxcan can easily handle a high number and different types of well selected messages. This is an ideal CAN interface for decentralized gateways and all applications with high capacity communications requirements. 13/14

THE PRESENT NOTE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT OF SUCH A NOTE AND/OR THE USE MADE BY CUSTOMERS OF THE INFORMATION CONTAINED HEREIN IN CONNEXION WITH THEIR PRODUCTS. Information furnished is believed to be accurate and reliable. However, STMicroelectronics assumes no responsibility for the consequences of use of such information nor for any infringement of patents or other rights of third parties which may result from its use. No license is granted by implication or otherwise under any patent or patent rights of STMicroelectronics. Specifications mentioned in this publication are subject to change without notice. This publication supersedes and replaces all information previously supplied. STMicroelectronics products are not authorized for use as critical components in life support devices or systems without the express written approval of STMicroelectronics. The ST logo is a registered trademark of STMicroelectronics 2001 STMicroelectronics - All Rights Reserved. Purchase of I 2 C Components by STMicroelectronics conveys a license under the Philips I 2 C Patent. Rights to use these components in an I 2 C system is granted provided that the system conforms to the I 2 C Standard Specification as defined by Philips. STMicroelectronics Group of Companies Australia - Brazil - China - Finland - France - Germany - Hong Kong - India - Italy - Japan - Malaysia - Malta - Morocco - Singapore - Spain Sweden - Switzerland - United Kingdom - U.S.A. http://www.st.com 14/14