Design of 16-channel adjustable speed colored light controller based on VHDL

Publisher:sclibinLatest update time:2010-10-06 Source: 现代电子技术Keywords:VHDL Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

Keywords:VHDL Reference address:Design of 16-channel adjustable speed colored light controller based on VHDL

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

VHDL Programming and FPGA Implementation of Vending Machine Control Module
In recent years, with the rapid development of integrated circuit technology, especially the rapid development of programmable logic devices, EDA (Electronic Design Automation) technology has become the new favorite of electronic design engineers. EDA technology uses computers as tools to complete the logic synthesi
[Industrial Control]
VHDL Programming and FPGA Implementation of Vending Machine Control Module
Design special serial communication chip using VHDL
    Abstract: VHDL design and CPLD implementation of a dedicated serial synchronous communication chip (the internal structure and operation mode of the chip are based on INS8250). It focuses on the development process, implementation difficulties and precautions of using VHDL and CPLD to design dedicated communicati
[Industrial Control]
Latest Security Electronics Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号