0% found this document useful (0 votes)
134 views1 page

8051 Counter Code in Assembly Language

This program configures Timer 0 of the microcontroller to operate in 16-bit mode 1 and loads the timer's high and low bytes with initial values of 0. It then sets a pin high, starts the timer running, continuously reads the timer's low byte in a loop until the timer overflow flag is set, stops the timer, clears the overflow flag, and repeats the process.

Uploaded by

Girish Chaple
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
134 views1 page

8051 Counter Code in Assembly Language

This program configures Timer 0 of the microcontroller to operate in 16-bit mode 1 and loads the timer's high and low bytes with initial values of 0. It then sets a pin high, starts the timer running, continuously reads the timer's low byte in a loop until the timer overflow flag is set, stops the timer, clears the overflow flag, and repeats the process.

Uploaded by

Girish Chaple
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

ORG 0H

MOV TMOD,#00000101B ; TIMER 0 MODE 1 16BIT


MOV TH0,#00H
MOV TL0,#00H
SETB P3.4
HERE:SETB TR0
BACK:MOV P1,TL0
JNB TF0,BACK
CLR TR0
CLR TF0
SJMP HERE
END

You might also like