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

How to write program for counter in assembly

Discussion in '8051/8951' started by Parth86, Nov 15, 2013.

  1. Parth86

    Parth86 Member

    Joined:
    Dec 25, 2011
    Messages:
    546
    Likes:
    5
    I want to learn how we write code for counter in assembly for 8051 what should i know before to make code for counter
    I want to display digit from 00 to 10 on LCD please anyone explain or give me sample code where I can learn
     
  2. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,310
    Likes:
    914
    Location:
    Rochdale UK
    When you say LCD.. Do you mean like a 16x2 Hitachi style?

    I have some code somewhere, Maybe at work... Most of the low level code was in ASM but wrapped in C so you could see what happens... I'll see if I can find it,,
     
  3. Parth86

    Parth86 Member

    Joined:
    Dec 25, 2011
    Messages:
    546
    Likes:
    5
    I just want to learn counter programming for assembly If you have anything you can share
     
  4. dave

    Dave New Member

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


     
  5. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,310
    Likes:
    914
    Location:
    Rochdale UK

    I sat down last night and wrote this in SDCC.... I use SDCC as it is not only free but a very good compiler.

    I use VSMstudio ( free at labcenter )

    Here is the zip... Inside you'll find LCD.C and LCD.H also a main.c that has the counter ready to go..

    If you need a clock source in or interrupt.. Let me know.
     

    Attached Files:

    • lcd.zip
      File size:
      1.1 KB
      Views:
      123

Share This Page