Application of 8253 in automatic counting system of production line
This paper introduces an automatic counting system for production lines based on counter/timer 8253, and describes in detail the design principles and implementation methods of the system's software and hardware.
Keywords: counter/timer; automatic counting system
,? Timing time = clock pulse period tc × preset count initial value n
The control logic of 8253 consists of 5 control signals and A0, and the corresponding operations are shown in Table 1.
M2, M1, M0——Working mode selection bit. 0~5 means modes 0~5. Mode 0, interrupt after counting; Mode 1, programmable single trigger operation; Mode 2, frequency division pulse generation; Mode 3, frequency division square wave generation; Mode 4, software trigger strobe; Mode 5, hardware trigger strobe. The working process of mode 0 is as follows: when the program sends a control word to put the selected counter in the set mode, the output of the counter is low; when the initial value of the counter is loaded into the selected counter, under the control of the external input gate high level, it can count down through the respective count pulses. At this time, its output is still "low". When the counter is decremented from the initial value to all "0", a high level output is generated, and this output signal is used to send a count-complete interrupt to the CPU; this interrupt request is maintained until the program loads the initial value into the counter again.
BCD - counting mode selection bit. 1 means counting in decimal, and 0 means counting in binary.
A1 and A0 of 8253 are connected to A2 and A1 of CPU address bus respectively. GATE1 is connected to +5V, and OUT1 is connected to an interrupt request input terminal IR2 of 8259A or an external interrupt input of 51 single-chip microcomputer as interrupt signal INT. The port addresses of 8253 designed in this system are 0350H, 0352H, 0354H, and 0356H respectively.
The initial value of the design number is 1999 (a package box is required to contain 2000 workpieces). Count in decimal, send the lower 8 bits first, then the upper 8 bits, and the control word is 01110001B.
The initialization program is:
MOV AL, 01110001B
At this time, the mode control word is 01000000B, and the program to achieve the above function is:
Previous article:Vortex Flow Signal Processing Based on Spectral Analysis
Next article:Punching large circular holes in laminate
- Popular Resources
- Popular amplifiers
- Microcomputer Principles and Interface Technology 3rd Edition (Zhou Mingde, Zhang Xiaoxia, Lan Fangpeng)
- Chip Manufacturing: A Practical Tutorial on Semiconductor Process Technology (Sixth Edition)
- MCU Principles and C51 Programming Tutorial (2nd Edition)
- Microcomputer Principles and Interface Technology_3rd Edition
- High signal-to-noise ratio MEMS microphone drives artificial intelligence interaction
- Advantages of using a differential-to-single-ended RF amplifier in a transmit signal chain design
- ON Semiconductor CEO Appears at Munich Electronica Show and Launches Treo Platform
- ON Semiconductor Launches Industry-Leading Analog and Mixed-Signal Platform
- Analog Devices ADAQ7767-1 μModule DAQ Solution for Rapid Development of Precision Data Acquisition Systems Now Available at Mouser
- Domestic high-precision, high-speed ADC chips are on the rise
- Microcontrollers that combine Hi-Fi, intelligence and USB multi-channel features – ushering in a new era of digital audio
- Using capacitive PGA, Naxin Micro launches high-precision multi-channel 24/16-bit Δ-Σ ADC
- Fully Differential Amplifier Provides High Voltage, Low Noise Signals for Precision Data Acquisition Signal Chain
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- How to judge the positive and negative turning angle in PID vehicle lateral control
- Can anyone share a cracked version of ATLIUM? I recently changed my computer and my previous AD9 can no longer be cracked.
- [GD32L233C-START Review] 2. Create a new project step by step
- Zigbee network data transmission method
- PICO Solar System Clock
- Has anyone made a radio transmitter and receiver recently?
- ST MEMS device resource library (official ST information, practical information)
- How to effectively charge lead-acid batteries with unstable low voltage?
- 【AT-START-F425 Review】Bootloader - Learning and Information Query
- Quick leak detection | Fluke ii900 Industrial Sonic Imager Free Trial