Ece3003 Lab Task 5

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 11

ECE3003 – MICRO LAB TASKS

NAME: RUDRAROOP BASU


REG NO: 20BEC0394
SLOT: L -21+22
COURSE NAME/CODE: ECE3003 –
MICROCONTROLLER AND ITS APPLICATIONS
FACULTY: DR. HEMPRASAD YASHWANT PATIL SIR
LAB TASK: 5

QUESTIONS:
SOLUTIONS:
QUESTION 1:
ALGORITHM:
1. START
2. CLEAR THE PORT P2.4
3. SET TIMER 0 TO MODE 1
4. SET THE LOWER AND HIGHER BITS ACCORDINGLY
5. START THE TIMER
6. END

CALCULATIONS:
FLOWCHART:
CODE WITH COMMENTS AND SAMPLE OUTPUT:
ORG 0000H
CLR P2.4; clears the output port
MOV TMOD,#01; Timer 0,Mode 1
MOV TL0,#66H; The low byte
MOV TH0,#0EAH; The high byte
SETB P2.4; Sending the high output
SETB TR0; Starting timer 0
AGAIN: JNB TF0,AGAIN; Monitoring timer flag 0
CLR TR0; Stopping the timer 0
CLR TF0; Clearing the timer 0 flag
END; end
QUESTION 2:
ALGORITHM:
1. START
2. SET THE SERIAL PORT
3. LOAD VALUES FROM THE DATA POINTER
4. SEND TO THE SERIAL PORT
5. REPEAT THE PROCESS
6. END
FLOWCHART:
CODE WITH COMMENTS AND SAMPLE OUTPUT:
ORG 0000H
MOV TMOD,#20H; Timer 1, Mode 2 (Auto Reload)
MOV TH1,#-3; Baud Rate is 9600
MOV SCON,#50H; 8-bit, 1 stop, REN enabled
SETB TR1; starting Timer 1
AGAIN: MOV R0,#70H
MOV R1,#15
MOV DPTR,#50H
LOOP: CLR A
MOVC A,@A+DPTR
MOV @R0,A
INC R0
INC DPTR
MOV SBUF,A; loading SBUF
HERE:JNB TI,HERE; waiting for the last bit
CLR TI; getting ready for the next byte
DJNZ R1,LOOP
SJMP AGAIN
ORG 50H
DB 'VIT UNIVERSITY '; given in the question
END

You might also like