Button and digital tube display

LED digital display (LEDSegmentDisplays) is a device that is packaged together by a plurality of light-emitting diodes to form an "8" shape. The leads are connected internally, and only need to draw their respective strokes and common electrodes. The number of commonly used segments of the LED digital tube is generally 7 points plus one decimal point, and the other is similar to the 3-digit "+1" type. There are half digits, 1, 2, 3, 4, 5, 6, 8, 10 and so on. According to the LED connection method, the LED digital tube is divided into two types: common yin and common yang. It is very important to understand these characteristics of LED, because different types of digital tubes, besides their hardware circuits, programming methods It is also different. Figure 2 shows the internal circuits of the common cathode and common anode digital tubes. Their principle of illumination is the same, except that their power supply polarity is different. The colors are red, green, blue, yellow and so on.

Fpga button control digital tube display

Figure 1 This is a 7-segment LED digital tube with a decimal point of 10 pins.

Fpga button control digital tube display

Figure 2 pin definition

The following describes the implementation of the fpga button control digital tube display program:

Modulekey_led(clk_50M,key,duan_ma,wei_ma);

inputclk_50M;

Input[3:0]key;//key is the value of the input key code

Output[3:0]wei_ma;

Output[7:0]duan_ma;

Wire[3:0]key;

Reg[7:0]duan_ma;

Reg[3:0]wei_ma;

Reg[3:0]key_temp;//set a register

Always@(posedgeclk_50M)

Begin

Key_temp "=key; / / assign the value of the key code to the register

Case(key_temp)

4'b0111:duan_ma"=8'b1100_0000;// segment code, after pressing the button, the digital tube displays 0

4'b1011:duan_ma"=8'b1001_0000;// segment code, digital tube display 9

4'b1101:duan_ma"=8'b1000_0010;// segment code, digital tube display 6

4'b1110:duan_ma"=8'b1011_0000;// segment code, digital tube display 3

Endcase

End

Always@(posedgeclk_50M)

Begin

Case(key_temp)

4'b0111: wei_ma "= 4'b0111; / / bit selection signal

4'b1011:wei_ma"=4'b1011;

4'b1101:wei_ma"=4'b1101;

4'b1110:wei_ma"=4'b1110;

Endcase

End

Endmodule

Digital tube static display 0-7

Moduleled_0_7(clk,rst,dataout,en);

Inputclk,rst;

Output[7:0]dataout;//The segment code output of the digital tube

Output[7:0]en;//The digital tube's bit selection enable output

Reg[7:0]dataout;//data output of each segment

Reg[7:0]en;

Reg[15:0]cnt_scan;//scan frequency counter

Reg[4:0]dataout_buf;

Always@(posedgeclkornegedgerst)

Begin

If(!rst)begin

Cnt_scan "=0;

End

Elsbegin

Cnt_scan"=cnt_scan+1;

End

End

Composite Terminal Block

The composite terminal is a typical representative of the connector (CONNECTOR), which is composed of a plug (female) and a socket (male) to realize the connection function. For the transfer of voltage, current and signal, this series is characterized by safe, reliable and stable contact, and is mainly used in electric power, communication, industrial control and other industries.

Composite Terminal Block

composite terminal block,component terminal block,composite terminal block adapter

Sichuan Xinlian electronic science and technology Company , https://www.sztmlchs.com