0% found this document useful (0 votes)
6 views

Timer & INTERRUPT Programming

The document discusses timer programming and interrupt programming for the 8051 microcontroller. It includes code examples for setting up timers to generate delays and toggling outputs. It also provides code for configuring interrupts to trigger on timer timeouts and change port values. Additional sections discuss using an 8086 microprocessor for a stopwatch and interfacing hardware. The document provides code snippets and references for using timers, interrupts, and I/O ports on 8051 and 8086 microcontrollers.

Uploaded by

archumeenabalu
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Timer & INTERRUPT Programming

The document discusses timer programming and interrupt programming for the 8051 microcontroller. It includes code examples for setting up timers to generate delays and toggling outputs. It also provides code for configuring interrupts to trigger on timer timeouts and change port values. Additional sections discuss using an 8086 microprocessor for a stopwatch and interfacing hardware. The document provides code snippets and references for using timers, interrupts, and I/O ports on 8051 and 8086 microcontrollers.

Uploaded by

archumeenabalu
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Timer programming

Ref: 8051 architecture and programming by Mohammed ali mazidi


http://8051-microcontrollers.blogspot.in/2013/02/counters-and-timers.html#.U60MFZSSyxA
ORG 0h
MOV TMOD,#01;
HERE: MOV TL0,#0F2H
MOV TH0,#0FFH
CPL P1.5
ACALL DELAY
SJMP HERE

DELAY: SETB TR0
AGAIN: JNB TF0,AGAIN
CLR TR0
CLR TF0
RET
END
INTERRUPT PROGRAMMING
http://8051-microcontrollers.blogspot.in/2013/02/interrupts.html#.U60LtpSSyxA
ORG 0H
LJMP MAIN

ORG 0003H
MOV P1,#00H
ACALL DELAY
SETB P3.2
RETI

ORG 0013H
MOV P1,#0FFH
ACALL DELAY
SETB P3.3
RETI

ORG 0030h
MAIN:MOV P1,#00H
MOV P0,#0FFH
HERE:MOV A,P0
MOV P1,A
ACALL DELAY
MOV IE,#10000101B
SJMP HERE

DELAY:MOV R0,#0FFH
L2:MOV R1,#0FFH
L1:DJNZ R1,L1
DJNZ R0,L2
RET
END

Stop watch using 8086

http://www.oldlinux.org/Linux.old/docs/interrupts/int-html/int-1a-1.htm

Microprocessors programming hardware and interfacing by douglus v. hall


MOV BX,0000
CALL 0117
CMP BX,CX
JB 010C
JMP 0100
MOV BX,CX
INC BX
CALL 0117
CMP BX,CX
JNB 010F
INT 3
MOV AH,02
INT 1A
RET

You might also like