chapter 2 - lesson2
chapter 2 - lesson2
com
BIHE university
Lesson-2 : Communication
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
Assembly and C Upper Saddle River, NJ 07458. • All Rights
Parallel vs. Serial
www. Micro Digital Ed. com
BIHE university
• Parallel
– Transfer a byte of data at a time -> faster, easier
• Serial
– Transfers a bit after another -> cheaper, ideal for
long distance through phone line (modem is
needed)
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
2
Assembly and C Upper Saddle River, NJ 07458. • All Rights
Direction
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
3
Assembly and C Upper Saddle River, NJ 07458. • All Rights
Synchronous vs. asynchronous
www. Micro Digital Ed. com
BIHE university
• Synchronous
Data transfer where the sender and receiver are
synchronized, meaning they operate at the same clock
rate.
– Clock pulse should be transmitted during data
transmission.
– Only one side generates clock at the same time.
• Asynchronous
Data transfer where the sender and receiver do not need
to be synchronized, allowing data to be sent and
received at different times.
– Clock pulse is not transmitted.
– The two sides should generate clock pulse.
– There should be a way to synchronize© 2011
the Pearson
two Higher
sides.
Education,
AVR Microcontroller and Embedded System Using 4
Assembly and C Upper Saddle River, NJ 07458. • All Rights
Data framing and bps
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
5
Assembly and C Upper Saddle River, NJ 07458. • All Rights
Serial communication protocol
www. Micro Digital Ed. com
BIHE university
RS232 Standard
•RS232 (Recommended Standard 232) is a standard
protocol for serial communication, which defines the
physical and electrical characteristics of the interface.
•RS232 was set by the Electronics Industries Association
(EIA) in 1960.
•Data Transmission: Transmits data one bit at a time
over a single communication line.
•Voltage Levels: Utilizes voltage levels between -15V
and +15V, where typically -12V to -3V represents a logic
'1' (marking) and +3V to +12V represents a logic '0'
(spacing).
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
6
Assembly and C Upper Saddle River, NJ 07458. • All Rights
RS232 Pins
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
7
Assembly and C Upper Saddle River, NJ 07458. • All Rights
Null modem connection
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
8
Assembly and C Upper Saddle River, NJ 07458. • All Rights
Null modem connection
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
9
Assembly and C Upper Saddle River, NJ 07458. • All Rights
RS-232C Pins
www. Micro Digital Ed. com
BIHE university
3 TxD (Transmit Data) Carries data from the DTE to the DCE.
Indicates that the DTE is ready to
4 DTR (Data Terminal Ready)
communicate.
5 GND (Signal Ground) Common ground for all signals.
Indicates that the DCE is ready to
6 DSR (Data Set Ready)
communicate.
Indicates that the DTE is ready to transmit
7 RTS (Request to Send)
data.
8 CTS (Clear to Send) Indicates that the DCE is ready to accept data.
Indicates that a ringing signal is being
9 RI (Ring Indicator)
AVR Microcontroller and Embedded System Using received. © 2011 Pearson Higher Education,
10
Assembly and C Upper Saddle River, NJ 07458. • All Rights
AVR Connection
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
11
Assembly and C Upper Saddle River, NJ 07458. • All Rights
AVR Connection
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
12
Assembly and C Upper Saddle River, NJ 07458. • All Rights
AVR Connection
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
13
Assembly and C Upper Saddle River, NJ 07458. • All Rights
USART Serial Data Communication in AVR Microcontroller
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
15
Assembly and C Upper Saddle River, NJ 07458. • All Rights
USART Serial Data Communication in AVR Microcontroller
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
16
Assembly and C Upper Saddle River, NJ 07458. • All Rights
USB
www. Micro Digital Ed. com
BIHE university
USB Port: The Universal Serial Bus, or USB, is an external port that
interfaces between external devices and a computer. The
original IBM personal computers had an RS-232 port that connected
external devices like a keyboard or mouse. Today, USB ports are
replacing RS-232 ports. One may plug most anything into a USB
port. This includes keyboards, cameras, mice, joysticks, modems,
zip drives, floppy drives, printers, and scanners.
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
18
Assembly and C Upper Saddle River, NJ 07458. • All Rights
SPI (Serial
( Peripheral Interface )
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
19
Assembly and C Upper Saddle River, NJ 07458. • All Rights
SPI (Serial
( Peripheral Interface )
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
21
Assembly and C Upper Saddle River, NJ 07458. • All Rights
TWI:Two-wire
TWI: Serial Interface
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
22
Assembly and C Upper Saddle River, NJ 07458. • All Rights
TWI:Two-wire
TWI: Serial Interface
www. Micro Digital Ed. com
BIHE university
TWI-Connection
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
23
Assembly and C Upper Saddle River, NJ 07458. • All Rights
TWI:Two-wire
TWI: Serial Interface
www. Micro Digital Ed. com
BIHE university
How it works
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
25
Assembly and C Upper Saddle River, NJ 07458. • All Rights
TWI:Two-wire
TWI: Serial Interface
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
26
Assembly and C Upper Saddle River, NJ 07458. • All Rights
Ethernet
www. Micro Digital Ed. com
BIHE university
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
27
Assembly and C Upper Saddle River, NJ 07458. • All Rights
Ethernet
www. Micro Digital Ed. com
BIHE university
Ethernet Block
Diagram
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
28
Assembly and C Upper Saddle River, NJ 07458. • All Rights
Ethernet
www. Micro Digital Ed. com
BIHE university
End of lesson 2
AVR Microcontroller and Embedded System Using © 2011 Pearson Higher Education,
30
Assembly and C Upper Saddle River, NJ 07458. • All Rights