download

Matakuliah
Tahun
Versi
: H0194/ Aplikasi Mikroprosesor dan Interfacing
: 2005
: <<versi/revisi>>
Pertemuan 5 & 6
Interface Mikroprosesor secara
Serial
1
Learning Outcomes
Pada akhir pertemuan ini, diharapkan mahasiswa
akan mampu :
• Menjelaskan interface mikroprosesor
secara serial
2
Outline Materi
• Komunikasi Serial
• PC Serial Port Interface
• Hardware Serial Port Interface
3
Komunikasi Serial
• Asynchronous:
TRANSMITTER
RECEIVER
Data
Data
Start
Bit
Stop
Bit
– Paket data kecil
– Sinkronisasi dengan
start bit dan stop bit
– Relatif sederhana
– Overhead yang besar
• Synchronous:
TRANSMITTER
RECEIVER
Data
Data
Clock
Clock
– Paket data besar
– Sinkronisasi dengan
informasi clock terkirim
– Relatif lebih kompleks
– Overhead lebih kecil
4
PC Serial Port Interface
• Standar RS-232
DTR
DTR
DSR
DSR
RTS
RTS
CTS
CTS
CD
CD
RI
RI
TXD
TXD
RXD
RXD
GND
GND
5
PC Serial Port Interface
• Null Modem tanpa
handshake
• Null Modem dengan
handshake
DTE
DTE
DTR
DTR
DSR
DSR
RTS
RTS
CTS
CTS
TXD
TXD
RXD
RXD
GND
GND
DTE
DTE
DTR
DTR
DSR
DSR
RTS
RTS
CTS
CTS
TXD
TXD
RXD
RXD
GND
GND
6
PC Serial Port Interface
• Port Addresses and IRQ’s:
Name
Address
IRQ
COM 1
3F8
4
COM 2
2F8
3
COM 3
3E8
4
COM 4
2E8
3
7
PC Serial Port Interface
• Serial Port’s Registers
Base Address DLAB Read/Write
Abr.
Register Name
=0
Write
-
Transmitter Holding Buffer
=0
Read
-
Receiver Buffer
=1
Read/Write
-
Divisor Latch Low Byte
=0
Read/Write
IER
Interrupt Enable Register
=1
Read/Write
-
Divisor Latch High Byte
-
Read
IIR
Interrupt Identification Register
-
Write
FCR
FIFO Control Register
+3
-
Read/Write
LCR
Line Control Register
+4
-
Read/Write
MCR
Modem Control Register
+5
-
Read
LSR
Line Status Register
+6
-
Read
MSR
Modem Status Register
+7
-
Read/Write
-
Scratch Register
+0
+1
+2
8
Hardware Serial Port Interface
http://www.beyondlogic.org/serial/serial1.htm#30
• RS-232 Waveform
TTL Level
RS-232 Level
9
Hardware Serial Port Interface
• RS-232 Level Converter
10
Hardware Serial Port Interface
• Asynchronous Receiver/Transmitter (UART)
11