The T0 and T1 timing counter functions of the AT89S51 microcontroller are used to count the frequency of the input signal, and the counting frequency result is displayed through an 8-bit dynamic digital tube. It is required to be able to accurately count the signal frequency of 0-250KHZ, and the counting error does not exceed ±1HZ.
1. Circuit Schematic
2. Hardware connection on the system board
(1) Connect P0.0-P0.7 in the "MCU System" area to the ABCDEFGH ports in the "Dynamic Digital Display" area using an 8-core cable.
(2) Connect P2.0-P2.7 in the "MCU System" area to the S1S2S3S4S5S6S7S8 ports in the "Dynamic Digital Display" area using an 8-core cable.
(3) Connect the P3.4 (T0) terminal in the "MCU System" area to the WAVE terminal in the "Frequency Generator" area with a wire.
3. Programming content
(1) The working mode of the timer/counter T0 and T1 is set. As shown in the figure, T0 is working in the counting state and counting the input frequency signal. However, for T0 working in the counting state, the maximum counting value is fOSC/24. Since fOSC = 12MHz, the maximum counting frequency of T0 is 250KHz. The concept of frequency is the number of pulses counted in one second, which is the frequency value. Therefore, when T1 works in the timing state, every time the timing reaches 1 second, T0 stops counting and reads the count value from T0's counting unit, and then processes the data. It is sent to the digital tube for display.
(2) When T1 is working in the timing state, the maximum timing time is 65ms, which cannot reach the timing of 1 second. Therefore, a timing of 50ms is used, and a total of 20 times are used to complete the timing function of 1 second.
Previous article:Design of Taxi Meter Based on Single Chip Microcomputer
Next article:Microcontroller Test 1: Light up a LED
- Popular Resources
- Popular amplifiers
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- Another technical solution for power-type plug-in hybrid: A brief discussion on Volvo T8 plug-in hybrid technology
- HT9170 Dual Tone (DTMF) Receiver
- EEWORLD University ---- HVI Series: Demystifying Active Clamp Flyback Compensation
- Several issues worth noting in DSP development
- Unpacking a Uni-T UTI260B
- Design principle of constant voltage/constant current output monolithic switching power supply
- How to perform non-destructive testing on chip circuit boards
- Dear experts, how can I receive the factory's inventory of dead stock?
- Bacterial integrated circuits
- I would like to ask if there is any interference noise when measuring the ground line with an oscilloscope
- The microcontroller sends a string to the host