Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8433215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T06:19:35+00:00 2026-06-10T06:19:35+00:00

I need to code a delay for a 8051. I can do that but

  • 0

I need to code a delay for a 8051. I can do that but what I don’t know is how to calculate the frecuency of my delay. For example, here is a delay I did:

DELAY: MOV R2, 0FFH
D2:    NOP
       NOP
       DJNZ R2, DELAY
       RET

But what I don’t know is how many Hz of frequency this delay produces. Is there any way of calculating it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T06:19:37+00:00Added an answer on June 10, 2026 at 6:19 am

    You need to know how many cycles each instruction takes, and the speed of your processor.

    Generically, if your processor is 1MHz, and NOP takes 2 cycles, the DJNZ take 3 cycles (making all of these up, no idea how many cycles these take on a 8051), then the first trip through the loop, from D2: would be 7 cycles (2 + 2 + 3 = 7), with a 1MHz processor, each cycle is 1 microsecond, so that would take 7 µs, rinse and repeat until you reach your desired delay.

    Note, you probably don’t want the DJNZ to jump to DELAY, but D2. Not familiar with the 8051 really, but that’s just a guess.

    Also don’t forget to add up the MOV and RET instructions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In example code below UIAlertView is show after delay, but i need display it
Given this code: a = {1=>2} m = a.method(:[]) I know that I can
I need to code certain Dialogs as Activities that look like dialogs. For this
i need run code that will create a database and populate tables. i am
I need ActionScriot code that will parse a given folder and search it for
I need some code to zoom an image when i mouse over that image,
I am in need to delay the execution of a line of code, say,
I need to add a delay of about 100 miliseconds to my Javascript code
Certain functions in my code take a long time to return. I don't need
I have simple class but with anonymous block of code. I need to cover

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.