EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / counter

counter

|

Microcontroller › 8051 › counter

  • This topic has 8 replies, 3 voices, and was last updated 12 years, 3 months ago by saavanan.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • August 28, 2013 at 5:38 am #2608
    saavanan
    Participant

    i want counter program to understand the concept of counter in8051.

    August 29, 2013 at 4:01 pm #10389
    doraemon
    Participant

    Download doc4345 from atmel.com      it contains programs to use different timer,counters.   If you carefully read it you can surely understand it.

    August 29, 2013 at 7:51 pm #10393
    pankaj
    Participant

    To understand concept of counter in 8051, start with simple programming and u can apply it on Proteus (softwere) & keil (hex converter)

    August 30, 2013 at 3:36 pm #10399
    saavanan
    Participant

    sir,i need a sample c code for counter in8051.now only i understand the use of timers in 8051.like that i want counter programming and what are the devices to be connected in protessus software to display the counter output

    August 31, 2013 at 12:46 am #10402
    pankaj
    Participant

    http://www.youtube.com/watch?v=oF-91OyQ9J0

     
    you can see this video…
    August 31, 2013 at 4:39 am #10403
    doraemon
    Participant

    You can interface lcd in proteus to display counter value. for that you have to add code to display counter variable on lcd.

    September 3, 2013 at 4:07 am #10413
    saavanan
    Participant
    sir,i want a proteses simulation for this code.
     
     
     
     
     
     
    #include <REGX51.H>
    sbit LED1=P1^0;
    sbit LED2=P1^1;
    sbit LED3=P1^2;
    sbit LED4=P1^3;
    void call_blink(unsigned char dat);
    void delay(void);
    void main()
    {
    TMOD=0x05;
    TH0=0xff;   //for 12MHz   (12/12MHZ)=1u>per cycle operation
    TL0=0xf0;
    TR0=1;
    while(TF0==0)
    {  
    call_blink(TL0&0x0f);
    } 
    if(TF0==1)
    {
    TF0=0;
    call_blink(0xff);
    }
    }
    void call_blink(unsigned char dat)
    {
    if(dat==0xff)
    {
    while(1)
    {
    LED1=0;delay();
    LED1=1;delay();
    }
    }
    if(dat==0x01)
    LED2=0;
    if(dat==0x04)
    LED3=0;
    if(dat==0x08)
    LED4=0;
    }
    /******************delay**********************/
    void delay(void)
    {
    unsigned char i;
    for(i=0;i<255;i++)
    {
    for(i=0;i<255;i++);
    }
    }

     

     
    September 4, 2013 at 3:41 am #10419
    doraemon
    Participant

    you can easily make one yourself.Just put appropriate controller,connect leds to approriate port,right click on controller and add hex file generated by keil,set clock frequency and you are done. Just run simulation.

    September 4, 2013 at 4:09 am #10420
    saavanan
    Participant

    In this code,TMOD=0x05,this means counter0 mode2.IN PROTESUS,whether i want to connect DC pulse to T0 and T1 or not. 

  • Author
    Posts
Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • What is involved to convert a small town to fiber optic? December 12, 2025
  • Droplet1 December 12, 2025
  • EEPROM not being written or read on dsPIC30F2010 December 12, 2025
  • 12VDC ( 10 - 24 V ) to 0 to +/- 30VDC 1A dual tracking psu - for sale December 11, 2025
  • volkswagen car stereo model rcd310 December 11, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise