Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

1 second Interrupt from 8051?

Status
Not open for further replies.
hi here is subroutine for cal. of 1 sec delay

HUNDERED EQU 100
COUNT EQU -10000 ;100*10000 US=1SEC
DELAY: MOV R7,#HUNDERED
AGAIN: MOV TH0,#HIGH COUNT
MOV TL0,LOW COUNT
SETB TR0
WAIT2: JNB TF0,$
CLR TF0
CLR TR0
DJNZ R7,AGAIN
RET
END
****************************************************

The clock used is a 12MHz .
 

This subroutine is for 1 sec delay

The clock used is a 12MHz .

HUNDERED EQU 100
COUNT EQU -10000 ;100*10000 US=1SEC
DELAY: MOV R7,#HUNDERED
AGAIN: MOV TH0,#HIGH COUNT
MOV TL0,LOW COUNT
SETB TR0
WAIT2: JNB TF0,$
CLR TF0
CLR TR0
DJNZ R7,AGAIN
RET
END
 

Sorry for the interrupt guys, but.... the last two solutions provided for this problem look alike eachother veeeerry much...
Is someone in need for points?
 

Hi all
I notice that no one has asked - what the required timing tolerance on the 1 Second interval?

Does the micro have to action a port pin within ±1µs of 'real time' then this is a will place various constraints on the method used.
If tolerance is ±50ms constraints are more relaxed. If it is a display update this will be different again.

Clarification of the timing requirement might help in the solution.

regards ... Polymath
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top