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; ……………………
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
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Pickering Launches New Future-Proof PXIe Single-Slot Controller for High-Performance Test and Measurement Applications
- Apple faces class action lawsuit from 40 million UK iCloud users, faces $27.6 billion in claims
- Apple faces class action lawsuit from 40 million UK iCloud users, faces $27.6 billion in claims
- The US asked TSMC to restrict the export of high-end chips, and the Ministry of Commerce responded
- The US asked TSMC to restrict the export of high-end chips, and the Ministry of Commerce responded
- ASML predicts that its revenue in 2030 will exceed 457 billion yuan! Gross profit margin 56-60%
- Detailed explanation of intelligent car body perception system
- How to solve the problem that the servo drive is not enabled
- Why does the servo drive not power on?
- What point should I connect to when the servo is turned on?
- How to output multiple pulses?
- Network port control output TTL module
- 【ufun learning】Part 1: Unboxing and drafting
- Can this diode be removed?
- FPGA soft core, hard core, solid core
- Please help, how does this circuit work?
- EEWORLD University ---- PLC Programming Introduction Video Tutorial
- After pressing the left mouse button to select a section of content, after releasing the left mouse button, you will find that the selected area is still changing with the cursor position.
- [RISC-V MCU CH32V103 Review] - 10: Rewritten DC brushed motor driver
- Please help analyze the function of the transistor in this circuit.