100% found this document useful (1 vote)
3K views

Interfacing The 8051 Microcontroller

The document describes several interfaces for microprocessors and microcontrollers including a real-time clock (RTC), keyboard, analog-to-digital converter (ADC), and digital-to-analog converter (DAC). The RTC maintains time and date using a serial interface. The keyboard interface scans rows and columns to detect key presses and uses interrupts. The ADC and DAC use serial interfaces to transmit digital and analog signals respectively.

Uploaded by

ummulkhulsu
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
3K views

Interfacing The 8051 Microcontroller

The document describes several interfaces for microprocessors and microcontrollers including a real-time clock (RTC), keyboard, analog-to-digital converter (ADC), and digital-to-analog converter (DAC). The RTC maintains time and date using a serial interface. The keyboard interface scans rows and columns to detect key presses and uses interrupts. The ADC and DAC use serial interfaces to transmit digital and analog signals respectively.

Uploaded by

ummulkhulsu
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Microprocessors and Microcontrollers/Interfacing with 8051 Lecture Notes

RTC Interface
89C51 Vc

VCC
DS 1307
10 10
5
P1.0 SDA 8

6 1
P1.1 SCL X
32.768K
3 2
+ BAT X
3.6V
- 4 7
INTB\SQ
GND

¾ DS 1307 is a real time clock chip


¾ Maintains real time clock once powered up Year, Month, Day, Time in hours,
Minutes and seconds can be written into or read out serially
¾ Has 56 bytes of data space to save or retrieve data of importance like
settings
¾ Consumes very low power2or 3 uw @ 32.768KHz with a backup battery of 2.5 to
3.6V
¾ Has SDA, SCL pins to send data and clock respectively
¾ SDA, SCL are directly interfaced to I/O pins of 89C51
Keyboard Interface-1

M. Krishna Kumar/IISc. Bangalore M7/V1/June 04/1


Microprocessors and Microcontrollers/Interfacing with 8051 Lecture Notes

7437 748 KY CS
740
1
E
1 C 740 R0\
KEY
8 P2. 3 2 WR
1 ROW
9 1
4 5 ROW
C 1 1
5 7 6
1 1
1 8 9
1 1
P2. ROW
Vc
COL-1 1
743 COL-2 2
P10
P11
3
P12
4
5 P13
6 P14
P15
COL-6
+5 8
9
C
7486
1 5
1 INT
3 1
2

¾ Outputs 8 bit row code (0FEH, 0FDH etc.,) on port0


¾ Interrupts micro-controller when a key is pressed
¾ Interrupt software to find which column and key is pressed
Keyboard Interface -2

M. Krishna Kumar/IISc. Bangalore M7/V1/June 04/2


Microprocessors and Microcontrollers/Interfacing with 8051 Lecture Notes

89C51 +
74F138 10u
P1.7 A2 KB
74C922
P1.6 A1
A0 X
P1.5 X
Vcc E3
ALE X
E2 O2 X

E1 Y 0 1 2 3
RD OE 4 5 6 7
Y
8 9 A B
INT Data Y
Y C D E F

AD3-AD0 4 bit D--A

0.01uF

Keyboard Interface-2
¾ 74C922 is a 16 key encoder that performs keypad scanning and de-bouncing
¾ When key is pressed it outputs a 4 bit code
¾ When interfaced to micro-controller, it reads the code through its port pins
¾ Has key De-bouncing and key mask features
¾ It has a data available output that interrupts the micro-controller
¾ Interrupt software to find the key pressed
Keyboard Interface-3
MC14051 89C51
10Kohms

X7 inhibit
X6

X5
5
X4 X INT
X3
X2 C P1.5

X1 B P1.4
P1.3
X0 A

P1.2
C
74ALS138 B P1.1
P1.0
A

M. Krishna Kumar/IISc. Bangalore M7/V1/June 04/3


Microprocessors and Microcontrollers/Interfacing with 8051 Lecture Notes

¾ The circuit interfaces 64 keys


¾ It consists of 14051 a 8:1 multiplexer and 74138 a 3:8 decoder
¾ When a key is pressed 89C51 is interrupted
¾ The 3 bit input of multiplexer and 3 bit input of the decoder gives the key code
¾ which is read in the interrupt routine
Serial ADC Interface
89C511 ADC 1031

P1.5 SCL VCC

P1.6 D0 VRF

P1.7 CS Analog
Vin
Input
1 CCLK
GND
CCL

¾ ADC1031 from National semiconductor is a 10 bit ADC


¾ with Serial interface
¾ Conversion time is 13.7 us @ 3MHz.
¾ Conversion starts as soon as CS is enabled
¾ External clock 1MHz is connected to CCLK
Serial DAC Interface

M. Krishna Kumar/IISc. Bangalore M7/V1/June 04/4


Microprocessors and Microcontrollers/Interfacing with 8051 Lecture Notes

5V

0.1u 10u VI 1 1

89C51 AD7703
VD
fail
P4.0 SCLK
VOUTA +
DIN LM393A
P4 1 Pass

+
P4.2 SYNC VOUT B LM393A
74HC05
GND REF

0.1u

¾ AD7303 is dual channel 8 bit DAC


¾ Has 16 bit input registers, 8 bit for data and 8 bit for control
¾ Out put voltage = (2*Vref*N) / 255.
¾ Interface is shown to realize window detector
¾ If the data is between upper limit and lower limit pass LED glows else fail LED
glows
Battery Backup

M. Krishna Kumar/IISc. Bangalore M7/V1/June 04/5


Microprocessors and Microcontrollers/Interfacing with 8051 Lecture Notes

Power
230V

+12V +5V
Trickle- 1N19
Charge Vcc of
4 89C51
Circuit
MAX690
2
10 Vc
K
8 Vbat 1
+ Vo
4.8 V
Ni-Cad battery
Varta Aafetronic 7
Reset
(100 mAh)

Reset
Vss
3

¾ Max 690 is a battery switchover/reset generator chip


¾ It provides a voltage thresh hold mechanism for bringing the chip out of reset at
startup and for returning it to reset at power down
¾ The reset out is connected to the reset pin of 89C51 through an inverter
¾ VOUT is connected to the Vcc of any memory chip which requires battery back
up
Serial Interface

M. Krishna Kumar/IISc. Bangalore M7/V1/June 04/6


Microprocessors and Microcontrollers/Interfacing with 8051 Lecture Notes

89C51 +12V +5V


1 16
VDD VCC
TX 14 D 3 Transmitted
148
RX 15 148 2
R Received
Vs GN
8 9
-
89C51
Max 232 +5
1
1
TX 1 D 1
6 Transmitted

RX 1 7
R Received
1 4
+ + 22uf
22uf 3 5
2 6
+
22uf 22uf
15 +

¾ RS 232 interface can be realised with 1488 (transmitter) and 1489 (receiver) level
translator Ics
¾ These ICs require +\- 12V supplies
¾ Max 232 IC require only 5V and four external capacitors
LCD Interface

M. Krishna Kumar/IISc. Bangalore M7/V1/June 04/7


Microprocessors and Microcontrollers/Interfacing with 8051 Lecture Notes

89C51 74F138
P2.7/A15 A2
P2.6/A14 A1
P2.5/A13 A0 LM015
VCC
E3
ALE E2
E1

WR R\W

74F373
L
AD7-AD0 O RS
D7-
O

DB7-DB0

¾ LCD module LM015 displays one line of 16 characters.


¾ LM015 is initialized with some command words through its control register
¾ The data to be displayed is written into its data register in ASCII format
¾ RS pin distinguishes the control and data registers when E is logic high
LED Interface-1

M. Krishna Kumar/IISc. Bangalore M7/V1/June 04/8


Microprocessors and Microcontrollers/Interfacing with 8051 Lecture Notes

+5 MC14489
A
VCC B
C
8
D
RX E
8 8 8 8 8
F
3.6 G
H

89C51

P1.2 Data IO
P1.1 Clock Bank 5
P1.0 Enable Bank 4
Bank 3
Bank 2
Bank 1
¾ MC14489 is a multi character LED driver
¾ With out additional ICs 89C51 can be interfaced to drive five 7 Segment LED
displays.
¾ 24 bit data is serially transmitted to the driver by the 89C51 to display five digits
with decimal point option
¾ MC14489s can be cascaded for more number of displays
¾ The brightness is controlled by the external resister 3.6K

M. Krishna Kumar/IISc. Bangalore M7/V1/June 04/9

You might also like