串行LED显示驱动器MAX7219
- 格式:pdf
- 大小:154.71 KB
- 文档页数:3
_______________General DescriptionThe MAX7219/MAX7221 are compact, serial input/out-put common-cathode display drivers that interface microprocessors (µPs) to 7-segment numeric LED dis-plays of up to 8 digits, bar-graph displays, or 64 indi-vidual LEDs. Included on-chip are a BCD code-B decoder, multiplex scan circuitry, segment and digit drivers, and an 8x8 static RAM that stores each digit.Only one external resistor is required to set the seg-ment current for all LEDs. The MAX7221 is compatible with SPI™, QSPI™, and Microwire™, and has slew-rate-limited segment drivers to reduce EMI.A convenient 3-wire serial interface connects to all common µPs. Individual digits may be addressed and updated without rewriting the entire display. The MAX7219/MAX7221 also allow the user to select code-B decoding or no-decode for each digit.The devices include a 150µA low-power shutdown mode, analog and digital brightness control, a scan-limit register that allows the user to display from 1 to 8digits, and a test mode that forces all LEDs on.________________________ApplicationsBar-Graph Displays 7-Segment Displays Industrial Controllers Panel Meters LED Matrix Displays____________________________Featureso 10MHz Serial Interfaceo Individual LED Segment Control o Decode/No-Decode Digit Selectiono 150µA Low-Power Shutdown (Data Retained)o Digital and Analog Brightness Control o Display Blanked on Power-Up o Drive Common-Cathode LED Display o Slew-Rate Limited Segment Drivers for Lower EMI (MAX7221)o SPI, QSPI, Microwire Serial Interface (MAX7221)o 24-Pin DIP and SO PackagesMAX7219/MAX7221Serially Interfaced, 8-Digit LED Display Drivers________________________________________________________________Maxim Integrated Products1________Typical Application Circuit__________________Pin Configuration19-4452; Rev 3; 7/97SPI and QSPI are trademarks of Motorola Inc. Microwire is a trademark of National Semiconductor Corp.For free samples & the latest literature: , or phone 1-800-998-8800.For small orders, phone 408-737-7600 ext. 3468.M A X 7219/M A X 72212_______________________________________________________________________________________ABSOLUTE MAXIMUM RATINGSELECTRICAL CHARACTERISTICS(V+ = 5V ±10%, R SET = 9.53k Ω±1%, T A = T MIN to T MAX , unless otherwise noted.)Stresses beyond those listed under “Absolute Maximum Ratings” may cause permanent damage to the device. These are stress ratings only, and functional operation of the device at these or any other conditions beyond those indicated in the operational sections of the specifications is not implied. Exposure to absolute maximum rating conditions for extended periods may affect device reliability.Voltage (with respect to GND)V+............................................................................-0.3V to 6V DIN, CLK, LOAD, CS ...............................................-0.3V to 6V All Other Pins.............................................-0.3V to (V+ + 0.3V)CurrentDIG0–DIG7 Sink Current................................................500mA SEGA–G, DP Source Current.........................................100mA Continuous Power Dissipation (T A = +85°C)Narrow Plastic DIP..........................................................0.87W Wide SO..........................................................................0.76W Narrow CERDIP.................................................................1.1WOperating Temperature RangesMAX7219C_G/MAX7221C_G ..............................0°C to +70°C MAX7219E_G/MAX7221E_G............................-40°C to +85°C Storage Temperature Range.............................-65°C to +160°C Lead Temperature (soldering, 10sec).............................+300°CMAX7219/MAX7221_______________________________________________________________________________________3ELECTRICAL CHARACTERISTICS (continued)(V+ = 5V ±10%, R SET =9.53k Ω±1%, T A = T MIN to T MAX , unless otherwise noted.)M A X 7219/M A X 72214_________________________________________________________________________________________________________________________________Typical Operating Characteristics(V+ = +5V, T A = +25°C, unless otherwise noted.)730750740770760790780800820810830 4.04.44.85.25.66.0SCAN FREQUENCY vs. POSITIVE SUPPLY VOLTAGEM A X 7219/21 01POSITIVE SUPPLY VOLTAGE (V)S C A N F R E Q U E N C Y (H z )20104030605070012345SEGMENT DRIVER OUTPUT CURRENTvs. OUTPUT VOLTAGEOUTPUT VOLTAGE (V)O U T P U T C U R R E N T (m A )MAX7219SEGMENT OUTPUT CURRENTM A X 7219/21 035µs/div10mA/div0MAXIMUM INTENSITY = 31/32MAX7221SEGMENT OUTPUT CURRENTM A X 7219/21 045µs/div10mA/divMAXIMUM INTENSITY = 15/16MAX7219/MAX7221______________________________________________________________Pin Description_________________________________________________________Functional DiagramM A X 7219/M A X 72216______________________________________________________________________________________________________Detailed DescriptionMAX7219/MAX7221 DifferencesThe MAX7219 and MAX7221 are identical except fortwo parameters: the MAX7221 segment drivers are slew-rate limited to reduce electromagnetic interfer-ence (EMI), and its serial interface is fully SPI compati-ble.Serial-Addressing ModesFor the MAX7219, serial data at DIN, sent in 16-bit packets, is shifted into the internal 16-bit shift register with each rising edge of CLK regardless of the state of LOAD. For the MAX7221, CS must be low to clock data in or out. The data is then latched into either the digit or control registers on the rising edge of LOAD/CS .LOAD/CS must go high concurrently with or after the 16th rising clock edge, but before the next rising clock edge or data will be lost. Data at DIN is propagated through the shift register and appears at DOUT 16.5clock cycles later. Data is clocked out on the falling edge of CLK. Data bits are labeled D0–D15 (Table 1).D8–D11 contain the register address. D0–D7 contain the data, and D12–D15 are “don’t care” bits. The first received is D15, the most significant bit (MSB).Digit and Control RegistersTable 2 lists the 14 addressable digit and control regis-ters. The digit registers are realized with an on-chip,8x8 dual-port SRAM. They are addressed directly so that individual digits can be updated and retain data as long as V+ typically exceeds 2V. The control registers consist of decode mode, display intensity, scan limit (number of scanned digits), shutdown, and display test (all LEDs on).Shutdown ModeWhen the MAX7219 is in shutdown mode, the scan oscil-lator is halted, all segment current sources are pulled to ground, and all digit drivers are pulled to V+, thereby blanking the display. The MAX7221 is identical, except the drivers are high-impedance. Data in the digit and control registers remains unaltered. Shutdown can be used to save power or as an alarm to flash the display by successively entering and leaving shutdown mode. For minimum supply current in shutdown mode, logic inputs should be at ground or V+ (CMOS-logic levels).Typically, it takes less than 250µs for the MAX7219/MAX7221 to leave shutdown mode. The display driver can be programmed while in shutdown mode, and shutdown mode can be overridden by the display-test function.Figure 1. Timing DiagramTable 1. Serial-Data Format (16 Bits)Initial Power-UpOn initial power-up, all control registers are reset, the display is blanked, and the MAX7219/MAX7221 enter shutdown mode. Program the display driver prior to display use. Otherwise, it will initially be set to scan one digit, it will not decode data in the data registers, and the intensity register will be set to its minimum value.Decode-Mode RegisterThe decode-mode register sets BCD code B (0-9, E, H,L, P, and -) or no-decode operation for each digit. Each bit in the register corresponds to one digit. A logic high selects code B decoding while logic low bypasses the decoder. Examples of the decode mode control-regis-ter format are shown in Table 4.When the code B decode mode is used, the decoder looks only at the lower nibble of the data in the digit registers (D3–D0), disregarding bits D4–D6. D7, which sets the decimal point (SEG DP), is independent of the decoder and is positive logic (D7 = 1 turns the decimal point on). Table 5 lists the code B font.When no-decode is selected, data bits D7–D0 corre-spond to the segment lines of the MAX7219/MAX7221.Table 6 shows the one-to-one pairing of each data bit to the appropriate segment line.MAX7219/MAX7221Table 3. Shutdown Register Format (Address (Hex) = XC)Table 4. Decode-Mode Register Examples (Address (Hex) = X9)M A X 7219/M A X 7221Intensity Controland Interdigit BlankingThe MAX7219/MAX7221 allow display brightness to be controlled with an external resistor (R SET ) connected between V+ and ISET. The peak current sourced from the segment drivers is nominally 100 times the current entering ISET. This resistor can either be fixed or vari-able to allow brightness adjustment from the front panel. Its minimum value should be 9.53Ω, which typi-cally sets the segment current at 40mA. Display bright-ness can also be controlled digitally by using the intensity register.Digital control of display brightness is provided by an internal pulse-width modulator, which is controlled by the lower nibble of the intensity register. The modulator scales the average segment current in 16 steps from a maximum of 31/32 down to 1/32 of the peak current set by R SET (15/16 to 1/16 on MAX7221). Table 7 lists the intensity register format. The minimum interdigit blank-ing time is set to 1/32 of a cycle.8_______________________________________________________________________________________Table 5. Code B FontTable 6. No-Decode Mode Data Bits and Corresponding Segment Lines*The decimal point is set by bit D7 = 1Scan-Limit RegisterThe scan-limit register sets how many digits are dis-played, from 1 to 8. They are displayed in a multiplexed manner with a typical display scan rate of 800Hz with 8digits displayed. If fewer digits are displayed, the scan rate is 8f OSC /N, where N is the number of digitsscanned. Since the number of scanned digits affects the display brightness, the scan-limit register should not be used to blank portions of the display (such as leading zero suppression). Table 8 lists the scan-limit register format.MAX7219/MAX7221_______________________________________________________________________________________9Table 7. Intensity Register Format (Address (Hex) = XA)Table 8. Scan-Limit Register Format (Address (Hex) = XB)*See Scan-Limit Register section for application.M A X 7219/M A X 7221If the scan-limit register is set for three digits or less,individual digit drivers will dissipate excessive amounts of power. Consequently, the value of the R SET resistor must be adjusted according to the number of digits dis-played, to limit individual digit driver power dissipation.Table 9 lists the number of digits displayed and the corresponding maximum recommended segment cur-rent when the digit drivers are used.Display-Test RegisterThe display-test register operates in two modes: normal and display test. Display-test mode turns all LEDs on by overriding, but not altering, all controls and digit reg-isters (including the shutdown register). In display-test mode, 8 digits are scanned and the duty cycle is 31/32(15/16 for MAX7221). Table 10 lists the display-test reg-ister format.No-Op RegisterThe no-op register is used when cascading MAX7219s or MAX7221s. Connect all devices’ LOAD/CS inputs together and connect DOUT to DIN on adjacent devices. DOUT is a CMOS logic-level output that easily drives DIN of successively cascaded parts. (Refer to the Serial Addressing Modes section for detailed infor-mation on serial input/output timing.) For example, if four MAX7219s are cascaded, then to write to thefourth chip, sent the desired 16-bit word, followed by three no-op codes (hex XX0X, see Table 2). When LOAD/CS goes high, data is latched in all devices. The first three chips receive no-op commands, and the fourth receives the intended data.__________Applications InformationSupply Bypassing and WiringTo minimize power-supply ripple due to the peak digit driver currents, connect a 10µF electrolytic and a 0.1µF ceramic capacitor between V+ and GND as close to the device as possible. The MAX7219/MAX7221 should be placed in close proximity to the LED display, and connections should be kept as short as possible to minimize the effects of wiring inductance and electro-magnetic interference. Also, both GND pins must be connected to ground.Selecting R SET Resistor andUsing External DriversThe current per segment is approximately 100 times the current in ISET. To select R SET , see Table 11. The MAX7219/MAX7221’s maximum recommended seg-ment current is 40mA. For segment current levels above these levels, external digit drivers will be need-ed. In this application, the MAX7219/MAX7221 serve only as controllers for other high-current drivers or tran-sistors. Therefore, to conserve power, use R SET = 47k Ωwhen using external current sources as segment dri-vers.The example in Figure 2 uses the MAX7219/MAX7221’s segment drivers, a MAX394 single-pole double-throw analog switch, and external transistors to drive 2.3”AND2307SLC common-cathode displays. The 5.6V zener diode has been added in series with the decimal point LED because the decimal point LED forward volt-age is typically 4.2V. For all other segments the LED forward voltage is typically 8V. Since external transis-tors are used to sink current (DIG 0 and DIG 1 are used as logic switches), peak segment currents of 45mA are allowed even though only two digits are displayed. In applications where the MAX7219/MAX7221’s digit dri-vers are used to sink current and fewer than four digits are displayed, Table 9 specifies the maximum allow-able segment current. R SET must be selected accord-ingly (Table 11).Refer to the Power Dissipation section of the Absolute Maximum Ratings to calculate acceptable limits for ambient temperature, segment current, and the LED forward-voltage drop.10______________________________________________________________________________________Table 9. Maximum Segment Current for 1-, 2-, or 3-Digit DisplaysTable 10. Display-Test Register Format (Address (Hex) = XF)Note: The MAX7219/MAX7221 remain in display-test mode (all LEDs on) until the display-test register is reconfigured for normal operation.Computing Power DissipationThe upper limit for power dissipation (PD) for the MAX7219/MAX7221 is determined from the following equation:PD = (V + x 8mA) + (V+ - V LED )(DUTY x I SEG x N)where:V+ = supply voltageDUTY = duty cycle set by intensity register N = number of segments driven (worst case is 8)V LED = LED forward voltageI SEG = segment current set by R SET Dissipation Example:I SEG = 40mA, N = 8, DUTY = 31/32, V LED = 1.8V at 40mA, V+ = 5.25V PD = 5.25V(8mA) + (5.25V - 1.8V)(31/32 x 40mA x 8) = 1.11WThus, for a CERDIP package (θJA = +60°C/W from Table 12), the maximum allowed ambient temperature T A is given by:T J(MAX)= T A + PD x θJA + 150°C = T A +1.11W x60°C/Wwhere T A = +83.4°C.Cascading DriversThe example in Figure 3 drives 16 digits using a 3-wire µP interface. If the number of digits is not a multiple of 8, set both drivers’ scan limits registers to the same number so one display will not appear brighter than the other. For example, if 12 digits are need, use 6 digits per display with both scan-limit registers set for 6 digits so that both displays have a 1/6 duty cycle per digit. If 11 digits are needed, set both scan-limit registers for 6digits and leave one digit driver unconnected. If one display for 6 digits and the other for 5 digits, the sec-ond display will appear brighter because its duty cycle per digit will be 1/5 while the first display’s will be 1/6.Refer to the No-Op Register section for additional infor-mation.MAX7219/MAX7221______________________________________________________________________________________11Table 11. R SET vs. Segment Current and LED Forward VoltageTable 12. Package Thermal Resistance DataM A X 7219/M A X 722112______________________________________________________________________________________Figure 2. MAX7219/MAX7221 Driving 2.3-Inch DisplaysMAX7219/MAX7221______________________________________________________________________________________13Figure 3. Cascading MAX7219/MAX7221s to Drive 16 7-Segment LED DigitsM A X 7219/M A X 722114_______________________________________________________________________________________Ordering Information (continued)___________________Chip TopographySEG FSEG ACLK LOAD OR CS DIG 1DIG 5GNDGNDDIG 7DIG 3DIG 2DIG 60.093"(2.36mm)0.080"(2.03mm)SEG B ISET SEG ESEG DP SEG CSEG G DIG 4DIG 0DIN DOUT SEG DTRANSISTOR COUNT: 5267SUBSTRATE CONNECTED TO GNDMAX7219/MAX7221______________________________________________________________________________________15________________________________________________________Package InformationM A X 7219/M A X 7221___________________________________________Package Information (continued)Maxim cannot assume responsibility for use of any circuitry other than circuitry entirely embodied in a Maxim product. No circuit patent licenses are implied. Maxim reserves the right to change the circuitry and specifications without notice at any time.16____________________Maxim Integrated Products, 120 San Gabriel Drive, Sunnyvale, CA 94086 408-737-7600©1997 Maxim Integrated ProductsPrinted USAis a registered trademark of Maxim Integrated Products.。
MAX7219是MAXIM公司生产的串行输入/输出共阴极数码管显示驱动芯片,一片MAX7219可驱动8个7段(包括小数点共8段)数字LED、LED条线图形显示器、或64个分立的LED发光二级管。
该芯片具有10MHz传输率的三线串行接口可与任何微处理器相连,只需一个外接电阻即可设置所有LED的段电流。
它的操作很简单,MCU只需通过模拟SPI三线接口就可以将相关的指令写入MAX7219的内部指令和数据寄存器,同时它还允许用户选择多种译码方式和译码位。
此外它还支持多片7219串联方式,这样MCU就可以通过3根线(即串行数据线、串行时钟线和芯片选通线)控制更多的数码管显示。
MAX7219的外部引脚分配如图1所示及内部结构如图2所示。
图1 MAX7219的外部引脚分配图2 MAX7219的内部引脚分配各引脚的功能为:DIN:串行数据输入端DOUT:串行数据输出端,用于级连扩展LOAD:装载数据输入CLK:串行时钟输入DIG0~DIG7:8位LED位选线,从共阴极LED中吸入电流SEG A~SEG G DP 7段驱动和小数点驱动ISET:通过一个10k电阻和Vcc相连,设置段电流MAX7219有下列几组寄存器:(如图3)MAX7219内部的寄存器如图3,主要有:译码控制寄存器、亮度控制寄存器、扫描界限寄存器、关断模式寄存器、测试控制寄存器。
编程时只有正确操作这些寄存器,MAX7219才可工作。
图 3 MAX7219内部的相关寄存器分别介绍如下:(1)译码控制寄存器(X9H)如图4所示,MAX7219有两种译码方式:B译码方式和不译码方式。
当选择不译码时,8个数据为分别一一对应7个段和小数点位;B译码方式是BCD译码,直接送数据就可以显示。
实际应用中可以按位设置选择B译码或是不译码方式。
图4 MAX7219的译码控制寄存器(2)扫描界限寄存器(XBH)如图5所示,此寄存器用于设置显示的LED的个数(1~8),比如当设置为0xX4时,LED 0~5显示。
串行L ED显示驱动器M AX7219及其应用胡奕明(空军工程大学工程学院研究生大队 西安 710038)摘 要 阐述了新型显示驱动芯片M A X7219的基本工作原理和软件设计方法。
该芯片功能强大、编程简单、控显可靠,可广泛用于工业控制器等方面的数码显示驱动。
关键词 显示驱动器 串行发送 M A X72191 概 述M A X7219是美国M A X I M公司生产的串行输入 输出共阴极显示驱动器。
该芯片可直接驱动最多8位7段数字L ED显示器,或64个L ED和条形图显示器。
它与微处理器的接口非常简单,仅用3个引脚与微处理器相应端连接即可实现最高10M H z 串行接口。
M A X7219的位选方式独具特色,它允许用户选择多种译码方式译码选位,而且,每个显示位都能个别寻址和刷新,而不需要重写其他的显示位,这使得软件编程十分简单且灵活。
另外,它具有数字和模拟亮度控制以及与M O TOROLA SP I, Q SP I及M A T I ONAL M I CROW I R E串行口相兼容等特点。
2 引脚说明该芯片采用24脚D IP和SO封装,工作电压410~515V,最大功耗111W。
引脚说明见表1。
3 基本工作原理及使用方法M A X7219与8031单片机连接采用三线串行接口,典型应用电路如图1。
对于M A X7219,串行数据是以16位数据包的形式从D in脚串行输入,在CL K的每一个上升沿一位一位地送入芯片内部16位移位寄存器,而不管L out脚的状态如何。
L oad脚必须在第16个CL K上升沿出现的同时或之后,但在下一个CL K上升沿之前变为高电平,否则移入的数据将丢失。
表1 引脚说明引脚号名称功能说明1D in串行数据输入端。
在CL K的上升沿数据被锁入芯片内部16位移位寄存器2,3,5~8,10,11D IG0~D IG78位L ED位选线,从共阴极L ED中吸入电流4,9GND地线(两个GND必须接在一起)12L oad锁入输入的数据。
多功能LED译码显示驱动IC PS7219 1 引言PS7219是由力源公司自行研制、开发的一款新型多功能8位LED显示驱动IC。
接口采用三线SPI方式,用户只需简单修改内部相关的控制或数字RAM,便可很容易地实现多位LED显示。
在性能上PS7219与MAXIM 公司的MAX7219完全兼容,并增加了位闪等功能。
PS7219具有多个级联特性,为大屏幕LED显示提供了方便。
在理论上,只需三根用户I/O口控制线,便可以实现无穷多的LED级联显示。
在实际应用中,已实现了149片PS7219级联,可以控制1192位LED 显示。
2 PS7219特点与引脚说明PS7219的特点:★ 串行接口(16位控制字);★ 8位共阴级LED显示驱动;★ 显示位数1~8,可数字调节;★ 按位进行BCD译码/不译码数字制;★ 16级亮度数字控制;★ 上电LED全熄;★ 提供位闪功能;★ 多个PS7219级联可实现任意多的LED显示;★ 宽24脚双列直插模块封装。
PS7219引脚图如图1所示。
引脚功能说明见表1。
3 PS7219内部结构如图2 所示,PS7219由六部分组成。
图2 PS7219内部组成框图图1 PS7219引脚排列3.1 串行输入缓冲部分主要功能是与外部控制信号接口,将控制命令串行读入,并进行串并转换,供控制器读取。
3.2 控制器是整个IC的核心部分。
它先将输入缓冲部分的控制字读入处理,根据其地址值送到相应的控制RAM或数字RAM,同时将数据送入串行同步输出部分,以便在下一个控制字输入周期,将其串行输出。
3.3 控制RAM数据RAM这两部分一起控制LED译码显示部分,实现不同功能及字符的显示。
控制RAM包括:空操作寄存器,译码模式控制寄存器,亮度控制寄存器,掉电控制寄存器,闪烁控制寄存器,测试控制寄存器和扫描界线寄存器。
数据RAM包括:数据1—8寄存器。
3.4 LED译码显示根据控制RAM和数据RAM的不同值,来实现相应的显示功能。
MAX7219的PROTEUS仿真MAX7219是美国MAXIM(美信)公司生产的串行输入/输出共阴极显示驱动器。
它采用了3线串行接口,传送速率达10M数据,能驱动8位七段数字型LED或条形显示器或64只独立的LED。
MAX7219内置BCD码译码器、多路扫描电路、段和数字驱动器和存储每一位的8*8静态RAM。
能方便的用模拟或数字方法控制段电流的大小,改变显示器的数量;能进入低功耗的关断模式(仅消耗150uA电流,数据保留);能方便地进行级联。
可广泛用于条形图显示、七段显示、工业控制、仪器仪表面板等领域。
而且其最重要的一点是,每个显示位都能个别寻址和刷新,而不需要重写其他的显示位,这使得软件编程十分简单且灵活。
MAX719后缀表示其封装方式和工作温度,如表所示:一. MAX7219的结构和功能1.引脚说明MAX7219的引脚排列如图所示,各引脚功能叙述如下:(1)脚:DIN,串行数据输入。
在CLK的上升沿到来时,数据被移入到内部的16位移位寄存器中。
(2)、(3)、(5)~(8)、(10)、(11)脚:DIG0—DIG7,输入。
8位数字位位选线,从共阴极显示器吸收电流。
(4)、(9)脚:GND,地。
两个引脚必须连接在一起。
(12)脚:LOAD,数据装载输入端。
在LOAD上升沿,移位寄存器接受的数据被锁存。
(13)脚:CLK,时钟输入端,最高时钟频率10MHz。
在CLK的上升沿,数据被移入到内部的16位移位寄存器中。
在CLK的下降沿,数据从DOUT脚输出。
(14)~(15)、(20)~(23)脚:输出。
七段驱动器和小数点驱动器。
它供给显示器电流。
(18)脚:ISET,电流调节端。
通过一个电阻和VCC相连,来调节最大段电流。
(19)脚:VCC。
电源输入端。
(24)脚:DOUT。
串行数据输出。
输入到DIN的数据在16.5各时钟周期后,在DOUT端有效。
该脚常用于几个MAX7219的级联。
2.串行数据传送的说明MAX7219采用串行寻址方式,在传送的串行数据中包含内部RAM的地址。
摘要:介绍8位串行LED显示驱动 ̄MAX7219的特性,并给出了单片机系统中MAX7219与MCS--51的硬件接口设计,以及相应的软件流程图和编程实现。
关键词:MAX721;单片机;显示电路单片机系统通常需要有LED对系统的状态进行观测,而很多工业控制用单片机FIMCS51系列本身并无显示接口部分,需要外接显示的译码驱动电路。
在MCS51单片机的控制系统中,采用MAxIM公司的MAX7219构成显示接口电路,仅需使用单片机3个引脚,即可实现对8位LED数码管的显示控制和驱动,线路简单,控制方便。
1MAx7219与单片机的连接MAX7219与MCS一51单片机连接时可根据具体的系统要求和系统资源占用情况选用2种驱动方式:串行口移位驱动MAX7219或I/0口模拟三线协议时序驱动MAX7219。
通常单片机系统的串口要用作其他用途,比如和上位机联机通信等。
故本系统利用单片机的I/O口来模拟MAX7219的时序,应用电路如图1所示。
其中,P2.0作串行数据输出,连接 ̄IDIN端,P2.1和P2.2连扫描电路选通某字时,相引脚DIG×为低电平。
显示接至CLK和LOAD,通过程序分别模拟MAX7219的时钟数据串行输入MAX7219,移位存入数字寄存器,片内多脉CLK及数据加载LOAD信号。
ISET管脚接l0kQ电阻路扫描电路顺序扫描,分时选通各字,被选通字的引脚用于限定峰值段电流。
置为低电平,LED发光显示数字,未选通的字引脚保持本系统的设计中,只需要5个LED,所以DIG5~DIG7高电平。
未用悬空。
显示电路中,所有LED显示器的同名段(a~f,系统设计中,应用MAX7219芯片时需要注意如下dp)连接在一起并与MAX7219的同名段引脚(SA~SG,几个关键问题:SDP)H连,各LED显示器的共阴极分别与MAX721的相(1)3根信号线。
应字引脚(DIG0一DIG4)相连,以实现位选,当MAX7219在强干扰环境中,如大功率电机的启停或高压发生过程中,干扰源可能通过供电电源或3根信号线串入显示电路,造成显示器的不稳定,从而出现段闪烁、显示不全、甚至全暗或全亮的现象。
MAX7219工作原理简介MAX7219是一个采用3线串行接口的8位共阴极7段LED显示驱动器。
本文分析了MAX7219各个寄存器的功能,并结合MAX7219的工作时序,给出了MAX7219在Motorola MC68HC908单片机系统中的一个应用实例。
关键词: MCU;MAX7219;LED Motorola MC68HC908MAX7219工作时序及其寄存器MAX7219是一个高性能的多位LED显示驱动器,可同时驱动8位共阴极LED或64个独立的LED。
其内部结构框图如图1所示,主要包括移位寄存器、控制寄存器、译码器、数位与段驱动器以及亮度调节和多路扫描电路等。
MAX7219 采用串行接口方式,只需LOAD、DIN、CLK三个管脚便可实现数据传送。
DIN管脚上的16位串行数据包不受LOAD状态的影响,在每个CLK的上升沿被移入到内部16位移位寄存器中。
然后,在LOAD的上升沿数据被锁存到数字或控制寄存器中。
LOAD必须在第16个时钟上降沿或之后,但在下一个时钟上升沿之前变高,否则数据将会丢失。
DIN端的数据通过移位寄存器传送,并在16.5个时钟周期后出现在DOUT端,随CLK 的下降沿输出。
MAX7219的操作时序如图2所示。
MAX7219的串行数据标记为D15~D0,其中低8位表示显示数据本身,最高的4位D15~D12未使用,寻址内部寄存器的地址位占用D11~D8,选择14个内部寄存器,见表1。
图1 MAX7219内部结构框图图2 MAX7219的数据传送时序MAX7219 内部具有14个可寻址数字和控制寄存器。
其中的8个数字寄存器由一个片内8×8双端口SRAM实现。
它们可直接寻址,因此可对单个数进行更新并且通常只要 V+超过2V数据就可保留下去。
除8个数位寄存器之外,还有无操作、译码方式、亮度调整、扫描位数、睡眠模式和显示器测试6个控制寄存器。
无操作寄存器用于多片MAX7219级联,在不改变显示或不影响任意控制寄存器条件下,它允许数据从DIN传送到DOUT。
在强干扰环境下,如大功率电机的起停或高压发生过程中,干扰源可能通过供电电源或3根信号线串入显示电路而造成显示器的不稳定,从而出现笔段跳跃、显示不全、甚至全暗或全亮的现象.4.对显示电路单独供电,并在Max7219的电源V+和GND之间接并接一个0.1uF去耦电容和一个10uF/16V电解电容,以有效提高其工作可靠性。
5. 在硬件上采用TVS管吸收瞬态功率,采用磁珠消除高频脉冲;在软件上采用不断刷新显示缓冲区的办法来保证显示的正确性,实际使用效果明显。
max7219(级联)显示问题悬赏分:0 |解决时间:2008-10-2 22:46 |提问者:sangfuhuan我用了两个max7219(级联),即显示4个四位,但是,显示一会其中一对就开始灭了,或是其中一对出现乱码,好像是随机的,只是灭的时间!难道说级联要注意什么吗?还是---?谢谢!问题补充:你好!我还想问你关于7219的问题,真是麻烦你了!你说的加电容我已经加过了,但是你说的CLK,LOAD引脚窜入了干扰信号是啥意思呢?“加入抗干扰的驱动程序,定期重新配置7219 ”是啥意思呢?就是定期重新配置7219吗?还有就是当我加了电容后小郭很明显!基本都好了,就是最近一上电一会就开始灭了,我怀疑是不是7219模块又问了?还是7219有问题了?你有什么意见呢?还有就是级联的时候,在程序中,在分别给凉快传数据时需要延时吗?在手册里说是“串行数据输出端口,从DIN 输入的数据在16.5 个时钟周期后在此端有效”是什么意思呢?非常感谢你!!!我以前项目中用过4个max7219级联,用得比较稳定。
你这个现象是因为CLK,LOAD引脚窜入了干扰信号,而7219是边沿触发,容易受到干扰。
解决方法:1、可以在靠近7219芯片的地方,给CLK,DIN加101 - 104的滤波电容,效果比较明显。
2、在程序中,加入抗干扰的驱动程序,定期重新配置72193、可以选用完全兼容的max7221代替。
MAX7219驱动单个88点阵LED模块模块介绍MAX7219 是一种集成化的串行输入/输出共阴极显示驱动器,它连接微处理器与8位数字的7段数字LED显示,也可以连接条线图显示器或者64个独立的LED。
其上包括一个片上的B型BCD编码器、多路扫描回路,段字驱动器,而且还有一个8*8的静态RAM用来存储每一个数据。
只有一个外部寄存器用来设置各个LED的段电流。
一个方便的四线串行接口可以联接通用的微处理器。
每个数据可以寻址在更新时不需要改写所有的显示。
MAX7219同样允许用户对每一个数据选择编码或者不编码。
整个设备包含一个150μA的低功耗关闭模式,模拟和数字亮度控制,一个扫描限制寄存器允许用户显示1-8位数据,还有一个让所有LED发光的检测模式。
只需要3个IO口即可驱动1个点阵!点阵显示时无闪烁!支持级联!模块参数:1.单个模块可以驱动一个8*8共阴点阵2.模块工作电压:5V3.模块尺寸:长3.2厘米X宽3.2厘米X高1.3厘米4.带4个固定螺丝孔,孔径3mm5.模块带输入输出接口,支持多个模块级联接线说明:1.模块左边为输入端口,右边为输出端口。
2.控制单个模块时,只需要将输入端口接到CPU3.多个模块级联时,第1个模块的输入端接CPU,输出端接第2个模块的输入端,第2个模块的输出端接第3个模块的输入端,以此类推...器件列表◆Keywish Arduino Uno R3 主板*1◆USB 接口线*2◆MAX7219显示驱动器*1◆8位数字的7段数字LED显示*1◆跳线*4接线Arduino MAX7219显示驱动器VCC VCCGND GND5 CLK6 CS7 DIN程序#include "LedControl.h"int DIN =7;int CS =6;int CLK =5;byte e[8]={0x7C,0x7C,0x60,0x7C,0x7C,0x60,0x7C,0x7C};byte d[8]={0x78,0x7C,0x66,0x66,0x66,0x66,0x7C,0x78};byte u[8]={0x66,0x66,0x66,0x66,0x66,0x66,0x7E,0x7E};byte c[8]={0x7E,0x7E,0x60,0x60,0x60,0x60,0x7E,0x7E};byte eight[8]={0x7E,0x7E,0x66,0x7E,0x7E,0x66,0x7E,0x7E};byte s[8]={0x7E,0x7C,0x60,0x7C,0x3E,0x06,0x3E,0x7E};byte dot[8]={0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18};byte o[8]={0x7E,0x7E,0x66,0x66,0x66,0x66,0x7E,0x7E};byte m[8]={0xE7,0xFF,0xFF,0xDB,0xDB,0xDB,0xC3,0xC3};LedControl lc=LedControl(DIN,CLK,CS,0);void setup(){lc.shutdown(0,false);//The MAX72XX is in power-saving mode on startup lc.setIntensity(0,15);// Set the brightness to maximum valuelc.clearDisplay(0);// and clear the display}void loop(){byte smile[8]={0x3C,0x42,0xA5,0x81,0xA5,0x99,0x42,0x3C};byte neutral[8]={0x3C,0x42,0xA5,0x81,0xBD,0x81,0x42,0x3C};byte frown[8]={0x3C,0x42,0xA5,0x81,0x99,0xA5,0x42,0x3C};printByte(smile);delay(1000);printByte(neutral);delay(1000);printByte(frown);delay(1000);printEduc8s();lc.clearDisplay(0);delay(1000);}void printEduc8s(){printByte(e);delay(1000);printByte(d);delay(1000);printByte(u);delay(1000);printByte(c);delay(1000);printByte(eight);delay(1000);printByte(s);delay(1000);printByte(dot);delay(1000);printByte(c);delay(1000);printByte(o);delay(1000);printByte(m);delay(1000);}void printByte(byte character []) {int i =0;for(i=0;i<8;i++){lc.setRow(0,i,character[i]); }}实验结果。
MAX7219数码管驱动芯片问题及解决方案
MAX7219在华强赛格买到的大多是国内抄片的,抗干扰能力很差(原装的我没用过,应该抗干扰能力也好不到哪里去)。
常见的问题是开机上电时,LED数码所有段位全部点亮,芯片处于锁死的状态,无论怎么重新载入数据都无法恢复。
使用绕线变压器作为电源的时候,这种开机锁死的情况较少,概率1%~10%,使用小功率开关电源时,开机锁死的情况较多,30%~60%,使用大功率开关电源时,开机锁死的情况在80%以上分析其中的原因是开机瞬间,电路中出现较多的紊乱信号,而MAX7219的引脚输入阻抗比较大,容易收到这些信号的影响,而且MAX7219内部电路在输入过载的情况下会出现类似运放阻塞的问题。
解决方法是在MAX7219的Load引脚处接一个10K的电阻到地线,这样开机时的紊乱信号就不能在Load引脚处产生足够大的电压。
在我的实际使用中,这种方法能够100%解决绕线变压器电源和小功率开关电源的影响。
但是当整机中有使用100W的大功率开关电源,则在Load引脚处接电阻,即使接1K电阻,也不能保证100%安全。
这时,我采用的方法是单独为Max7219电路做一个软启动电源电路,只需要用一个Mosfet管,一个10K电阻和100uF电容就可以让Max7219在整机上电约100ms后才上电,实际测试,这种方案也是100%成功的。
给Max7219芯片加旁路电容或者在load引脚处加电容,都被证明是无用的。