0 Introduction
In recent years, FPGA/CPLD has developed rapidly. With the continuous advancement of integrated circuit manufacturing technology, cost-effective FPGA/CPLD devices have been introduced, making FPGA/CPLD an important way of hardware design today. Compared with traditional circuit design methods, FPGA/CPLD has powerful functions, short development cycle, low investment, easy tracking of market changes, timely modification of product design, and intelligent development tools. Among the many FPGA/CPLD design languages, VHDL language, as a mainstream hardware description language, has strong circuit description and modeling capabilities, and can model and describe digital systems from multiple levels, thereby greatly simplifying hardware design tasks, improving design efficiency and reliability, and showing strong vitality and application potential in terms of language readability and hierarchical and structured design.
QuartusⅡ is an FPGA/CPLD integrated development environment launched by Altera in the early 21st century. It is the successor to Altera's previous generation FPGA/CPLD integrated development environment Max+PlusⅡ. It has a user-friendly interface, is easy to use, and has powerful functions. It provides designers with a structure-independent design environment, allowing designers to easily input designs, quickly process, and program devices.
In this paper, a color light controller which can be used to control 16 channels of color lights and has 4 color light change modes and adjustable change speed is designed using VHDL language under QuartusⅡ development environment.
1 Design ideas of 16-channel adjustable speed colored light controller
The 16-channel adjustable colored light controller can be divided into three parts according to its functions, as shown in Figure 1. Among them, the 8 Hz frequency division part is used to divide the clock signal with a frequency of 10 MHz to obtain a clock signal CLK8 with a frequency of 8 Hz. CLK8 is used as the reference clock of the speed control part. Through counting and frequency division, clock signals with frequencies of 4 Hz, 2 Hz and 1 Hz can be obtained. Then, one of them is selected as the colored light clock signal CLKQ by the speed regulation signal. CLKQ is the reference clock of the colored light control part, which is used to determine the speed of the colored light change. In this way, the speed regulation signal SPD controls the speed of the colored light change, making the colored light adjustable.
The color light control part controls 16 color lights by outputting a 16-bit binary number (i.e., the color light output signal Q). Each bit of the binary number corresponds to the switch of a color light. When the bit is "1", the light is on, and when the bit is "0", the light is off. There are 4 modes for the color light conversion:
sO mode: only one light is on, and it moves from the leftmost end to the rightmost end one by one, that is, the output signal Q moves 1 "1" to the 0th position in sequence starting from the 15th position;
S1 mode: only one light is on, and it moves from the rightmost end to the leftmost end one by one, that is, the output signal Q moves 1 "1" from the 0th bit to the 15th bit in sequence;
S2 mode: 2 lights are on and move from the left and right ends to the middle at the same time, that is, the output signal Q moves 1 "1" from the 15th bit to the 8th bit in sequence, and at the same time moves 1 "1" from the 0th bit to the 7th bit in sequence;
s3 mode: 2 lights are on and move from the middle to the left and right ends at the same time, that is, the output signal Q moves 1 "1" from the 8th bit to the 15th bit in sequence, and at the same time moves 1 "1" from the 7th bit to the 0th bit in sequence.
The four modes cycle in sequence. If the reset signal RST input is high level, the cycle is interrupted, the output signal Q is set to zero, and all the colored lights are off. After RST returns to low level, the cycle starts again from S0 mode.
2 Implementation of 16-channel adjustable speed colored light controller
The circuit symbol of the 16-channel adjustable speed colored light controller designed in this paper is shown in Figure 2, where clk is the 10 MHz clock signal input terminal, rst is the reset control terminal, spd is the speed regulation signal input terminal, and q is the colored light control signal output terminal.
The VHDL code of the 16-channel adjustable speed colored light controller designed in this article is as follows:
[page]
It is worth noting that the 16-channel adjustable speed colored light controller designed in this paper uses a data loop algorithm, which is simpler and more powerful than the previous case when statement. It has the following characteristics:
[page]
(1) During hardware verification, the pin of the speed control end SPD is connected to the DIP switch to achieve manual control of the speed of the colored light change. In further design, the internal control of the SPD signal can also be used to achieve automatic adjustment of various change speeds.
(2) This design uses data shifting to achieve the transformation of colored lights, which is more conducive to the expansion of colored light transformation modes. Although this design only designs 4 transformation modes, it can be easily expanded to 6 to 8 modes or even more as needed.
(3) The division ratio of the 8 Hz frequency division part is too large and is not suitable for computer simulation verification. The division ratio needs to be reduced during simulation and restored to a larger division ratio during hardware verification.
3 Simulation Results Analysis
The 16-channel adjustable speed colored light controller designed in this paper was simulated and verified in the QuartusⅡ development environment, and the simulation waveform is shown in Figure 3. The simulation results are analyzed as follows:
(1) clk is the clock signal, and the rising edge of the clock signal triggers the divider to count;
(2) rst is the reset signal input terminal. When it is at a high level, the color light control output signal q is cleared. After rst returns to a low level, the color light control output signal q restarts the cycle from the so mode;
(3) spd is the speed control signal input terminal. Corresponding to the four values of spd "00", "01", "10", and "11", the speed of the colored lights changing is 1 Hz, 2 Hz, 4 Hz, and 8 Hz respectively;
(4) q is the output terminal of the color light control signal. As shown in Figure 3, the design successfully realizes the cycle of four transformation modes and the adjustment of various transformation speeds.
4 Conclusion
The designed 16-way adjustable speed colored light controller was simulated and verified in QuartusⅡ development environment, and then downloaded to ZYllEDAl3BE experiment box of Hubei Zhongyou Technology Industry Co., Ltd. for hardware verification. The experiment box uses ACEXlK series EP1K30QC208 chip as the core chip. The experiment proves that the design is correct, the function is complete, and the operation is stable. In addition, the 16-way adjustable speed colored light controller designed in this paper can add more transformation modes as needed to make the colored lights more colorful.
Previous article:Working Principle and Basic Features of Capacitive Touch Sensing MCU
Next article:The U.S. Department of Defense is committed to cyborg research: Ten most common cyborg technologies
Recommended ReadingLatest update time:2024-11-16 17:43
- Popular Resources
- Popular amplifiers
- Mir T527 series core board, high-performance vehicle video surveillance, departmental standard all-in-one solution
- Akamai Expands Control Over Media Platforms with New Video Workflow Capabilities
- Tsinghua Unigroup launches the world's first open architecture security chip E450R, which has obtained the National Security Level 2 Certification
- Pickering exhibits a variety of modular signal switches and simulation solutions at the Defense Electronics Show
- Parker Hannifin Launches Service Master COMPACT Measuring Device for Field Monitoring and Diagnostics
- Connection and distance: A new trend in security cameras - Wi-Fi HaLow brings longer transmission distance and lower power consumption
- Smartway made a strong appearance at the 2023 CPSE Expo with a number of blockbuster products
- Dual-wheel drive, Intellifusion launches 12TOPS edge vision SoC
- Toyota receives Japanese administrative guidance due to information leakage case involving 2.41 million pieces of user data
- 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!
- 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
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Understanding of several layers in drawing PCB
- How to use logic analyzer to debug SPI anomalies
- TI C6000 CodecEngine integrated algorithm core calling principle
- Commonly used techniques in PCB design
- EEWORLD University Hall----Live Replay: ADI Reference Voltage Source Product Technology and Application Selection
- Revolutionizing radar design with electronically reconfigurable GaN power amplifiers
- About the debugging of ML75308 optical rainfall chip???
- R&D Management
- [Raspberry Pi Pico Review] Power-on initial test
- Free application: Qinheng RISC-V core BLE 5.3 wireless MCU CH582