15
i Secured UART Communication Between Microcontrollers Enrolment No.: 14317152 Name of Student: Sanjay Sahai Supervisor: Mr. Ritesh Kumar

snajy frnt

Embed Size (px)

DESCRIPTION

front page

Citation preview

Page 1: snajy frnt

i

Secured UART Communication

Between Microcontrollers

Enrolment No.: 14317152

Name of Student: Sanjay Sahai

Supervisor: Mr. Ritesh Kumar

Dec 2015

Report submitted in partial fulfilment of the requirements for the degree

of Master of Technology

DEPARTMENT OF ELECTRONICS AND

COMMUNICATION JAYPEE INSTITUTE OF

INFORMATION TECHNOLOGY NOIDA

Page 2: snajy frnt

ii

Certificate

This is to certify that the work titled “Serial Communication BetweenMicrocontrollers”, submitted by “Sanjay Sahai” in partial fulfilment for the award of degree of Master of Technology (Microelectronics systems & Embedded Technology) of Jaypee Institute of Information Technology, Noida has been carried out under my(Mr. Ritesh Sharma) supervision. This work has not been submitted partially or wholly to any other University or Institute for award of this or any other degree.

Signature of Supervisor:

Name of Supervisor:

Designation:

Date:

Page 3: snajy frnt

3

Acknowledgement

I owe most of the project to my advisor Mr. Ritesh Sharma who has conceived the project and

guided me at every step. It was a great privilege working with him. Aided with his guidance, I

could complete the project without much trouble and it was really smooth ride. I take this

opportunity to express my profound gratitude to him

I would also like to thank Mr. Gaurav Verma and all the faculty members of ECE Dept. who

through their courses helped me learn many things.

Last but not the least, my special thanks goes to my loving parents for their love and support. My

deepest gratitude goes to them for their eternal love, for always believing in me, for their

wisdom, and for helping me face tough challenges in life.

Signature of Student:

Name of Student:

Date:

Page 4: snajy frnt

4

TABLE OF CONTENTS

Topics Page No

1.UART Communication

1.1)Serial and Parallel Communication 1

1.2)Modes of Communication 2

1.3)Data Transfer Rate 2

1.4)UART 3

1.5)RS232 Standard 4

1.6)MAX232 IC 6

2)Literature Survey 6

2.UART Serial Communiaction between microcontrollers using Atmega8

2.1)Atmega8 Features & Pin Configuration 8

2.2)Serial Communication in ATmega8 8

2.2.1)Pins Used for Communication 8

2.2.2)Serial USART Element 8

2.2.3)USART Initialization 9

2.3)USART Register Description 10

3. ZIGBEE

3.1)Origin of Name of Zigbee 16

3.2)Charcteristcs 16

3.3)Architechture 17

Page 5: snajy frnt

5

3.3.1)Physical Layer 17

3.3.2)MAC Layer 18

3.3.3)Network Layer 19

3.3.4)Application Layer 21

3.4)Comparison between Wireless Technologies 23

3.5)Application 23

3.6) Why Zigbee needed?24

4. IMPLEMENTATION OF PROJECT

4.1)Components used 25

4.2)Working 25

4.2.1)Block Diagram 25

4.2.2)Working Principle 26

4.3)Proteus Simulation 27

4.4)Zigbee Interfacing 28

Results and Conclusion 28

Future Work 28

Refrences 29

Appendix A 30

Appendix B 32

Page 6: snajy frnt

6

LIST OF FIGURES

Fig 1.1)Serial Transfer vs Parallel Transfer 1

Fig1.2)Modes of Communication 2

Fig 1.3)RS232 DB9 Standard 4

Fig 1.4)RS232 DB25 Standard 5

Fig 1.5) MAX232 6

Fig 2.1)Atmega8 Pin Configuration 7

Fig 2.2)Example for USART Initialization 8

Fig 2.3)Register forUDR 9

Fig 2.4) Register for UCSRA & UCSRB 11

Fig 2.5)Register for UCSRC 12

Fig 2.6)Register for UBRRL & UBRRH 14

Fig 3.1)Zigbee Architecture 17

Fig 3.2)PHY Packet Field 18

Fig 3.3)Zigbee Topologies 19

Fig 3.4)Beacon and Non Beacon Modes 21

Fig 4.1) Snapshot of Proteus Design 27

Page 7: snajy frnt

vii

LIST OF TABLES

Table 1.1)DB9 Pin description 5

Table 1.2)DB25 Pin Description 5

Table 2.1)Baud Rate Calculation Formula 9

Table 2.2)Bit 5 & 4 UCSRC 13

Table 2.3)Bit 3 of UCSRC 13

Table 2.4)Bit 2:1 of UCSRC 13

Table 2.5)Bit 0 of UCSRC 14

Table 3.1) Comparison Between various Wireless Technology 23

Page 8: snajy frnt

8

SUMMARY

Universal asynchronous receiver and transmitter refer to as UART. It is a communication

protocol which will make conversion from the parallel stream of data to serial stream of data

over a communication link. This protocol reveals that communication will occur at predefined

frequency. The devices on the communication link will generate its own frequencies

independently. Any new events may occur asynchronously with the local clock. This needs that

an input data stream has to be sampled even though the devices on link has slight difference in

the frequency from the predefined frequency. Sampling can be achieved by having local clock.

Signal which is having frequency greater than the channel sampling rate. UART is a

communication protocol usually used for the communication with slow peripherals. This design

includes that full duplex asynchronous Serial communication system used mostly to realize

general serial bus protocols like RS485. RS 232 and RS422.

In this Project several methods of UART are used like serial communication between two

microcontrollers, communicating via Bluetooth and then proceeding towards wireless

communication. Zigbee has been used to transmit and receive data wirelessly and thus

communication between two microcontrollers takes place. User defined encryption and

decryption algorithms are used. Further end devices can be interfaced which can be controlled by

Zigbee.

Signature of Student Signature of Supervisor

Name Name

Date Date

Page 9: snajy frnt

9