This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Assembly for 8051

Can someone help with a code snipet for a fixed delay subroutine using DR1 in memory 20h using a 4Mz crystal

Parents
  • Lots of specifications missing.

    You haven't told what exact chip you have, so we don't know if it is a 12-clocker or maybe a 6-clocker, a 4-clocker or a 1-clocker.

    You haven't specified what unit you want the delay to use - so should each delay "tick" be one millisecond? Or maybe 1 second? Or what?

    You haven't specified if the processor may make use of any nice hardware so it can perform the delay while taking into account time lost in interrupt routines or if it should be just a dumb busy-loop counting machine ticks and hoping that the core doesn't get any interrupts to process during the delay.

    Are you sure that you have zero own ideas how to implement a delay? Have you made any attempts yourself? Wouldn't you learn more, if you do spend own time on the task?

Reply
  • Lots of specifications missing.

    You haven't told what exact chip you have, so we don't know if it is a 12-clocker or maybe a 6-clocker, a 4-clocker or a 1-clocker.

    You haven't specified what unit you want the delay to use - so should each delay "tick" be one millisecond? Or maybe 1 second? Or what?

    You haven't specified if the processor may make use of any nice hardware so it can perform the delay while taking into account time lost in interrupt routines or if it should be just a dumb busy-loop counting machine ticks and hoping that the core doesn't get any interrupts to process during the delay.

    Are you sure that you have zero own ideas how to implement a delay? Have you made any attempts yourself? Wouldn't you learn more, if you do spend own time on the task?

Children