Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The design that controls the oven temperature is given below. At a temperature a

ID: 3848520 • Letter: T

Question

The design that controls the oven temperature is given below. At a temperature above 220 ° C, the INT1 interrupt with low edge trigger calls ISR1 which turns off (OFF) the heater. At temperature values falling below 180 ° C, the sensor output calls ISR0, which provides (ON) to open the INT0 interrupt heater with low edge triggering. We write the program that fulfills these requirements in assembly and C.

Can you help me?

Reset INTI 8051 HEAT OFF HEAT ON 0 turn OFF 1 turn ON P1.0 Power switch Sensor logic 0 if 220 Sensor logic 0 if

Explanation / Answer

Assembly code:

In 8051 two external interrupts are allowed INT0 and INT1.These interrupts are recieved using the ports p3.2 and p3.3 respectively. So, these pins are set to one if there is no interrupt(active low).

start: org 1000h

check: jnb p3.2,isr1 ; jump to isr1 if INT0 is received.

jnb p3.3,isr2 ;jump to isr2 if INT1 is recieved.

sjmp check

isr1: clr p1.0 ;turns off the power

sjmp check

isr2: setb p1.0 ;turn on the power.

sjmp check

end

C program:

Let integer variables int0 and int1 denots the two interrupts respectively.

integer p denotes the power supply.

#include<stdio.h>

#include<conio.h>

void main(){

int int0,int1,p;

while(1){

if(int0==0){

p=0;

}

if(int1==0){

p=1;

}

}