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 / frequency counter using 8051(with the help of external interrups:

frequency counter using 8051(with the help of external interrups:

|

Microcontroller › 8051 › frequency counter using 8051(with the help of external interrups:

  • This topic has 4 replies, 5 voices, and was last updated 7 years, 1 month ago by Saatwik.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • March 25, 2011 at 11:40 am #824
    HASSAN ALI
    Participant

    hii want a code of

                                    “frequency counter”

    that counts the incoming pulses following is the code having some mistakes which i dont know.

    kindly anybody help me in this matter.

    regards.

     

    code is:

     

    #include <AT89X51.h>
    # define T1 P3_2
    #define RS P0_0
    #define RW P0_1
    #define E P0_2
    #define dataline P2
    void Delay(unsigned int time)
    {
        unsigned int i;
        unsigned int j;
        for(j=0;j<time;j++)
            for(i=0;i<127;i++)
            ;
    }
     void lcddata(unsigned char j)
    {
        dataline=j;
        RS=1;
        RW=0;
        E=1;
        Delay(10);
        E=0;
        Delay(50);
    }
    void lcdcmd(unsigned char j)
    {
        dataline=j;
        RS=0;
        RW=0;
        E=1;
        Delay(10);
        E=0;
        Delay(50);
    }

    void Convert_Display(unsigned char value)
    {
      unsigned char x,d1,d2,d3;
      x=value/10;
      d1=value%10;
      d2=x%10;
      d3=x/10;
          lcdcmd(0x38);
        lcdcmd(0x0E);
        lcdcmd(0x01);
        lcdcmd(0x06);
        lcdcmd(0x86);
          Delay(50);
            lcddata(d3+’0′);
            Delay(50);
            lcddata(d2+’0′);
             Delay(50);
            lcddata(d1+’0′);
            Delay(50);
     }
     unsigned char value;
     void timer0() interrupt 0
         {    
                
               TH1=0;
              
              
            TL1=1;
            value=TL1;
         Convert_Display(value);
                 TR0=1;
            TH1=1;    
                   }
     void main(void)
             {T1=1;    

            IE=0x81;
        
            TMOD=0x06;
           

             IT0=1;
              EX0 = 1;   // Enable EX0 Interrupt
               
               EA = 1;    // Enable Global Interrupt Flag

           
            while(1);  }
                   
        

       

    March 27, 2011 at 8:33 am #5816
    Amit Joshi
    Participant

    I think it is need to program TCON register by this controller can under stand the type of interrupt signal whether it is edge-trigger or level trigger.

    October 6, 2011 at 6:17 pm #6683
    spawns
    Participant

    can u write the code for the 1 with software interrupts….using TR1 and TR0   .????

    thanx in advace

    March 23, 2019 at 5:37 am #15057
    Usman Ghani
    Participant

    Can anyone provide me the full code of frequency counter using 8051.urgent please

    March 23, 2019 at 1:14 pm #15058
    Saatwik
    Participant

    Please visit link , there is project that mesure or count frequency https://www.engineersgarage.com/contribution/frequency-and-rpm-counter

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

RSS Recent Posts

  • reviving old swordfish program but? May 17, 2026
  • Assistance locating a 'trail' camera gadget, please ? May 16, 2026
  • Analog multiplexer has gone obselete May 16, 2026
  • Difference between TTL, RS232 and RS485 May 16, 2026
  • Smart Buoy project May 16, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 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