Let the rightmost digital tube display the number 2 and the decimal point.
2. Experimental Purpose:
To master the value assignment method of each I/O port when the digital tube displays the required number
3. Experimental task analysis
In the previous experiments, we chose light-emitting diodes as display units. In this experiment, we will use digital tubes as display units. At this time, we should put the JMP0 jumper in the 2 and 3 positions to select digital tube display.
Now let's take a look at the connection form of the circuit, as shown in the figure below.
From the circuit diagram, we can see that the output of port p0 is the segment code of the digital tube, which controls the number displayed by the digital tube, and the output of port p2 is the bit code, which controls which digital tube is selected for display.
So if the digital tube is to display 2, what should the output of port p0 and port p2 be? Now let's analyze the light-emitting principle of the digital tube.
The digital tube is actually composed of several strip-shaped light-emitting diodes. There are two ways of connection, namely common cathode and common anode connection. As shown in the figure below:
From the figure, we can see that for the digital tube connected with the common anode, in order to make it display normally, the com port should be connected to the power supply, and the corresponding field is to output a low-level drive. For the digital tube connected with the common cathode, com should be grounded, and the corresponding field outputs a high-level drive.
Since the learning board uses a common anode digital tube, if you want the rightmost S0 to display a number, P2.0 should output a high level, so that the com terminal of S0 is connected to a high level and S0 is selected for display; if it is to display 2 and the decimal point is also displayed, the a, b, g, e, d, dp fields output a low level, and the remaining fields output a high level.
At the same time, since the corresponding relationship between the P0 port and each field is: P0.7 P0.6 P0.5 P0.4 P0.3 P0.2 P0.1 P0.0~d dp ecgbfa, we should assign 12h to the P0 port, and then let P2.0 output a high level.
4. The experimental procedure is as follows:
org 0000h;
start: clr p1.5
mov a,#012h; when displaying the number 2 and the decimal point, the corresponding 8-segment code
mov p0,a; send the 8-segment code to port P0
mov P2,#01H; select the rightmost digital tube to display
ljmp start
end
5. For easy reference, the contents of various digital displays corresponding to the P0 port are shown in the following table:
Previous article:MCU Learning VII: Basic I/O Port Experiment 3 - Left and Right Marquee
Next article:MCU Learning 5: Basic I/O Port Experiment - Lighting up the Diode
- 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
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
- [Review of Arteli Development Board AT32F421] + Raising a Watchdog
- Let's talk about five cents and share your experience in voltage regulation circuit design
- Share: A brief analysis of the access control system using RFID technology
- How does this circuit achieve precise voltage regulation?
- MicropyCli - Micropython project management automation
- 【AIoT Smart Smoke Detection System】System Design Overview
- Doping of semiconductors from the perspective of energy levels
- EEWORLD University - HDMI 2.1 Design and Testing Update
- Design of breathing light based on FPGA
- Classification, functions and effects of interface circuits