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.

[SOLVED] Max Delay possible in 89c2051

Status
Not open for further replies.

vikky

Full Member level 3
Full Member level 3
Joined
Oct 18, 2007
Messages
150
Helped
4
Reputation
8
Reaction score
3
Trophy points
1,298
Activity points
2,664
Hi,

Please can anyone tell me what is the maximum delay which can be generated using 89C2051?Does 89C2051 has post scaler?Thanks.

Vikky

Also can anyone share any code for generating long delay of 5 minutes for 89C2051?Thanks.
 
Last edited:

You can generate any deley you like.
If microprocessor doesn't need to do anything else, just take a register, set it to 0xFF, use instruction DJNZ,$ and count 256 cycles of the clock, then do it as many time using another register as a counter, then do it again , again and so on ..

Loop0:
MOV R2, #0xFF
Loop1:
MOV R3, #0xFF
Loop2:
MOV R4, #0xFF
DJNZ R4, $
DJNZ R3, Loop2
DJNZ R2, Loop1
....
 
  • Like
Reactions: vikky and IanP

    IanP

    Points: 2
    Helpful Answer Positive Rating

    vikky

    Points: 2
    Helpful Answer Positive Rating
so you mean to say that the cycle can be extended as many loops i am planning on using in the ckt
 

so you mean to say that the cycle can be extended as many loops i am planning on using in the ckt

The loop can have many, many internal loops, like a bracket in maths ..
Each external loop executes all what's inside it by the number you selected, if it's 0xFF it will be 256 iteration ..
 
You can generate any deley you like.
If microprocessor doesn't need to do anything else, just take a register, set it to 0xFF, use instruction DJNZ,$ and count 256 cycles of the clock, then do it as many time using another register as a counter, then do it again , again and so on ..

Loop0:
MOV R2, #0xFF
Loop1:
MOV R3, #0xFF
Loop2:
MOV R4, #0xFF
DJNZ R4, $
DJNZ R3, Loop2
DJNZ R2, Loop1
....

I am trying to do with interrupts and counting the number of interrupts using static variable.Ur suggestion sir for this method?Thanks
 

just in between loop increment the counter variable and then try to execute the loops if counter is odd or even or multiple of something

also post the interruptions you are planning to put they may be helpful in looking into the issue
 
  • Like
Reactions: vikky

    vikky

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top