Microcomputer Protocol Implementation at Local Interconnect Network Georgi Krastev



Similar documents
LIN (Local Interconnect Network):

Introduction to. LIN (Local Interconnect Network)

In-Vehicle Networking

Local Interconnect Network Training. Local Interconnect Network Training. Overview

Introduction to RACE FUELS Hans-Christian von der Wense Munich, Germany

Elettronica dei Sistemi Digitali Costantino Giaconia SERIAL I/O COMMON PROTOCOLS

LOCAL INTERCONNECT NETWORK (LIN)

Develop a Dallas 1-Wire Master Using the Z8F1680 Series of MCUs

ARM Thumb Microcontrollers. Application Note. Software ISO 7816 I/O Line Implementation. Features. Introduction

Serial Communications

Using Xbee in Serial Communication

Introduction to LIN. Webinar

Serial Communications

Software User Guide UG-461

Implementing MOD bus and CAN bus Protocol Conversion Interface

USB to serial chip CH340

Microcontroller Based Low Cost Portable PC Mouse and Keyboard Tester

SMS based remote control system

COMPUTER HARDWARE. Input- Output and Communication Memory Systems

USART and Asynchronous Communication

Hello, and welcome to this presentation of the STM32L4 reset and clock controller.

The Programming Interface

M68EVB908QL4 Development Board for Motorola MC68HC908QL4

LIN. Specification Package. Revision 2.0. This specification is provided on an "AS IS" basis only and cannot be the basis for any claims.

8051 Serial Port. Crystal TXD. I/O Device RXD. Embedded Systems Peripherals

Pmod peripheral modules are powered by the host via the interface s power and ground pins.

Tire pressure monitoring

DS1307ZN. 64 x 8 Serial Real-Time Clock

Objectives. Basics of Serial Communication. Simplex vs Duplex. CMPE328 Microprocessors (Spring ) Serial Interfacing. By Dr.

AND8336. Design Examples of On Board Dual Supply Voltage Logic Translators. Prepared by: Jim Lepkowski ON Semiconductor.

PACKAGE OUTLINE DALLAS DS2434 DS2434 GND. PR 35 PACKAGE See Mech. Drawings Section

DS1621 Digital Thermometer and Thermostat

udrive-usd-g1 Embedded DOS micro-drive Module Data Sheet

Road Vehicles - Diagnostic Systems

DS1621 Digital Thermometer and Thermostat

Block 3 Size 0 KB 0 KB 16KB 32KB. Start Address N/A N/A F4000H F0000H. Start Address FA000H F8000H F8000H F8000H. Block 2 Size 8KB 16KB 16KB 16KB

Wireless Security Camera

LIN (Local Interconnected Network)

Single channel data transceiver module WIZ2-434

Part Number Description Packages available

Dolphin In-Circuit programming Updating Firmware in the field

SPI I2C LIN Ethernet. u Today: Wired embedded networks. u Next lecture: CAN bus u Then: wireless embedded network

VMR6512 Hi-Fi Audio FM Transmitter Module

Application Note 83 Fundamentals of RS 232 Serial Communications

AT15007: Differences between ATmega328/P and ATmega328PB. Introduction. Features. Atmel AVR 8-bit Microcontrollers APPLICATION NOTE

MDM192 MULTI-DROPS DIGITAL MODEM FOR PRIVATE LINE. USER GUIDE Document reference :

Atmel Norway XMEGA Introduction

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Question Bank Subject Name: EC Microprocessor & Microcontroller Year/Sem : II/IV

Wireless Home Security System

UART-based LIN-bus Support for Linux with SocketCAN Interface

Serial Communications / Protocol in AirTest Products

GTS-4E Hardware User Manual. Version: V1.1.0 Date:

Design and Verification of Nine port Network Router

Design And Implementation Of Bank Locker Security System Based On Fingerprint Sensing Circuit And RFID Reader

DS2401 Silicon Serial Number

MCB3101 (Class I) WiRobot Serial Bluetooth Wireless Module User Manual

AVR318: Dallas 1-Wire master. 8-bit Microcontrollers. Application Note. Features. Introduction

PC-Based Vehicle OBD Tester

DS Wire Digital Thermometer and Thermostat

Web Site: Forums: forums.parallax.com Sales: Technical:

Understanding SAE J1939. by Simma Software, Inc.

DeviceNet Communication Manual

A DIY Hardware Packet Sniffer

2-port RS-422 / 485 Universal PCI

RC2200DK Demonstration Kit User Manual

HAC-LM Series Low Power Data Radio Module

Quectel Cellular Engine

8-Bit Flash Microcontroller for Smart Cards. AT89SCXXXXA Summary. Features. Description. Complete datasheet available under NDA

Eliminate Risk of Contention and Data Corruption in RS-485 Communications

ULC Technology: High-performance gate array package using multiple metal layer CMOS technology featuring sub-micron channel lengths (0.

Allows the user to protect against inadvertent write operations. Device select and address bytes are Acknowledged Data Bytes are not Acknowledged

Manual Serial PCI Cards

ALL-USB-RS422/485. User Manual. USB to Serial Converter RS422/485. ALLNET GmbH Computersysteme Alle Rechte vorbehalten

Data Exchange On The CAN Bus I

Display Message on Notice Board using GSM

Wireless Temperature

Am186ER/Am188ER AMD Continues 16-bit Innovation

AVR317: Using the Master SPI Mode of the USART module. 8-bit Microcontrollers. Application Note. Features. Introduction

8-bit RISC Microcontroller. Application Note. AVR910: In-System Programming

Tutorial Introduction

PCAN-MicroMod Universal I/O Module with CAN Interface. User Manual. Document version ( )

Hardware Specifications of V2AF Series Hybrid Card Reader

FLYPORT Wi-Fi G

Tutorial.

DECT Module UM-9802 Datasheet

INFORMATICA INDUSTRIALE

1-Port R422/485 Serial PCIe Card

International Journal of Research in Advent Technology Available Online at:

AVR305: Half Duplex Compact Software UART. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

Advanced Car Security System Using GSM

Wireless monitoring system for temperature and humidity based on ZigBee

(USR-TCP232-T, USR-TCP232-2) (USR-TCP232-S, USR-TCP232-D) (USR-TCP232-24, USR-TCP ) (USR-TCP , USR-TCP ) File version: V3.

ET-BASE AVR ATmega64/128

USB2.0 <=> I2C V4.4. Konverter Kabel und Box mit Galvanischetrennung

Implementing SPI Communication Between MSP430 G2452 and LTC ADC

ATB50v1 GPRS / GPS Based Fleet Management Terminal. Datasheet

RS-422/485 Multiport Serial PCI Card. RS-422/485 Multiport Serial PCI Card Installation Guide

Interfacing Of PIC 18F252 Microcontroller with Real Time Clock via I2C Protocol

MicroMag3 3-Axis Magnetic Sensor Module

USB TO SERIAL ADAPTER

Transcription:

Microcomputer Protocol Implementation at Local Interconnect Network Georgi Krastev Abstract: The paper discusses the issues of microcomputer protocol implementation at local interconnect network for automobile applications. This protocol is from class A according to the classification of SAE and it includes one master and several slave nodes. Single Chip Microcontrolers T89C51CC01 of the firm Atmel are used. Key words: Computer Systems and Technologies, Single Chip Microcomputers, Local Interconnect Network. INTRODUCTION The technical specifications of the protocol (Local Interconnect Network) have been developed by a consortium of European automobile producers and other famous companies, including Audi AG, BMW AG, Daimler Chrysler AG, Motorola Inc., Volcano Communications Technologies AB, Volkswagen AG, Volvo Car Corporation [1, 2] and others. It is designated for creating cheap local networks for data exchange at short distances. The main tasks, given to the protocol from the consortium of European automobile producers uniting of the automobile subsystems and nodes (as the door locks, window wipers, the serve-systems for window motion, the air-conditioner operation, the servesystem of the electrical hatchet, etc.) into a single electronic system. The protocol has been affirmed by the European automobile consortium as a cheap additional part to the reliable Controller Area Network (CAN) protocol. These two protocols complement each other and allow the unification of all electronic automobile devices into a single multifunctional board network. The standard includes the technical specifications both of the protocol and of the transfer medium. As a consecutive link protocol, efficiently supports the operation of electronic nodes and devices in the automobile systems with networks from class A (two-way, half-duplex), with one master and several slave nodes. BUS FEATURES Protocol supports bi-directional communication on a single wire, while using inexpensive microcontrollers driven by RC oscillators, to avoid the cost of crystals or ceramic resonators. Instead of paying the price for accurate hardware, it pays the price in time and software. The protocol includes an autobaud step on every message. Transfer rates of up to 20 Kbaud are supported, along with a low power SLEEP mode, where the bus is shut down to prevent draining the battery, but the bus can be powered up by any node on the bus. The bus itself is a cross between I 2 C and RS232. The bus is pulled high via a resistor and each node pulls it low, via an open collector driver like I 2 C. However, instead of having a clock line, each byte is marked via start and stop bits and the individual bits are asynchronously timed like RS232. Figure 1 shows a typical Protocol configuration. The bus uses a single wire pulled high through a resistor with open collector drivers. A Dominant state is signaled by a ground level on the bus and occurs when any node pulls the bus low. A Recessive state is when the bus is at VBAT (9-18V) and requires that all nodes let the bus float. In the idle state, the bus floats high, pulled up through the resistor. The bus operates between 9V and 18V, but parts must survive 40V on the bus. Typically, the microcontroller is isolated from the bus levels by a line driver/receiver. This allows the microcontrollers to operate at 5V levels, while the bus operates at higher levels. The bus is terminated to VBAT at each node. The Master is terminated through a 1KW resistor, while the Slaves are terminated through a 20-47KW resistor. Maximum bus length is designed to be 40 meters. At press time (early 2000), K-Line drivers are used until true drivers are available. - IIIB.18-1 -

Max. 40 m Protocol 1 koм 30 koм 30 koм 30 koм Master Slave 1 Slave 2 Slave n<16 Fig.1. Bus configuration Message Frames All information transmitted on the bus is formatted as Message Frames. As shown in Figure 2, a Message Frame consists of the following fields: Synch Break Synch Field Identifier Field Data Field Checksum Field Fig. 2. Message Frame Byte Fields Fig. 2. Message Frame The Byte Field format, shown in Figure 3, is identical to the commonly used UART serial data format with 8N1 coding. This means that each Byte Field contains eight data bits, no parity bits, and one stop-bit. Every Byte Field has the length of 10 bit-times (Tbit). As shown in the figure, the start bit marks the beginning of the Byte Field and is dominant while the stop-bit is recessive. The eight data bits can be either dominant or recessive. Fig. 3. Byte Field Synch Break The Synchronization Break marks the beginning of a Message Frame. This field is always sent by the Master task, and provide a means for the Slave task to prepare for the synchronization field. The Synch Break consists of two different parts: a dominant (low) level that should be minimum 13 bit-times (Tbit) which is followed by a recessive (high) period that should be in the range one to four Tbit. The second field is necessary to detect the dominant (low) level of the start bit of the following Synch Field. - IIIB.18-2 -

Fig. 4. Synch Break Field The length of the first field is chosen to distinguish between the Synch Break and the maximum possible allowed sequence of dominant bits within a data frame. For example, a data field with all 0 s should not be mistaken for a Synch Break field. Synch Field The Synch Field contains the signalling required for the slave to synchronize with the master clock. The Synch Field is a Byte Field containing the data 0x55 giving the waveform shown in Figure 5. Fig. 5. Synch Field As illustrated, the Synch Field is characterized by five falling edges (recessive to dominant edges) These edges are used during synchronization to tune the slave node transmission and reception speed to match the master node as explained later in this application note. Identifier Field The Identifier Field contains information about contents and length of a message. As shown in Figure 6, this field is divided into three sections: identifier bits (four bits), length control bits (two bits) and parity bits (two bits). This divides the set of 64 identifiers into four subsets of 16 identifiers each. The protocol defines this as follows: Fig. 6. Identifier Field Table 1. Number of Data Fields in a Data Frame ID 5 ID 4 N data (Number of Data Fields) 0 0 2 0 1 2 1 0 4 1 1 8 As shown in Table 1 there are two groups with two data fields, one group with four data fields, and one group with eight data fields. Note that the Identifier Field does not indicate the destination of the message but describes the contents of the message frame. It is up to all the Receiving Slave tasks to decide if they should act upon the received message or not. The last two bits of the Identifier Field contains parity information. uses a mixedparity algorithm that ensures that the Identifier Field never will consist of an all recessive or dominant pattern. Note that the parity check only detects errors, it does not correct them. - IIIB.18-3 -

The parity check bits are calculated by the following mixed-parity algorithm: P0 = ID0 ID1 ID2 ID4 Ρ 1 = ID1 ID3 ID4 ID5 Data Field The data frame contains from two to eight Data Fields containing eight bits of data each. Transmission is done with LSB first. The data fields are written by the responding Slave task. Since there is no bus arbitration, only one slave task should be allowed to respond to each identifier. All other Slave tasks are limited to reading the response and act accordingly. Fig. 7. Data Field Checksum Field The last field in the Message Frame is the Checksum Field. This byte contains the inverted modulo-256 sum of all data bytes (data frame not including the identifier). This sum is calculated by doing an ADD with carry on all data bytes and then inverting the answer. The properties of the inverted modulo-256 sum are such that if this number is added to the sum of all data bytes the result will be 0xFF. Fig. 8. Checksum Field Hardware Implementation The T89C51CC01 is an 8051 compatible microcontroller and is ideal for implementation of a application. In a typical CAN and application, the T89C51CC01/02 is an ideal candidate to be a CAN/ gateway unit and therefore the Master. Figure 9 shows an example implementation of two (Master and Slave) nodes of a network from type. The used Single Chip Microcontrollers are T89C51CC01, made by the firm Atmel and s are made by the firm Melexis. The TH8080 is a physical layer device for a single wire data link capable of operating in applications where high data rate is not required and a lower data rate can achieve cost reductions in both the physical media components and in the microprocessor which use the network. The TH8080 is designed in accordance to the physical layer definition of the Protocol Specification, Rev. 1.1. The IC furthermore can be used in ISO9141 systems. Because of the very low current consumption of the TH8080 in the recessive state it s particularly suitable for ECU applications with hard standby current requirements, whereby no sleep/wake up control due to the microprocessor is necessary. The TH8061 consist a low drop voltage regulator 5V/50mA and a Bus transceiver, which is a bidirectional bus interface for data transfer between bus and the protocol controller. Additional integrated is a RESET output with a reset delay of 100ms and a fixed threshold of 4.65V. Slave Driver: Bit Manipulation The slave implementation uses the PCA function to synchronize with the master. The bit manipulation method uses parallel port pins to be the Rx and Tx lines connecting - IIIB.18-4 -

to the transceiver. To implement the Rx line, port pins that can detect positive and negative transitions of the signal are required for a bit manipulation implementation (see Figure 9). Any of the digital port pins can be used to be the Tx line to the transceiver (e.g. P0.0 is used in the C-source code examples). Pins P1.6 and P1.7 are used for detection of positive and negative transition. Since each pin can only be configured for either positive or negative transitions, two pins must be electrically connected together as shown in Figure 9. VBAT 220u 7805 Vin Vout 100u GND T89C51CC01 5V -BUS 1k 220p Master-Node TH8080 n.c RxD VS n.c BUS VCC GND TxD P3.0 Rx P3.1Tx 100u Slave-Node 220p TH8061 VSUP VCC EN RESET GND TxD BUS RxD 100u T89C51CC01 5V P0.0 Tx P1.6 P1.7 Fig. 9. Bit Timing Configuration The bit timing is derived from the received Synch Field using the on chip PCA. Timer 2 is used to sample the bits received and to generate the bits for transmission on the bus. C-Source Files The C-source code drivers contain the following source files: SLAVE.C Slave protocol driver routines.h Header file for SLAVE.C MAIN.C Function main() TIMER0.C Scheduler routines TIMER.H Header file for TIMER.C 89C51CC0.H T89C51CC01/02 register definitions Code Size & Processor Loading Using the Keil 8051 compiler, the code size is 1.5K bytes including main() and scheduler function in TIMER0.C. Processor loading will depend upon baud rate implemented and - IIIB.18-5 -

frequency of tasks for reading/writing to sensors and actuators. However under tests for baud rates 2400, 4800, 9600 and 19200 using a 20 MHz crystal ( the maximum value for thet89c51cc01), processor loading was found to be in the region of 38 to 40%. Master Driver: USART Peripheral The USART implementation of the protocol is the most efficient way of implementing a Master Control Unit since the USART contains much of the hardware support for generation of bytes, i.e. start bit, 8-data bits, stop bit format. To implement a Master Control Unit with the T89C51CC01, at least two port pins are required as shown in Figure 9. Bit Timing Configuration Bit timing for the USART is achieved using Timer 1 via register TH1. Timer 1 is used in mode 1 which is auto-reload of TH1, therefore generating the baud rate. Master Task Implementation The first problem to solve for Master Driver implementation using a USART is that of generation of the Synch Break. As previously mentioned, this must be at least 13 bit times with the bus at dominant. The maximum number of bits that can be driven to dominant with the T89C51CC01 USART is 10 bits; one start bit followed by nine data bits at dominant by writing 0x000 to the USART (note that the stop bit is recessive). Therefore, to generate the Synch Break of at least 13-bit times, a different strategy is used. The Synch Break is generated by changing the value in TH1, so that the baud rate is effectively decreased. Therefore writing 0x00 to the USART, will result in at least 13 bits times sent to dominant. Once the Synch Break is generated, the baud rate is set to the full value again for transmission of the Synch and Identifier Fields. Bit Error detection is carried out upon each bit transmitted. C-Source Files The C-source code drivers contain the following source files:.c protocol driver routines.h Header file for.c MAIN.C Function main() TIMER0.C Scheduler routines TIMER.H Header file for TIMER.C 89C51CC0.H T89C51CC01/02 register definitions CONCLUSION The paper describes the protocol for developing low speed networks for automobile applications. Single Chip Microcontrollers T89C51CC01, made by the firm Atmel and s, made by the firm Melexis, are used for this development. The developed programming belongs to C. REFERENCES [1] Автомобильны стандарт и микроконтроллеры для его реализации. Гамма Санкт Петербург. www.gamma.spb.ru. [2] Dan Butler, Thomas Schmidt, Thorsten Waclawczyk. Protocol Implementation Using PICmicro MCUs. Microchip Technology Inc. ABOUT THE AUTHOR Georgi Krastev, Department of Computer Systems, University of Rousse, Phone: 359 82 888 672, Е-mail: gkrastev@ecs.ru.acad.bg. - IIIB.18-6 -