Interfacing of LCD with P 6112021 Temperature control

  • Slides: 30
Download presentation
Interfacing of LCD with µP 6/11/2021 Temperature control using ADC 1

Interfacing of LCD with µP 6/11/2021 Temperature control using ADC 1

LCD (Liquid crystal display) A liquid crystal display (LCD) is a thin, flat electronic

LCD (Liquid crystal display) A liquid crystal display (LCD) is a thin, flat electronic visual display that uses the light modulating properties of liquid crystals (LCs). Applications: Used in computer monitors , televisions , instrument panels, video players, gaming devices, clocks , watches, calculators , and telephones etc. 6/11/2021 Temperature control using ADC 2

Pin diagram of LCD 1. Vss – Gnd 2. Vcc - +5 V 3.

Pin diagram of LCD 1. Vss – Gnd 2. Vcc - +5 V 3. Vee - Contrast control 4. RS - Register select [RS=0: Command, RS=1: Data] 5. RW - Read / Write 6. EN - Enable pulse. 7. D 0 - Data bus LSB 8. D 1. . . . 14. D 7 - Data bus MSB. 15 & 16 - Backlight. 6/11/2021 Temperature control using ADC 3

6/11/2021 Temperature control using ADC 4

6/11/2021 Temperature control using ADC 4

Interfacing of ADC with µP 6/11/2021 5

Interfacing of ADC with µP 6/11/2021 5

6/11/2021 6

6/11/2021 6

ADC 0808 1. A, B, C addresses to select IN 0 -IN 7 2.

ADC 0808 1. A, B, C addresses to select IN 0 -IN 7 2. activate Address latch enable (ALE) to latch in the address. 3. SC is for Start Conversion. 4. EOC is for End of Conversion 5. OE is for Output Enable. 6. The output pins D 0 -D 7 provides the digital output from the chip. 7. Vref (-) and Vref (+) are the reference voltages 6/11/2021 7

SELECTING AN ANALOG CHANNEL How to select the channel using three address pins A,

SELECTING AN ANALOG CHANNEL How to select the channel using three address pins A, B, C is shown in Table below: 6/11/2021 8

Interfacing of ADC 0808 with µP Input to ADC 0808Ø SOC Ø OE Ø

Interfacing of ADC 0808 with µP Input to ADC 0808Ø SOC Ø OE Ø A, B, C Ø ALE Output for ADC 0808Ø EOC Ø D 0 -D 7 6/11/2021 PORT A - D 0 -D 7(input) PORT B - SOC(PB 0) - OE(PB 1) - A, B, C(PB 2, PB 3, PB 4) PORT C - EOC(PC 0) CWR=99 H Addresses for ports A, B, C and CWR=60 H, 61 H, 62 H, 63 H 9

Interfacing of ADC 0808 with µP PA 0 -PA 7 8255 PB 0 PB

Interfacing of ADC 0808 with µP PA 0 -PA 7 8255 PB 0 PB 1 PB 2 PB 3 PB 4 PC 0 EOC Clock generator 6/11/2021 IN 0 IN 1 IN 2 IN 3 IN 4 IN 5 IN 6 IN 7 D 0 -D 7 ALE SOC OE ADC 0808 A B C CLK 10

The sequence and bit pattern required to give control signals. The steps involved will

The sequence and bit pattern required to give control signals. The steps involved will be as: × 6/11/2021 × × C B A OE SOC/ALE 11

Program: MVI A, 99 H OUT 83 H MVI B, 00 H LOOP: MOV

Program: MVI A, 99 H OUT 83 H MVI B, 00 H LOOP: MOV A, B ANI 1 CH ORI 01 H OUT 81 H ANI 1 CH OUT 81 H UP: IN 82 H ANI 01 H CPI 01 H 6/11/2021 JNZ UP MVI A, 02 H OUT 81 H IN 80 H OUT DISPLAY CALL DELAY MOV A, B ADI 04 H MOV B, A JMP LOOP 12

Interfacing of DAC with µP 6/11/2021 13

Interfacing of DAC with µP 6/11/2021 13

Pin diagram of DAC AD 7523 6/11/2021 14

Pin diagram of DAC AD 7523 6/11/2021 14

Interfacing of DAC with 8255 6/11/2021 15

Interfacing of DAC with 8255 6/11/2021 15

Pin description • The supply range is from +5 V to +15 V, while

Pin description • The supply range is from +5 V to +15 V, while Vref may be any where between -10 V to +10 V. • The maximum analog output voltage will be any where between -10 V to +10 V, when all the digital inputs are at logic high state. • Usually a zener diode is connected between OUT 1 and OUT 2 to save the DAC from negative transients. • An operational amplifier is used as a current to voltage converter at the output of AD to convert the current out put of AD to a proportional output voltage. 6/11/2021 16

DAC AD-7523 6/11/2021 17

DAC AD-7523 6/11/2021 17

Program: Ø Generate square wave : - UP: 6/11/2021 MVI A, 80 H OUT

Program: Ø Generate square wave : - UP: 6/11/2021 MVI A, 80 H OUT 83 H MVI A, 00 OUT 80 H CALL DELAY MVI A, F 0 H OUT 80 H CALL DELAY JMP UP 18

Ø Generate Triangular wave: MVI A, 80 H OUT 83 H MVI B, 00

Ø Generate Triangular wave: MVI A, 80 H OUT 83 H MVI B, 00 H AGAIN: MOV A, B UP: OUT 81 H CALL DELAY INR B MOV A, B CPI FFH JNZ UP BACK : DCR B MOV A, B 6/11/2021 OUT 81 H CALL DELAY CPI 00 H JNZ BACK JMP AGAIN 19

Ø Generate saw-tooth wave: MVI A, 80 H OUT 83 H AGAIN: MVI B,

Ø Generate saw-tooth wave: MVI A, 80 H OUT 83 H AGAIN: MVI B, 00 H JMP AGAIN MOV A, B HLT UP: OUT 81 H CALL DELAY INR B MOV A, B CPI FFH JNZ UP 6/11/2021 20

Temperature control 6/11/2021 Temperature control using ADC 21

Temperature control 6/11/2021 Temperature control using ADC 21

FLOW CHART . START . . Initialize 8255 CALL CONVERSION Turn heater on Is

FLOW CHART . START . . Initialize 8255 CALL CONVERSION Turn heater on Is Temp > SET Temp Turn heater off 6/11/2021 Temperature control using ADC 22

Diagram Sensor Heater 6/11/2021 Temperature control using ADC 23

Diagram Sensor Heater 6/11/2021 Temperature control using ADC 23

Control Word • The control word for the PPI is – 1 0 0

Control Word • The control word for the PPI is – 1 0 0 0 1 i. e. , 91 H. 24 6/11/2021 Temperature control using ADC

25 6/11/2021 Temperature control using ADC

25 6/11/2021 Temperature control using ADC

Program: MVI A, 91 H OUT CR BEGIN: CALL CONVERSATION CPI 41 H JC

Program: MVI A, 91 H OUT CR BEGIN: CALL CONVERSATION CPI 41 H JC NEXT MVI A, 0 EH OUT CR JMP BEGIN NEXT: MVI A, 0 FH OUT CR JMP BEGIN 26 6/11/2021 Temperature control using ADC

Conversion Subroutine: CONVERSION: LOOP: MVI A, 00 H OUT PB MVI A, 08 H

Conversion Subroutine: CONVERSION: LOOP: MVI A, 00 H OUT PB MVI A, 08 H OUT PB MVI A, 18 H OUT PB MVI A, 00 H OUT PB ; Send address to select IN 0 ; Latch address by giving ALE High ; Make SOC Low ; Make ALE Low IN PC ANI 01 H JZ LOOP ; Wait for EOC IN PA RET ; Return value and store Accumulator 27 6/11/2021 Temperature control using ADC

Interfacing Circuit 28 6/11/2021 Temperature control using ADC

Interfacing Circuit 28 6/11/2021 Temperature control using ADC

 • The load, in this case a heater, is a device which operates

• The load, in this case a heater, is a device which operates under 230 V ac. • The control signal from the microprocessor through the peripheral interface is of 5 V magnitude. • A solid state relay device is used to interface the control signal with the load. 6/11/2021 Temperature control using ADC 29

Program: MVI A, 91 H OUT 03 L 2: CALL CONVERSION CPI 80 H

Program: MVI A, 91 H OUT 03 L 2: CALL CONVERSION CPI 80 H JC L 1 MVI A, 0 EH OUT CWR JMP L 2 L 1: MVI A, OFH OUT CWR JMP L 2 6/11/2021 SUBROUTINE conversion : MVI A, 00 H OUT PB MVI A, 08 H OUT PB MVI C, 0 AH L 3: DCR C JNZ L 3 MVI A, 18 H OUT PB MVI A, 00 H OUT PB L 4: IN PC ANI 01 H JZ L 4 IN PA RET Temperature control using ADC 30