1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

want to make a counter

Discussion in '8051/8951' started by shahood, Mar 8, 2014.

  1. shahood

    shahood New Member

    Joined:
    Mar 5, 2014
    Messages:
    3
    Likes:
    0
    Location:
    Karachi, Pakistan
    can any one tell me about 8051 assembly language ......i want to make pulse counter when pulse comes form any pin of micro controller and count it and send it on LCD display ..i have connected lcd to port 2 and rs ,rw, en connected p1.0, p1.1, p1.2 repetitively plz plz tell how could i make a counter when pin suppose p3.4 goes high count one and display on LCD 1 .....and go on to 9999 ....plz plz plz plz help me
     
  2. Inquisitive

    Inquisitive Super Moderator

    Joined:
    Aug 31, 2011
    Messages:
    924
    Likes:
    86
    Location:
    Georgia, USA
    Do you have a schematic and code that you have started?
     
  3. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,151
    Likes:
    907
    Location:
    Rochdale UK
    ONLINE
    To use T0 input you need to re-direct the clock input to the timer.

    How much code have you written?... Have you the routines to run the LCD?? If yoy post what you have I'll take a look and see if I can get you going!!!

    Also!! Read this article. http://www.electro-tech-online.com/articles/simple-interrupts-on-the-8051.654/

    Half way down the page there is a description on the TMOD register and how to implement it!!
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. shahood

    shahood New Member

    Joined:
    Mar 5, 2014
    Messages:
    3
    Likes:
    0
    Location:
    Karachi, Pakistan

    you guys are good thanks for supporting but i want Assembly code for 8051 ....
     
  6. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,151
    Likes:
    907
    Location:
    Rochdale UK
    ONLINE
    We know you do.... But we won't write it for you without some of your input!!!

    I haven't time to completely write code all day, If I help you I expect you to start by trying to do it first!
     
    • Agree Agree x 1
  7. shahood

    shahood New Member

    Joined:
    Mar 5, 2014
    Messages:
    3
    Likes:
    0
    Location:
    Karachi, Pakistan
    ok tell me what would i have to do ..?
    3
     
  8. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,151
    Likes:
    907
    Location:
    Rochdale UK
    ONLINE
    Write a portion of code for me, how you think it should go... Even if you know parts are not correct, I'll walk you through it..

    Download MCU8051IDE and then you can quickly debug your code to make sure you understand as you go along..
    http://mcu8051ide.sourceforge.net/

    Its a cool tool and will help you heaps...
     
  9. atif123

    atif123 Member

    Joined:
    Aug 7, 2009
    Messages:
    59
    Likes:
    0
    u can make up down counter on 89c51
     
  10. atif123

    atif123 Member

    Joined:
    Aug 7, 2009
    Messages:
    59
    Likes:
    0
    16f77a
     

Share This Page