Sie sind auf Seite 1von 20

RTC Interface

89C51
Vcc VCC

DS 1307
10k P1.0 10k 5 SDA 6 8 1 32.768KHz

P1.1

SCL

X1

+ 3.6V

BAT

X2

4 GND

INTB\SQW

M. Krishna Kumar

MAM/M7/LU17/V1/2004

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

Keyboard Interface-1
74374
7408 1 11 EN C1 2 19 5 16 6 15 9 12 ROW7 7486

KY CS

8 9 C 5 1

P2.0

KEY MATRIX

7400

R0\
WR\

3 18 4 17 7 14 8 18

ROW0 ROW1

P2.7 Vcc 7430

COL-1 COL-2

1 2 3 4 5 6

COL-6

P10 P11 P12 P13 P14 P15

+5V

7486
1 3 2

14

INT1

8 9 C 5 1

M. Krishna Kumar

MAM/M7/LU17/V1/2004

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

Keyboard Interface -2
89C51 74F138
P1.7 P1.6 P1.5 A2 A1 A0

+
10uF

74C922
X4 X3 X2 O2 X1 Y1 Y2 Data Available Y3 Y4

KBM

Vcc
ALE

E3 E2 E1

0 4 8 C

1 5 9

2 3 6 7 F A B

RD INT1

OE

D E

AD3-AD0

4 bit

D--A

+ 0.01uF

M. Krishna Kumar

MAM/M7/LU17/V1/2004

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

Keyboard Interface-3
10Kohms each X7 X6 5V X5 X4 X3 X2 X1 X0 C B A P1.5 P1.4 P1.3 X INT1

MC14051
inhibit

89C51

P1.2 P1.1 P1.0

74ALS138

B A

M. Krishna Kumar

MAM/M7/LU17/V1/2004

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

Serial ADC Interface


89C511 ADC 1031

5V P1.5 P1.6 SCLK D0

VCC VRF
Analog Input

P1.7

CS
1 MHz

Vin GND

CCLK
CCLK

M. Krishna Kumar

MAM/M7/LU17/V1/2004

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 CCLK

M. Krishna Kumar

MAM/M7/LU17/V1/2004

10

Serial DAC Interface


5V
VIN 0.1uF 10uF 1K 1K

89C51
P4.0 P4.1 SCLK

AD7703
VDD VOUT A DIN

fail + LM393A Pass

+
P4.2 SYNC GND VOUT REF 0.1uF

LM393A 74HC05

M. Krishna Kumar

MAM/M7/LU17/V1/2004

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 = 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

M. Krishna Kumar

MAM/M7/LU17/V1/2004

12

Battery Backup
Power supply
230Vac

+12Vdc TrickleCharge Circuit 1N194 diode

+5Vdc

Vcc of 89C51

MAX690 2
10 K 8 4.8 V Ni-Cad battery Varta Aafetronic (100 mAh) Vcc Vbatt 1

Vout

Vcc of memory
Reset 7

Vss
3

Reset

M. Krishna Kumar

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 VOUT 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
TX 14 15 +12V +5V

1
VDD

16
VCC 3 1488 2 Transmitted data Received data

D
1489 Vss 8 -12V

RX

R
GND 9

89C51 Max 232


TX RX
+

+5V 16 14 7 4 5 6

11 10 1 3 2

D R

1 6

Transmitted data Received data

22uf 22uf

+ 22uf
22uf

15

M. Krishna Kumar

MAM/M7/LU17/V1/2004

15

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

M. Krishna Kumar

MAM/M7/LU17/V1/2004

16

LCD Interface
89C51
P2.7/A15 P2.6/A14 P2.5/A13 VCC ALE

74F138
A2 A1 A0 E3 E2 E1

LM015

WR

R\W

74F373
LE AD7-AD0 O0 D7-D0 OE RS

DB7-DB0

M. Krishna Kumar

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
VCC

A B C
8

D
R
X

3.6K

E F G H

89C51
P1.2 P1.1 P1.0
Data IO Clock Enable

Bank 5 Bank 4 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

Das könnte Ihnen auch gefallen