Вы находитесь на странице: 1из 20

RTC Interface

89C51 Vcc VCC DS 1307 10k 10k 5 P1.0 8 SDA 6 1 P1.1 SCL
89C51
Vcc
VCC
DS 1307
10k
10k
5
P1.0
8
SDA
6
1
P1.1
SCL
X1
3
2
+
BAT
X2
3.6V
-
4
7
INTB\SQW
GND

M. Krishna Kumar

MAM/M7/LU17/V1/2004

32.768KHz

1

RTC Interface contd….

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

M. Krishna Kumar

MAM/M7/LU17/V1/2004

2

Keyboard Interface-1 74374 7486 KY CS 7408 1 EN R0\ 11 C1 7400 KEY MATRIX
Keyboard Interface-1
74374
7486
KY CS
7408
1
EN
R0\
11
C1
7400
KEY MATRIX
P2.0
8
3
2
WR\
18
ROW0
9
19
4
5
ROW1
C
16
17
5
7
6
15
14
1
8
9
18
12
P2.7
ROW7
Vcc
COL-1
7430
1 2 P10
COL-2
P11
3 4 P12
5 P13
6 P14
P15
COL-6
8
+5V
9
C
7486
5
1
14
INT1
3
1
2
M. Krishna Kumar
MAM/M7/LU17/V1/2004
3

Keyboard Interface-1 contd…

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

M. Krishna Kumar

MAM/M7/LU17/V1/2004

4

Keyboard Interface -2

+ 74F138 10uF A2 74C922 KBM A1 X4 A0 X3 V cc E3 X2 O2
+
74F138
10uF
A2
74C922
KBM
A1
X4
A0
X3
V
cc
E3
X2
O2
E2
X1
E1
0
12
3
Y1
OE
4
56
7
Y2
8
9
AB
Data Available
Y3
Y4
C
DEF
4 bit
D--A
+
0.01uF

89C51

P1.7

P1.6

P1.5

ALE

RD

INT1

AD3-AD0

M. Krishna Kumar

MAM/M7/LU17/V1/2004

5

Keyboard Interface-2 contd…

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

M. Krishna Kumar

MAM/M7/LU17/V1/2004

6

Keyboard Interface-3

MC14051 89C51 10Kohms each X7 inhibit X6 X5 5V X X4 INT1 X3 X2 C
MC14051
89C51
10Kohms each
X7
inhibit
X6
X5
5V
X
X4
INT1
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

MAM/M7/LU17/V1/2004

7

Keyboard Interface-3 contd…

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

M. Krishna Kumar

MAM/M7/LU17/V1/2004

8

Serial ADC Interface

89C511

ADC 1031

Analog InputSerial ADC Interface 89C511 ADC 1031 M. Krishna Kumar MAM/M7/LU17/V1/2004 9

M. Krishna Kumar

MAM/M7/LU17/V1/2004

9

Serial ADC Interface contd…

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 C CLK

starts as soon as CS is enabled External clock 1MHz is connected to C C L

M. Krishna Kumar

MAM/M7/LU17/V1/2004

10

Serial DAC Interface 5V 0.1uF 10uF V IN 1K 1K 89C51 AD7703 V DD fail
Serial DAC Interface
5V
0.1uF
10uF
V IN
1K
1K
89C51
AD7703
V DD
fail
P4.0
SCLK
+
V OUT A
P4.1
DIN
LM393A
+
P4.2
SYNC
B
LM393A
V OUT
74HC05
GND
REF
0.1uF

M. Krishna Kumar

MAM/M7/LU17/V1/2004

Pass

11

Serial DAC Interface contd…

AD7303 is dual channel 8 bit DAC

Has 16 bit input registers, 8 bit for data and 8 bit for control

2 x Vref x N

Out put voltage =

Interface is shown to realize window detector If the data is between upper limit and lower limit pass

255

LED glows else fail LED glows

M. Krishna Kumar

MAM/M7/LU17/V1/2004

12

230Vac

M. Krishna Kumar

Battery Backup

Power supply +12Vdc +5Vdc Trickle- 1N194 Charge diode Circuit MAX690 2 10 Vcc K 1
Power supply
+12Vdc
+5Vdc
Trickle-
1N194
Charge
diode
Circuit
MAX690
2
10
Vcc
K
1
8 Vbatt
Vout
+
4.8 V
Ni-Cad battery
Varta Aafetronic
7
(100 mAh)
Reset
Reset
Vss
3

Vcc of 89C51

Vcc of memory

MAM/M7/LU17/V1/2004

13

Battery Backup

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 V OUT is connected to the Vcc of any memory chip which requires battery back up

M. Krishna Kumar

MAM/M7/LU17/V1/2004

14

Serial Interface 89C51 +12V +5V 1 16 V DD V CC TX 14 3 D
Serial Interface
89C51
+12V
+5V
1 16
V DD
V CC
TX
14
3
D
Transmitted data
1488
2
15
1489
RX
R
Received data
Vss
GND
8
9

M. Krishna Kumar

89C51

-12V

+5V Max 232 16 1 11 14 TX D 6 RX 10 7 R 1
+5V
Max 232
16
1
11
14
TX
D
6
RX
10
7
R
1
4
+
+
22uf
22uf
3
5
6
2
+
22uf
22uf
15
+

MAM/M7/LU17/V1/2004

Transmitted data

Received data

15

Serial Interface

(transmitter) and 1489 (receiver) level translator Ics

RS 232 interface can be realised with 1488

These ICs require +\- 12V supplies

Max 232 IC require only 5V and four external

capacitors

M. Krishna Kumar

MAM/M7/LU17/V1/2004

16

M. Krishna Kumar

89C51

LCD Interface

74F138

P2.7/A15

P2.6/A14

P2.5/A13

AD7-AD0

A 2

A 1

A

P2.7/A15 P2.6/A14 P2.5/A13 AD7-AD0 A 2 A 1 A 0 V CC E 3 ALE E
P2.7/A15 P2.6/A14 P2.5/A13 AD7-AD0 A 2 A 1 A 0 V CC E 3 ALE E
P2.7/A15 P2.6/A14 P2.5/A13 AD7-AD0 A 2 A 1 A 0 V CC E 3 ALE E
0 V CC E 3 ALE E 2 E 1 WR 74F373 LE O0 D7-D0
0
V CC
E 3
ALE
E 2
E 1
WR
74F373
LE
O0
D7-D0
OE

LM015

R\W

RS

DB7-DB0

2 A 1 A 0 V CC E 3 ALE E 2 E 1 WR 74F373

MAM/M7/LU17/V1/2004

17

LCD Interface

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

M. Krishna Kumar

MAM/M7/LU17/V1/2004

18

LED Interface-1

+5V MC14489 A V CC B C 8 D R E X 8 8 8
+5V
MC14489
A
V
CC
B
C
8
D
R
E
X
8
8
8
8
8
F
3.6K
G
H
89C51
P1.2
Data IO
P1.1
Bank 5
Clock
P1.0
Bank 4
Enable
Bank 3
Bank 2
Bank 1

M. Krishna Kumar

MAM/M7/LU17/V1/2004

19

LED Interface-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 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

MAM/M7/LU17/V1/2004

20