RTC Interface 89C51 Vcc P1.0 10k 10k 5 SDA DS 1307 8 VCC P1.1 6 SCL X1 1 + 3 BAT X2 2 32.768KHz - 3.6V 4 GND INTB\SQW 7 M. Krishna Kumar MAM/M7/LU17/V1/2004 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 8 9 C 5 1 P2.0 P2.7 1 11 3 18 4 17 7 14 8 18 74374 EN C1 Vcc 2 19 5 16 6 15 9 12 KEY MATRIX 7408 7486 7400 ROW0 ROW1 ROW7 KY CS R0\ WR\ +5V 7430 7486 1 2 3 COL-1 COL-2 COL-6 1 2 3 4 5 6 14 P10 P11 P12 P13 P14 P15 INT1 8 9 C 5 1 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 89C51 + 74F138 10uF P1.7 P1.6 P1.5 ALE V cc A2 A1 A0 E3 E2 O2 74C922 X4 X3 X2 X1 KBM RD INT1 E1 OE Data Available Y1 Y2 Y3 Y4 0 1 2 3 4 5 6 7 8 9 A B C D E F AD3-AD0 4 bit D--A + 0.01uF 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 10Kohms each MC14051 89C51 X7 inhibit X6 5V X5 X4 X INT1 X3 X2 C P1.5 X1 B P1.4 X0 A P1.3 74ALS138 C B A P1.2 P1.1 P1.0 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 5V P1.5 S CLK VCC P1.6 D0 VRF P1.7 CS Vin Analog Input 1 MHz C CLK C CLK GND 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 M. Krishna Kumar MAM/M7/LU17/V1/2004 10
Serial DAC Interface 5V 0.1uF 10uF 1K 1K V IN 89C51 AD7703 P4.0 SCLK V DD V OUT A + fail P4.1 DIN LM393A Pass P4.2 SYNC GND V OUT REF B + LM393A 74HC05 0.1uF 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 Out put voltage = 2 x Vref x 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 M. Krishna Kumar MAM/M7/LU17/V1/2004 12
Battery Backup 230Vac Power supply +12Vdc +5Vdc Trickle- Charge Circuit 1N194 diode 10 K MAX690 2 Vcc Vcc of 89C51 4.8 V Ni-Cad battery Varta Aafetronic (100 mah) + 8 Vbatt Vout 1 Reset 7 Vcc of memory 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 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 TX 14 V DD D V CC 1488 3 Transmitted data RX 15 1489 R 2 Received data 89C51 TX Vss GND 8 9-12V 11 Max 232 D 1 6 16 14 +5V Transmitted data RX 22uf 22uf + + 10 1 3 2 R 15 7 4 5 6 + + 22uf 22uf Received data 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 74F138 P2.7/A15 P2.6/A14 P2.5/A13 ALE V CC A 2 A 1 A 0 E 3 E 2 E 1 LM015 WR R\W 74F373 AD7-AD0 LE D7-D0 O0 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 V CC A B C 8 D 3.6K R X E F G H 8 8 8 8 8 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