Can Protocol Implementation For Datacommunication1
Can Protocol Implementation For Datacommunication1
Can Protocol Implementation For Datacommunication1
DATACOMMUNICATION
A Mini project report submitted in partial fulfillment of the requirements of the award of the
degree of
BACHELOR OF TECHNOLOGY
IN
ELECTRONICS AND COMMUNICATION ENGINEERING
Submitted by
CERTIFICATE
This is to certify that the project work entitled “CAN PROTOCOL IMPLEMENTATION
FOR DATACOMMUNICATION” is a bonafide work in partial fulfillment of the
requirements for the degree of bachelor of technology in Electronics and Communication
Engineering for the academic year 2010-2011.
There are many people who have helped us directly and indirectly to complete our
project successfully. I would like to take this opportunity to thank one and all.
First of all I would like to express my deep gratitude towards my external guide Mr.G.Balwanth
reddy garu for helping me with each and every aspect of my project work which and helped me to get
through successfully. I am also very thankful to my internal guide Mr.B.L.Reddy garu for helping me in
clearing all my doubts during the project duration. I am also grateful to our HOD Prof.K.Subba Rao garu
for allowing me to do the project, and for his valuable suggestions during my project and all the
faculty of ECE Department of DRK Institute of Science and Technology, for their valuable suggestions,
which helped me in the successful completion of our project.
I owe my gratitude to my principal Prof.Sharif, for his kind attention and valuable
guidance to us throughout the course.
I would like to thank all my friends for their help and constructive criticism during my
project period. Finally, I am very much indebted to my parents for their moral support and
encouragement to achieve goals. I have no words to express my gratitude and still I am thankful to my
parents who have shown me this world and for every support they gave me.
B.Kishore Kumar
ABSTRACT
AIM:
The main aim of this project is to implementation for data communication based on CAN
protocol by using AT89S52 programmable microcontroller. Here we have connected
DESCRIPTION:
CAN is a multi-master broadcast serial bus standard for connecting electronic control units
(ECUs).Each node is able to send and receive messages, but not simultaneously: a message (consisting
primarily of an ID usually chosen to identify the message-type/sender and up to eight message bytes) is
transmitted serially onto the bus, one bit after another this signal pattern codes the message (in NRZ) and
is sensed by all nodes.
The devices that are connected by a CAN network are typically sensors, actuators and control devices. A
CAN message never reaches these devices directly, but instead a host processor and a CAN controller
are needed between these devices and the bus.
If the bus is free, any node may begin to transmit. If two or more nodes begin sending messages at the
same time, the message with the more dominant ID (which has more dominant bits, i.e., bit 0) will
overwrite other nodes' less dominant IDs, so that eventually (after this arbitration on the ID) only the
dominant message remains and is received by all nodes.
Bit rates up to 1 Mbit/s are possible at network lengths below 40 m. Decreasing the bit rate allows longer
network distances (e.g. 125 kbit/s at 500 m).
The CAN data link layer protocol is standardized in ISO 11898-1 (2003). This standard describes mainly
the data link layer — composed of the logical link control (LLC) sublayer and the media access control
(MAC) sublayer — and some aspects of the physical layer of the OSI reference model. All the other
protocol layers are the network designer's choice. The vehicle driver selection is done by using switches
which are placed after the micro controller unit.
The programming language used for developing the software to the microcontroller is
Embedded/Assembly. The KEIL cross compiler is used to edit, compile and debug this
program. Micro Flash programmer is used for burning the developed code on Keil in to the
microcontroller Chip. Here in our application we are using AT89C51 microcontroller which is
Flash Programmable IC.AT represents the Atmel Corporation represents CMOS technology is
used for designing the IC. This IC is one of the versions of 8051.
CANH CANL
CAN Micro Display
CAN
Transceiver Controller
Controller Unit
SOFTWARE:
1. Embedded C
2. Keil IDE
3. Uc-Flash
HARDWARE:
1. Micro Controller
2. MCP 2515 CAN controller
3. Power supply
4. MAX232
5. MCP 2551 CAN DRIVER
6. LCD
INDEX
TOPIC PAGE NO
CHAPTER1. INTRODUCTION
1.1 Introduction 2
1.2 Block Diagram 4
1.3 Flow Chart 5
2.1 AT89S52
2.1.1 A Brief History of 8051 7
2.1.2 Introduction to AT89S52 9
2.1.3 Features 10
2.1.4 Pin Description 11
2.3 MAX232
2.3.1 RS-232 waveform 29
2.3.2 RS-232 Level converter 30
2.3.3 Microcontroller Interfacing with RS-232 Standard devices 31
2.4 MCP2515
2.4.1 Features 36
2.5 MCP2551
2.5.1 Features 52
2.5.2 Pin Diagram 53
2.5.3 Overview 54
2.6 LCD 59
4.1.1 Example 1 71
4.1.2 Example 2 71
4.1.3 Example 3 72
4.1.4 Example 4 73
5.1 Introduction 75
5.2 Tools used 75
5.3 C51 Compiler & A51 macro assembler 76
5.4 Start µ vision 76
5.5 Flash magic 88
APPLICATIONS 92
FUTURE SCOPE 93
CONCLUSION 93
BIBILOGRAPHY 94
INDEX OF FIGURES
Flow chart 5
Interrupt sources 23
Regulator 29
20-Lead TSSOP 37
Pinout description 41
MCP2551 pinout 57
Bit names 66