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

Problem no: 22

Batch No: 49

ASSIGNMENT ON MICROPROCESSOR BASED INCUBATOR

Submitted By: NIKITA BHALLA AGAM GOYAL SHUBHAM AGARWAL ALANKRIT KHARBANDA 2011A7PS122P 2011A7PS123P 2011A7PS124P 2011A7PS125P

Microprocessor And Interfacing (CS F241)

Problem Statement
Design a microprocessor based system, for incubator. An incubator maintains the temperature of its chamber to 37 degrees Celsius. Before the incubator is used, it has to be sterilized by increasing its temperature to 150 degrees and maintaining it for one hour. After the chamber is sterilized it is allowed to cool to a temperature of 37 degrees.

A temperature sensor is used for measuring the temperature and the output voltage is given by the following relation: V 0=10mV * T where T is in degrees Celsius. Design the system so that the incubator is sterilized and temperature is maintained at required set point. SYSTEM DESCRIPTION 1.Intel 8086 microprocessor. 2. INPUT DEVICE: (i) 1 temperature sensors. 3.OUTPUT DEVICES: (i) 1 LED to display THE HEATER POSITION 4. ONE 8255 (Programmable Peripheral Interface) chips interfaced to 8086. PortA takes input from ADC0808 which is interfaced with the 1 temperature sensor LM35. PortB is used to set the timer. PC0 is used for led display(relay indicator) and PC1 is used for enabling start of conversion. 5.Internal clock is used to generate 5MHz clock signal for 8086. External clock is used to generate 1MHZ clock signal for timer.
PORTS OF 8255 Port A Port B Port C (Lower) Control Register ADDRESS OF PORT 00H 02H 04H 06H THE Mode-I/0 Mode 0-Input Mode 0-Output BSR-Output DEVICE ADC 0808 8254 TIMER PC0-RELAY PC1-START pin of ADC -

HARDWARE DESCRIPTION CHIP NUMBER(no of chips) 8086 6116(2) 2764(2) CHIP MICROPROCESS OR RAM-2K ROM-8K USE CENTRAL PROCESSING UNIT RANDOM ACCESS MEMORY WHICH CONTAINS DS,SS READ ONLY MEMORY WHICH CONTAINS ENTIRE CODE TO LATCH ADDRESS BUS FUNCTION

Address 00000 h- 00FFFh Address FFC00h - FFFFFh Input of the LATCH is the AD0-AD7of

74LS373(3)

8-BIT LATCH

74LS244(1)

8-BIT BUFFER

UNIDIRECTIONAL BUFFER

the microprocessor (multiplexed) address bus pins and the output of the LATCH is the A0A7 address bus pins of 8255 Input of the buffer is RD, WR M/IO of the microprocessor (multiplexed) data pins and the output is IOR, IOW MEMR, MEMW. Input of the buffer is the AD0-AD7 of the microprocessor (multiplexed) data pins and the output is the D0-D7 data pins of 8255.

74LS245(2)

8-BIT BUFFER

BIDIRECTIONAL DATA BUFFER

8255(1)

PROGRAMMAB LE PERIPHERAL INTERFACE ANALOG TO DIGITAL CONVERTER

CONNECTED TO VARIOUS INPUT OUTPUT DEVICES CONVERTS ANALOG VOLTAGE SIGNAL Vce TO DIGITAL FORM It is an 8-bit Analog to Digital Converter . The pin specifications are shown below in the tabular form: We have used the cascading of timer technique where OUT of counter 0 is connected to CLK of counter 1 and OUT of counter 1 is connected to CLK of counter 2.The description is as give below

ADC0808(1)

8253(1)

CLOCK TIMER

LED DISPLAY LM35(1) TEMPERATU

TO DISPLAY HEATER STATE TO PRODUCE

It senses the temp.

RE SENSOR

ANALOG SIGNAL

and gives output voltage signal according to given below relation V=10mV* T(0C)

Intel 8254 Timer:

Ports of 8254
Counter 0 Counter 1 Counter 2 Control Register

Mode
Mode 3 Mode 3 Mode 0 -

Pin Out
CLK GATE OUT CLK GATE OUT CLK GATE OUT -

Description
-1MHz frequency -Always high(logic1) -connected to CLK of Counter 1 - OUT of counter 0 -always high(logic 1) -connected to CLK of counter 2 - OUT of counter 1 -always high(logic 1) -connected to NMI pin of MPU -Counter 0 CW-36H -Counter 1 CW 76H -Counter 2 CW B0H

ADC 0808 ADC: PINS Vin Vref Start EOC D0-D7 SPECIFICATIONS Analog signal input Max value input signal allowed To start the conversion End of conversion (high after 20 sec.) Data bus pins REMARKS Input from the temp sensor Connected to Vcc=5V Always asserted(logic 1)connected to PC1 through bitset-reset mode(BSR) Not accounted for Connected to Port A

6) TRANSISTOR RELAY SWITCHES Relay switch is used to switch ON/OFF the room heater .It is made On/Off by bitset/reset (BSR ) of PC0. It works at 12V DC and controls heater at 230V AC. ASSUMPTIONS MADE:

1. The Microprocessor 8086 is coded externally. 2. External Clock Generator of 1 MHz is connected to 8086 3. There is no power failure during the operation of the incubator or necessary backup (UPS, generator) is available. 4. There is a jump instruction at the address that the processor generates to the place where our code is stored (i.e. to FF000H). 5. ADC 0808 continuously converts analog temperature signals into digital signals since START pin is always asserted. Except during the initial measurement ,there is no need to provide a delay every time we measure the temperature in the program. 6. Incubator considered here is assumed to be a non-ideal one, i.e. the temperature inside it drops with time when the heater is OFF. ALGORITHM: 1. Code segment and Data Segment are initialized; memories (SRAM, EPROM) are interfaced. 2. Ports of 8255are initialized by writing the control word in the control register. 3. START pin is asserted by setting the PC1 in bitset mode. 4. Heater is switched ON/OFF by bitset/reset of PC0 of 8255 using relay. 5. Counters of the 8254 TIMER are initialized and the count values are passed on to the counters. 6. A delay of 20s is provided so that the ADC will be able to provide the initial temperature. 7. The temperature is read from the sensor and checked if it is 150 0C or not and this task is repeated until the temperature is 1500C and then maintained at that temperature for 1hr. using the 8254 TIMER . 8. After 1 hr. the heater is switched OFF and the temperature is allowed to drop . 9. During this time the temperature is constantly checked for 370C . 10. When this temperature is reached, it is maintained through out with the help of an infinite loop.

ASSEMBLY LANGUAGE PROGRAM(ALP): .model small .data start db 03h onrelay db 01h

offrelay count0 count1 count2 temp1 temp2 .code .startup

db db db db db db

00h 36h 76h B0h 96h 26h

; ; ; ; ;

control word of counter 0 control word of counter 1 control word of counter 2 150 degrees 37 degrees

;Initializing IVT with the address of Interrupt Service Routine ;Type 2 interrupt location 08H mov bx, 00h mov es, bx mov di, 08h ;mov [di], offset Timeout ;mov dx, seg Timeout ;mov [di+2],dx ; Initialization mov ax,0000h mov ds,ax mov ax,FC00H mov cs,ax

;Initialization data segment ;ROM address ;Initialization of code segment

; Programming 8255, 8254, AD570 mov al,98h ;Configuring the ports in 8255 out 06h,al mov al,start ;Asserting start pin of ADC 0808 out 06h,al mov al,count0 ;Control word for counter 0(8254) out 56h,al mov al,count1 ;Control word for counter 1(8254) out 56h,al mov al,count2 ;Control word for counter 2(8254) out 56h,al mov al,E8h out 52h,al mov al,03h out 52h,al mov al,10h out 54h,al mov al,0Eh out 54h,al ;Initializing counter 1 with 1000

;Initializing counter 2 with 3600

; Switching on the heater mov al,onrelay ;Bitset Reset to ON the relay out 06h,al mov cx,0499H Delay: Loop Delay Measure: in al,00h cmp,al,temp1 jc Measure ;Switch off heater mov al,offrelay out 06h,al mov cx,0001h ;Starting the Timer mov al,E8h out 52h,al mov al,03h out 52h,al ;Sterilizing for an hour Sterilize: in al,00h cmp al,temp1 jc SwitchOn mov al,offrelay out 06h,al jmp checkTime; SwitchOn: mov al,onrelay out 06h,al checkTime: cmp cx,0000h jnz Sterilize ;Delaying to get initial input from ADC

;Taking input from temperature sensor ;Compare with 150 Degrees ;Loop If Current Temp < 150 Degrees ;Bitset Reset to OFF the relay ;Set Test Variable to 1 ;Initializing counter0 with 1000

;Measuring Current Temperature ;Check if temperature is equal to 150 ;If less switch on the heater ;Switch Off Heater

;Switch ON the relay ;Checking whether 1 hr is elapsed

;After it is out of the loop i.e., one hour has lapsed

;Switch OFF heater mov al,offrelay out 06h,al ;Bitset reset to OFF the relay

;Maintain At 37 Degrees Indefinitely Maintain: in al,00h ;Reading temperature from the sensor cmp al,temp2 ;Comparing with 37 degrees jc SwitchOn1 ;If less Switch ON the heater mov al,offrelay out 06h,al jmp Maintain SwitchOn1: mov al,onrelay out 06h,al jmp Maintain .EXIT END ;If higher, switch OFF the heater ;Unconditional jump, Infinite Loop ; Lower, So Switch OFF the heater ;Bitset reset to ON the relay ;Unconditional jump, Infinite Loop

INTERRUPT SERVICE ROUTINE:(at memory location FFB00H) FFB00H Timeout PROC NEAR Mov cx,0000H IRET Timeout ENDP

Вам также может понравиться