NE555+74LS90+74LS08 frequency divider single chip microcomputer frequency meter simulation and source code

Publisher:EuphoricVoyageLatest update time:2020-01-02 Source: 51heiKeywords:NE555  74LS90  74LS08 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

The frequency divider NE555 counter chip + 74LS90 and 74LS08 circuit is composed, and then the signal is sent to the T1 pin of the microcontroller for detection and the digital tube display

frequency meter simulation schematic diagram is as follows

 

 

The microcontroller source program is as follows:

#include

#include

typedef unsigned char u8;

typedef unsigned int u16;

typedef unsigned long int u32;

#define shumag P2

#define gongy P1

sbit RED_KHZ=P0^1;

sbit Blue_HZ=P0^0;

sbit fengmingqi=P0^7;

unsigned char code dofly_DuanMa[10]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};

// Display segment code value 0~9

unsigned char TempData[4]; //global variable to store display value

u8 second=0;

u32 sert=0;

u32 count=0;

u16 j=0;

u16 k=0;


void delay(u16 i)

{

while(i--);

}


void display()

{

  u8 i;

        for(i=0;i<3;i++)

        {

                  gongy=i;

         shumag=TempData[i];

         delay(10);

         shumag=0x00;

        

        }

}


void Timer_init()

{

TMOD=TMOD|0X51;

TH0=0X3c;

TL0=0Xb0;


EA=1;

ET0=1;

ET1=1;

TR0=1;

TR1=1;


}


void main()

{


Timer_init();

while(1)

{

    

                if(k==20)

                {

             count=count+TH1*256+TL1;

             TempData[0]= dofly_DuanMa[count/100];

                   TempData[1]= dofly_DuanMa[count/10%10];

                   TempData[2]=dofly_DuanMa[count%10];

                  TH1=0;

                        TL1=0;

                        k=0;

                         }

                          if(count>=1000)

                        fengmingqi=0;

                         if(count<1000)

                        fengmingqi=1;

         display();

        

}

}




void menter0() interrupt 1

{


TH0=0X3c+TH0;

TL0=0Xb0+TL0;

j++;

if(j==20)

{

k=j;

……………………



Keywords:NE555  74LS90  74LS08 Reference address:NE555+74LS90+74LS08 frequency divider single chip microcomputer frequency meter simulation and source code

Previous article:A complete design of a heart rate tester made with a single chip microcomputer and st188
Next article:51 MCU knowledge points: independent buttons to set main switch and sub-switch

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号