Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

new with assembly programming

I'm starting to tinker with assembly and I have a board with an 8051 micro-controller. I would like to turn an LED at a rate of half a sec.
My approach is to make a counter and when that counter reaches a value turn the LED on. I would then have the counter to reset to zero and start counting to turn the LED off. The thing is the more I look at the problem the less I have a notion to write a counter in assembly. I am wondering if anyone can suggest something on how to approach it? Thanks for those who took the time to read it and very grateful to those who reply.

Comments

  • anthrax11anthrax11 Member Posts: 511
    : I'm starting to tinker with assembly and I have a board with an 8051 micro-controller. I would like to turn an LED at a rate of half a sec.
    : My approach is to make a counter and when that counter reaches a value turn the LED on. I would then have the counter to reset to zero and start counting to turn the LED off. The thing is the more I look at the problem the less I have a notion to write a counter in assembly. I am wondering if anyone can suggest something on how to approach it? Thanks for those who took the time to read it and very grateful to those who reply.
    :

    [blue]If you already haven't, I suggest you look through some of the code in the 8051 assembler area of PH, perhaps you can find something there:
    http://www.programmersheaven.com/zone5/cat27/index.htm

    Also, try a simple tutorial to get you started:
    http://www.8052.com/tut8051.phtml

    For timing I would rather use a timer than a counter. A counter will have problems with precision timing. Look at chapter 7 on the above page.
    Good luck![/blue]
  • RonnikRonnik Member Posts: 2
    Thanks for replying! I'm still not sure how to use a timer. I am looking at the sites you recommended, hopefully it will have something on how to use a timer. If you can shine some more ideas here I'll appreciate it.



    : : I'm starting to tinker with assembly and I have a board with an 8051 micro-controller. I would like to turn an LED at a rate of half a sec.
    : : My approach is to make a counter and when that counter reaches a value turn the LED on. I would then have the counter to reset to zero and start counting to turn the LED off. The thing is the more I look at the problem the less I have a notion to write a counter in assembly. I am wondering if anyone can suggest something on how to approach it? Thanks for those who took the time to read it and very grateful to those who reply.
    : :
    :
    : [blue]If you already haven't, I suggest you look through some of the code in the 8051 assembler area of PH, perhaps you can find something there:
    : http://www.programmersheaven.com/zone5/cat27/index.htm
    :
    : Also, try a simple tutorial to get you started:
    : http://www.8052.com/tut8051.phtml
    :
    : For timing I would rather use a timer than a counter. A counter will have problems with precision timing. Look at chapter 7 on the above page.
    : Good luck![/blue]
    :

Sign In or Register to comment.