Control method for controlling bipolar LED lamp by using max7219

文档序号:1493037 发布日期:2020-02-04 浏览:5次 中文

阅读说明:本技术 一种使用max7219控制双极性LED灯的控制方法 (Control method for controlling bipolar LED lamp by using max7219 ) 是由 闫锡桐 朱爱微 姜博畅 徐鹏 李培建 于 2019-11-15 设计创作,主要内容包括:本发明公开了一种使用max7219控制双极性LED灯的控制方法,单片机通过SPI(DSPIN/DSPCS/DSPCK)对max7219进行控制;max7219与数码管相连接的片选引脚始终置于低电平;max7219按照时序对数码管每个LED的SEG在相应的时隙进行控制;SEG要亮,则该SEG在相应时隙为高电平;SEG要灭,则该SEG相应时隙为低电平。通过本发明,既可实现单片机通过三个引脚对数量众多的双极性LED的控制,同时利用max7219可以级联的功能,可以实现更多双极性LED的控制,控制既简单又高效。(The invention discloses a control method for controlling a bipolar LED lamp by using max7219, wherein a singlechip controls max7219 through SPI (DSPIN/DSPCS/DSPCK); the chip selection pin connected with the max7219 nixie tube is always at a low level; max7219 controlling SEG of each LED of the nixie tube in corresponding time slot according to the time sequence; if the SEG needs to be on, the SEG is at a high level in the corresponding time slot; and if the SEG is going to be extinguished, the corresponding time slot of the SEG is low. By the invention, the control of a singlechip on a plurality of bipolar LEDs through three pins can be realized, and the cascade function of max7219 can be utilized to realize the control of more bipolar LEDs, so that the control is simple and efficient.)

1. A control method for controlling a bipolar LED lamp using max7219, comprising:

s1, the single chip microcomputer controls max7219 through SPI (DSPIN/DSPCS/DSPCK);

s2, max7219 chip selection pins connected with the nixie tube are always set at a low level;

s3 and max7219 control SEG of each LED of the nixie tube in corresponding time slot according to time sequence; if the SEG needs to be on, the SEG is at a high level in the corresponding time slot; and if the SEG is going to be extinguished, the corresponding time slot of the SEG is low.

2. The method for controlling the bipolar LED lamp by using the max7219 of claim 1, wherein in the step S2, a chip selection pin of the max7219 is empty.

3. The control method for controlling the bipolar LED lamp by using the max7219 as claimed in claim 2, wherein a chip selection pin of the nixie tube is forcibly grounded.

4. The method for controlling the bipolar LED lamp by using the max7219 according to claim 1, wherein in the method, the max7219 controls a plurality of nixie tubes or LED lamps by using time division and continuity of LED brightness.

5. The control method for controlling the bipolar LED lamp by using the max7219 according to claim 4, wherein a chip selection pin of the max7219 is empty, and chip selection pins of the plurality of nixie tubes or the LED lamp are forcibly grounded.

Technical Field

The invention belongs to the field of LED drive control, and particularly relates to a control method for controlling a bipolar LED lamp by using max 7219.

Background

If a single chip microcomputer is needed to control a plurality of LED lamps (the number of the lamps is far larger than the number of pins of the single chip microcomputer), a max7219 controller can be used. By using the controller, the control of a plurality of max7219 can be realized by only occupying 3 pins of the singlechip, and each max7219 can control up to 64 LEDs. This control method has very wide application.

max7219 control principle As shown in FIG. 1, X1-X8 are chip selection signals of 8 nixie tubes, A-G and DP are control signals of each LED in the nixie tubes. The single chip microcomputer controls max7219 through SPI (DSPIN/DSPCS/DSPCK), and max7219 is converted into control over each section of nixie tube through internal calculation. Finally, the time division and the continuity of the LED brightness are utilized to realize the control of a plurality of nixie tubes or LED lamps.

max7219 controls multiple LED lamps by common cathode, i.e. A-G and DP have the same cathode (chip select). If a certain segment of a certain nixie tube is controlled to be on, a chip selection signal (one of X1-X8) of the nixie tube becomes low level in a corresponding time slot, and a corresponding SEG (namely one of A-G) is high level; if the segment is controlled to go out, the chip select signal goes high in the corresponding time slot and the corresponding SEG goes low. For example, if segment a of HL1 in fig. 1 is controlled to be bright, max7219 sets X1 low and a high in the corresponding time slot of a, so that segment a is bright by using the forward voltage difference; when control A goes out, max7219 will set X1 high and A low at the corresponding time slot of A, thus using the reverse pressure difference to realize section A going out.

However, some current LED lamps, especially those provided in the key, are bipolar, that is, the LED can be turned on regardless of the forward voltage difference or the reverse voltage difference. The LED is turned off only when the two pins of the LED have no voltage difference. Since max7219 is to control the on and off of the LED by using the forward and reverse voltage difference, max7219 cannot control the bipolar LED lamp normally.

Disclosure of Invention

The invention provides a control method for controlling a bipolar LED lamp by using max7219, which can enable the max7219 to control the on and off of the bipolar LED lamp.

In order to achieve the purpose, the technical scheme of the invention is realized as follows:

a control method for controlling a bipolar LED lamp using max7219, comprising:

s1, the single chip microcomputer controls max7219 through SPI (DSPIN/DSPCS/DSPCK);

s2, max7219 chip selection pins connected with the nixie tube are always set at a low level;

s3 and max7219 control SEG of each LED of the nixie tube in corresponding time slot according to time sequence; if the SEG needs to be on, the SEG is at a high level in the corresponding time slot; and if the SEG is going to be extinguished, the corresponding time slot of the SEG is low.

Further, in step S2, the chip select pin of max7219 is set to null.

Furthermore, the chip selection pin of the nixie tube is forced to be grounded.

Further, in the method, max7219 controls a plurality of nixie tubes or LED lamps by using time division and continuity of LED brightness.

Furthermore, the chip selection pin of the max7219 is empty, and the chip selection pins of the nixie tubes or the LED lamps are forcibly grounded.

Compared with the prior art, the invention has the following beneficial effects:

by the invention, the control of a singlechip on a plurality of bipolar LEDs through three pins can be realized, and the cascade function of max7219 can be utilized to realize the control of more bipolar LEDs, so that the control is simple and efficient.

Drawings

FIG. 1 is a schematic diagram of a prior art max7219 control architecture;

fig. 2 is a schematic diagram of a max7219 control structure according to an embodiment of the present invention.

Detailed Description

It should be noted that the embodiments and features of the embodiments may be combined with each other without conflict.

In the description of the present invention, it should be noted that, unless otherwise explicitly specified or limited, the terms "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meaning of the above terms in the present invention can be understood by those of ordinary skill in the art through specific situations.

In the embodiment of the invention, a max7219 controller is used for the bipolar LED lamp, as shown in FIG. 2, X1-X8 are chip selection signals of 8 nixie tubes, and A-G and DP are control signals of each LED in the nixie tubes. The single chip microcomputer controls max7219 through SPI (DSPIN/DSPCS/DSPCK), and 7219 is converted into control of each section of nixie tube through internal calculation. Finally, the time division and the continuity of the LED brightness are utilized to realize the control of a plurality of nixie tubes or LED lamps.

In order to control the on and off of the bipolar LED lamp by using the max7219, when the circuit board is designed, the chip selection pin at the max7219 end is arranged to be empty, and meanwhile, the chip selection pin at the digital tube end is forcibly grounded, as shown in FIG. 2, the chip selection pins X1, X2 and X3 of HL1, HL2, HL3 and the like are grounded.

The working principle is as follows: max7219 still controls each SEG in the corresponding time slot according to the previous timing, and the only difference is that the output chip select signal is not given to the digital chip. And the SEG of the digital tube end is controlled by max7219 in the corresponding time slot, if a certain SEG is to be on, the SEG is at high level in the corresponding time slot, and if the SEG is to be off, the SEG is at low level in the corresponding time slot. However, the chip select pin X is kept low all the time due to the forced grounding. Thus, if a certain SEG is high, a forward voltage difference is formed between the SEG and the chip select pin X, and if a certain SEG is low, a voltage difference is not formed between the SEG and the chip select pin. Thus, control over the bipolar LED can be realized.

The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

5页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:计算机微处理器同步输出背光特效的系统及方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!