MAX7219中文资料
MAX7219中文资料
_______________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.。
串行LED显示驱动器MAX7219及其应用
串行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锁入输入的数据。
MAX7219
多功能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的不同值,来实现相应的显示功能。
MCU常用外设介绍
常用外设介绍MAX7219 串行接口 8位数字静态显示芯片PinConfigurationNoDecode Mode Data Bits andCorresponding Segment LinesPin DescriptionSerialData Format (16 Bits)Timing DiagramRegister Address MapDisplayTest Register Format(Address (Hex) = XF)DecodeMode Register Examples (Address (Hex) = X9)Shutdown Register Format (Address (Hex) = XC)Code B FontIntensity Register Format (Address (Hex) = XA)MAX7219是一种串行接口的8位数字静态显示芯片。
它是MAXIM 公司 推出的24脚双列直插式芯片。
SEGASEGG 和 SEGDP 为LED 七段驱动器线 和小数点线,供给显示器源电流;DIG0DIG7 为 8 位数字驱动线,输出位选 信号,从每位LED 共阴极吸入电流。
DIN 是串行数据输入端,在 CLK 的上升沿,一位数据被加载到内部 16 位移位寄存器中, CLK 的最高输入频率可达10MHz , 典型值为1300Hz ;LOAD 用来装载数据,在LOAD 的上升沿,16位串行输入数据被锁存到数据寄存器 中,LOAD 必须在第16个时钟上升沿之后、在下一个时钟上升沿之前拉高来 所存数据,否则数据将丢失。
当MAX7219处于关闭状态(SHUTDOWN )时,仍可以对其传送数据或 修改状态字,其耗电仅为 150uA 。
在工作状态还可进行亮度调整,MAX7219 共有16种亮度。
还可以将两个MAX7219连在一起, 控制多于8个LED 。
max7219使用详解介绍
D15~12 以 X 表示,代表可为 0,也可为 1。 Digit0~7 对应到 8 个数码管的地址。 Decode Mode:解码模式寄存器,其地址用 16 迚制表示为 0x09; Intensity:亮度调节寄存器,其地址用 16 迚制表示为 0x0A; Scan Limit:扫描范围寄存器,其地址用 16 迚制表示为 0x0B; Shutdown:省电模式,其地址用 16 迚制表示为 0x0C; Display Test:测试寄存器,其地址用 16 迚制表示为 0x0F;
这个图由三部分组成:
第一部分:是要显示的数据 第二部分:是要发送的数据 D7~D0 第三部分:是数码管的八个段,分别用 DP*,A,B,C,D,E,F,G(DP*表示小数点)
D7 来控制小数点的显示 在弄清这个图之前,我们有必要了解数码管的构造。 下面是数码管的构造图:
数码管有八个段(DP,A,B,C,D,E,F,G)每个段都有一个电路来驱动它, 当你要显示"0",就让 A,B,C,D,E,F 亮,让 G 灭。 当你要显示"1",就让 B,C 亮,让 A,D,E,F,G 灭。 其他的就丌用多说了。 我们再回过头去看 Code B Font 图, 当我们想让数码管显示"0",就向数据位 D3~D0 赋值"0000",那么 MAX7219 就会让 A,B,C,D,E NhomakorabeaF 亮,
max7219数据手册
_______________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.。
max7129 使用方法
(一)、MAX7219 MAX7219是一种串入、并出的共阴极LED数码管显示驱动器,每片可驱动8位LED数码管显示,与单片机的接口只需3根线,内带BCD译码器,及显示测试、移位、锁存器等,输出电流达40mA,外围只需一只亮度调整电阻。
MAX7219引脚图1、引脚功能说明DIN:串行数据输入端,CLK的上升沿时数据被载入内部16位移位寄存器中CLK:串行时钟输入端,最高工作频率可达10MHz LOAD:片选端,低电平接收DIN端的数据,高电平时数据被所存DIG0~7:LED的位控制端A~DP:LED 的端控制端DOUT:串行数据输出端,用于芯片的级联ISET:硬件亮度调整端,在该引脚与VCC之间跨接一个电阻,LED的亮度即可通过该电阻来调节,流过LED的段驱动平均电流为流过此电阻电流的100倍,此电阻值范围为:10~80K之间。
2、内部寄存器说明A、译码方式选择寄存器地址:09H 赋值:FFH 表示使用MAX7219内部的BCD译码器00H 表示不使用MAX7219内部的BCD译码器B、亮度调节寄存器地址:0AH 赋值:00H~0FH 可改变MAX7219所驱动的LED的亮度,其变化范围在1/32~31/32之间C、扫描位数设定寄存器地址:0BH 赋值:00H 所有位不显示01H~07H 依次对应于1~8位及前面位全部显示(即需显示的位应为“1”)D、待机模式开关寄存器地址:0CH 赋值:00H LED全灭01H LED正常显示E、显示器测试寄存器地址:0FH 赋值:00H LED为正常显示状态01H LED测试状态,即LED全亮F、8位LED显示数据寄存器地址:01H~08H 对这些寄存器赋值(即需显示的内容),就会在对应的1~8位LED数码管上显示出来3、使用注意事项由于电源中杂波或附近的电磁等干扰信号,使MAX7219在上电后不显示或乱显示;为了消除这种现象应在MAX7219的VCC端与地之间接一只104pf的瓷片电容,在LOAD端于地之间接一只10K的电阻。
8位串行接口数码显示驱动器MAX7219及其应用
8位串行接口数码显示驱动器MAX7219及其应用潍坊高等专科学校 王瑞兰LED数码管的应用已十分广泛,用于数码管显示的驱动电路种类较多,但大致可分为静态显示驱动和动态扫描显示驱动两大类别。
本文所要介绍的MAX7219芯片就是 用于动态扫描显示驱动的芯片。
该芯片的特点是利用一块芯片就能完成8位字数据和8位线数据的驱动,使得电路紧凑。
多芯片级联时,采用串行输入输出,可节省CPU的口线和接口芯片。
与数码管联接时无需限流电阻,8位显示的电流可通过一个外部电阻进行调节。
显示亮度也可通过程序进行控制。
片内具有,可以对输入的数据先进行译码再驱动输出,也可以将输入的数据直接驱动。
一、管脚功能MAX7219采用24管脚DIP和SO两种封装形式,管脚排列如图1所示,各引脚功能见表1。
二、MAX7219内部结构MAX7219的内部功能框图如图2所示。
16位移位寄存器所存数据为D0~D15,见表2。
D8~D11为寄存器地址,D0-D7为数据,D12-D15为不关心位。
片内有14个寄存器,其中8个数据寄存器,寄存着与DIG 0-DIG 7对应的显示数据,地址依次为×1H-8H;6个控制寄存器,即译码控制寄存器(Decode Mode)、显示亮度控制寄存器(Intensity)、扫描频率限制寄存器(Scan Limit)、消隐控制寄存器(Shutdown)、显示测试寄存器Display Test)及无操作寄存器(No-Op),其地址依次为×9H-CH、×FH、×0H。
数据寄存器为8×8双指针SRAM。
因为各寄存器可直接寻址,所以寄存器的数据可分别进行修改。
寄存器的数据可以保存到电源电压降低到2V。
三、控制寄存器1. Shutdown 寄存器Shutdown 寄存器写入×××××××0B数据时,将呈现消隐状态。
max7219中文资料
max7219中文资料1、MAX7219介绍MAX7219是一种高集成化的串行输入/输出共阴极显示驱动器,可实现微处理器与7段码的接口,可以显示8位或64位单一LED。
芯片上包括BCD码译码器、多位扫描电路、段驱动器、位驱动器、内含8&TImes;8位静态RAM,用于存放显示数据。
只需外接一个电阻就可为所有的LED提供段电流。
MAX7219的三线串行接口适用于所有微处理器,单一位数据可被寻址和修正,无需重写整个显示器。
MAX7219具有软件译码和硬件译码两种功能,软件译码是根据各段笔划与数据位的对应关系进行编码,硬件译码采用BCD码(简称B码)译码。
MAX7219工作模式包括150μA低压电源关闭模式、模拟数字亮度控制、限扫寄存器(允许用户从第1位数字显示到第8位)及测试模式(点亮所有LED)。
2、MAX7219引脚功能MAX1279引脚排列如图1所示,图1 MAX1279引脚排列图引脚功能:DIN:串行数据输入端。
当CLK为上升沿时,数据存入内部的16位寄存器DOUT:串行数据输出端,用于级连扩展LOAD:装载数据输入,在装载的上升沿,串行输入的最后一个16位数据被锁存。
CLK:串行时钟输入,其最大工作频率可达10MHz。
时钟上升沿是数据输入,时钟下降时数据从串行数据输出口输出DIG0~DIG7:8位LED位选线,从共阴极LED中吸入电流SEGA~SEGGDP7段驱动和小数点驱动ISET:通过一个10k电阻和Vcc相连,设置段电流GND:地线V+:电源3、MAX7219的功能框图图2 MAX7219的功能框图串行输入数据在时钟上升沿时移入内部的16位移位寄存器,在装载的上升沿时数据被锁存在每一位或寄存器中。
装载信号必须在第16个时钟上升沿发生时或之后达到高电平,但要在下一个时钟的上升沿和数据丢失之前到达。
串行输入数据通过移位寄存器传输,在以后数据输出的16.5个时钟循环出现,数据在时钟的下降沿记录下来。
MEMORY存储芯片MAX7219CWG中文规格书
rupt, the host (Bus Master) interrogates the bus slave devices via a special receive-byte operation that includes the alert response address. The data returned by this receive-byte operation is the address of the offending slave device. The interrupt pointer address can activate several different slave devices simultane-ously. If more than one slave attempts to respond, bus arbitration rules apply, with the lowest address code going first. The other device(s) will not generate an acknowledge and will continue to hold the ALERT line low or repeat the START-STOP interrupt until serviced.Clearing Interrupts via Alert ResponseWhen a fault occurs, ALERT asserts and latches low. Ifthe fault is momentary and disappears before the device is serviced, ALERT remains asserted. Normally,the master sends out the Alert Response address fol-lowed by a read bit (00011001). ALERT clears whenthe device responds by successfully putting its address on the bus. Reading the Alert Response address is the only method for clearing hardwareand software interrupt latches.Clearing the interrupthas no effect on the state of the status registers. MAX1661/MAX1662/MAX1663Serial-to-Parallel/Parallel-to-Serial Converters and Load-Switch Controllers with SMBus InterfaceFigure 3. SMB Serial-Interface Timing—Acknowledge and Data ValidFigure 4. I/O Read Timing DiagramM A X 1661/M A X 1662/M A X 1663START-STOP Software Interrupt The START-STOP interrupt is a method for the slave device to initiate a signal over the 2-wire interface with-out the need for a third (interrupt) wire. A START-STOP interrupt is a start condition followed by a stop condi-tion; in other words, SMBDATA goes low and then high with SMBCLK high (Figure 5 shows the START-STOP interrupt and a subsequent Alert Response transmis-sion used to clear the interrupt). The START-STOPfunction can be disabled (masked) by setting the dataregister mask SS (bit 6) high.In order to avoid bus collisions, the START-STOP inter-rupt will not occur when the bus is busy. If the devicebegins a start condition simultaneously with anothertransmitter on the bus, it recognizes the falling SMB-CLK as a collision and re-transmits the interrupt whenthe bus becomes available. Upon thermal shutdown ora transition on an I/O line, the device issues only oneSTART-STOP interrupt, and won’t repeat it unless therehas been a collision. However, thermal-shutdown faults,not being edge triggered, may result in a continuousstream of START-STOP bits.Input/Output PinsEach input/output (I/O) is protected by an internal20mA (typical) current-limit circuit. The I/O current limitdepends on the supply voltage and the voltage appliedto the I/O pins (see Typical Operating Characteristics ).The typical I/O bias current is 0.5µA to V I/O_= 28V.The ability of the I/Os to sink current depends on V CC as well as the voltage on the I/O. Typical pull-down on-resistance at V CC = 2.7V and 5.5V is 106Ωand 66Ω,respectively. I/O source and sink capability can affectthe rise and fall times of external power MOSFETs com-monly used in power-switching applications. Other fac-tors include the V GS , the input capacitance of the MOS-FET, and the pull-up resistor value used in the circuit.Typical MOSFET gate capacitance ranges from 150pF to 2000pF. Increasing the RC time constant slows down the MOSFET’s response, but provides for a smoother transition.Power-On Reset The power-on reset circuit keeps the external MOSFETs off during a power-up sequence. When the supply volt-age falls below the power-on reset threshold voltage,the MAX1662/MAX1663’s outputs reset to a high-impedance state, and the MAX1661’s outputs reset to a low state. During the initial power-up sequence, as V CC increases, the ALERT pin goes low and then high,which indicates the device is powered on. The time between the low and high state on ALERT is the power-on delay time. Below V CC = 0.8V (typical) the POR states can’t be enforced, and the I/O pins of all ver-sions exhibit increasingly weak pull-down current capa-bility, eventually becoming high impedance.Thermal Shutdown These devices have internal thermal-shutdown circuitry that turns off all output stages (I/O pins) when the junc-tion temperature exceeds +140°C typical. Thermal shutdown only occurs during an overload condition on the I/O pins. The device cycles between thermal shut-down and the overcurrent condition until the overload condition is removed. This could cause a sustained START-STOP interrupt and, in the extreme case, tie up the master controller. However, the device asserts ALERT low, indicating this fault status.Serial-to-Parallel/Parallel-to-Serial Converters and Load-Switch Controllers with SMBus InterfaceFigure 5. START-STOP Software Interrupt Timing Diagram and Alert Response。
AVR外设汇总之MAX7219数码管
1.MAX7219数码管//用于判断是否可以载入数据,初始化为低电平,上升沿时锁定,不再可以载入数据#define MAX7219_LOAD_0{DDRA|=_BV(PA1);PORTA&=~_BV(PA1);}//将PA1位置零#define MAX7219_LOAD_1{DDRA|=_BV(PA1);PORTA|=_BV(PA1);}//时钟初始化为低电平,上升沿时读入数据,下降沿无操作#define MAX7219_CLK_0{DDRA|=_BV(PA2);PORTA&=~_BV(PA2);}#define MAX7219_CLK_1{DDRA|=_BV(PA2);PORTA|=_BV(PA2);}//读入的数据存入此寄存器中#define MAX7219_DIN_0{DDRA|=_BV(PA0);PORTA&=~_BV(PA0);}#define MAX7219_DIN_1{DDRA|=_BV(PA0);PORTA|=_BV(PA0);}//向7219发送地址和数据或控制void Write7219(unsigned char addr,unsigned char data){unsigned char i=0;//初始化LOAD端口为低电平MAX7219_LOAD_0;//初始化时钟CLK端口为低电平MAX7219_CLK_0;//解析8位地址(其中低四位为有效地址位),写入DIN寄存器中for(i=0;i<8;i++){//解析地址从高位开始if(addr&0x80){MAX7219_DIN_1;}else{MAX7219_DIN_0;}//延时保持端口电平稳定_delay_us(2);//当DIN端口电平稳定时,时钟上升沿,//使硬件写入一个稳定的电平数据(0或1)MAX7219_CLK_1;//延时,确保硬件能检测到CLK端口的上升沿_delay_us(2);//时钟置为低电平,准备下一次上升沿MAX7219_CLK_0;//将地址最高位的下一位左移到最高位addr<<=1;}//循环过后,已将地址发送给7219了,时钟初始化置为低电平MAX7219_CLK_0;//再用8次循环,将数据发送给7219,8位数据位都有效for(i=0;i<8;i++){if(data&0x80){MAX7219_DIN_1;}else{MAX7219_DIN_0;}_delay_us(2);MAX7219_CLK_1;_delay_us(2);MAX7219_CLK_0;data<<=1;}//将LOAD置为高电平,实现上升沿锁定的操作MAX7219_LOAD_1;}void init7219(void){//设置8个数码管的模式选择都为译码模式Write7219(0x9,0xFF);//设置占空比为15/32(数码管亮与灭的时间比),即设置数码管的亮度Write7219(0xa,0x7);//设置需扫描的显示器的个数为8个,Write7219(0xb,0x7);//设置掉电时的模式为普通模式Write7219(0xc,0x1);}。
MAX7219共阴极LED驱动器程序
MAX7219共阴极 LED数码管显示驱动(一)、 MAX7219MAX7219是一种串入、并出的共阴极LED数码管显示驱动器,每片可驱动8 位 LED数码管显示,与单片机的接口只要 3 根线,内带BCD译码器,及显示测试、移位、锁存器等,输出电流达40mA,外头只要一只亮度调整电阻。
MAX7219引脚图1、引脚功能说明DIN:串行数据输入端,CLK的上涨沿时数据被载入内部16 位移位存放器中CLK:串行时钟输入端,最高工作频次可达10MHzLOAD:片选端,低电平接收DIN 端的数据,高电平常数据被所存DIG0~7: LED的位控制端A~DP:LED的端控制端DOUT:串行数据输出端,用于芯片的级联ISET:硬件亮度调整端,在该引脚与VCC之间跨接一个电阻,LED的亮度即可经过该电阻来调理,流过LED的段驱动均匀电流为流过此电阻电流的100 倍, 此电阻值范围为:10~80K 之间。
2、内部存放器说明A、译码方式选择存放器地点:09H赋值: FFH表示使用MAX7219内部的BCD译码器00H表示不使用MAX7219内部的 BCD译码器B、亮度调理存放器地点:0AH赋值:00H~0FH 可改变MAX7219所驱动的LED的亮度,其变化范围在1/32~31/32之间C、扫描位数设定存放器地点:0BH赋值: 00H所有位不显示01H~07H挨次对应于1~8 位及前方位所有显示(即需显示的位应为“1”)D、待机模式开关存放器地点:0CH赋值: 00H LED全灭01H LED正常显示E、显示器测试存放器地点: 0FH赋值: 00H LED为正常显示状态01H LED测试状态,即LED全亮F、8 位LED显示数据存放器地点: 01H~08H对这些存放器赋值(即需显示的内容),就会在对应的1~8 位LED数码管上显示出来3、使用注意事项因为电源中杂波或邻近的电磁等扰乱信号,使MAX7219在上电后不显示或乱显示;为了除去这类现象应在 MAX7219的 VCC端与地之间接一只104pf 的瓷片电容,在LOAD端于地之间接一只10K 的电阻。
第15讲-SPI-MAX7219
0BH
0CH 0D、0EH 0FH
00~07H
00~01 XX 00~01
LED数
0BH 03H
ห้องสมุดไป่ตู้
地址0~3扫描
启动工作
启动与否 0CH 01H
测试IO
0FH 00H
不测试
集美大学机械工程学院-郑东强
用MAX7219显示一个8位数字和递增
SPI_MAX7219_soft
SPI_MAX7219_H&Up.C
集美大学机械工程学院-郑东强
SPI引脚功能
主机 单缓冲 从机 双缓冲
集美大学机械工程学院-郑东强
SPI寄存器设置
1、控制寄存器-SPCR 3、数据寄存器-SPDR
中断 使能
方向 主从
2、状态寄存器-SPSR
极性 相位 SPCR
1:LSB 标志 写标志 0:MSB
1:空高 1:尾采 0:空低 0:起采
SPI主、从机通信编程SPI_P75.C
集美大学机械工程学院-郑东强
作业
将上述程序进行改造,每500ms主机向从机发送一个 2,从机将接收到的数据累加输出
集美大学机械工程学院-郑东强
SPI总线接口共阴极数码管驱动芯片MAX7219
动态扫描驱动七段数码管 最多驱动8个数码管 节省单片机CPU资源
集美大学机械工程学院-郑东强
主出从入 主入从出 同步时钟
集美大学机械工程学院-郑东强
ATmega16 SPI 的特点
全双工, 3 线同步数据传输
主机或从机操作
LSB 首先发送或MSB 首先发送 7 种可编程的比特率 传输结束中断标志 写碰撞标志检测
可以从闲置模式唤醒
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。
max7219笔记
DIN(1脚):串行数据输入端口。
在时钟上升DIG 0~DIG 7(2,3,5~8,10,11脚):8个数据驱动线路置显示器共阴极为低电平。
关闭时7219此管脚输出高电平,7221呈现高祖抗。
GND(4,9脚):地线(4脚和9脚必须同时接地)。
LOAD(12脚,max7219):载入数据。
连接数据的后16位在LOAD端的上升沿时被锁定。
CS(12脚,max7221):片选端。
该端为低电平时串行数据被载入移位寄存器。
连续数据的后16位在CS端的上升沿时被锁定。
CLK(13脚):时钟序列输入端。
最大速率位10MHz,在时钟的上升沿,数据移入内部移位寄存器。
下降沿时,数据从DOUT端输出。
对MAX7221来说,只有当CS端为低电平时时钟输入才有效。
SEG A~SEG G,DP(14~17,20~23脚):7段和小数点驱动,为显示器提供电流。
当一个段驱动关闭时,7219的此端呈低电平,7221呈高祖抗。
SET(18脚):通过一个电阻连接的V+来提高段电流。
V+(19脚):正极电压输入,+5V。
DOUT(24脚):串行数据输出端口,从DIN输入的数据在16.5个时钟周期后在此端有效。
当使用多个MAX7219或MAX7221时用此端方便扩展。
数据寄存器和控制寄存器1、译码模式寄存器(0X09)2、亮度控制(0X0A)越向下,数码管越亮3、扫描控制寄存器(0X0B)4、掉电模式(0X0C)掉电模式:0X00;正常模式:0X01。
5、显示检测寄存器(0X0F)。
Max7219-7221中文
/MAX7221串行接口8位LED显示驱动器一、概述MAX7219/MAX7221是一种集成化的串行输入/输出共阴极显示驱动器,它连接微处理器与8位数字的7段数字LED显示,也可以连接条线图显示器或者64个独立的LED。
其上包括一个片上的B型BCD编码器、多路扫描回路,段字驱动器,而且还有一个8*8的静态RAM用来存储每一个数据。
只有一个外部寄存器用来设置各个LED的段电流。
MAX7221与SPI™、QSPI™以及MICROWIRE™相兼容,同时它有限制回转电流的段驱动来减少EMI(电磁干扰)。
一个方便的四线串行接口可以联接所有通用的微处理器。
每个数据可以寻址在更新时不需要改写所有的显示。
MAX7219/MAX7221同样允许用户对每一个数据选择编码或者不编码。
整个设备包含一个150μA的低功耗关闭模式,模拟和数字亮度控制,一个扫描限制寄存器允许用户显示1-8位数据,还有一个让所有LED发光的检测模式。
在应用时要求3V的操作电压或segment blinking,可以查阅MAX6951数据资料。
二、应用条线图显示仪表面板工业控制LED矩阵显示三、管脚配置四、功能特点●10MHz连续串行口●独立的LED段控制●数字的译码与非译码选择●150μA的低功耗关闭模式●亮度的数字和模拟控制●高电压中断显示●共阴极LED显示驱动●限制回转电流的段驱动来减少EMI(MAX7221)●SPI,QSPI,MICROWIRE串行接口(MAX7221)●24脚的DIP和SO封装五、分类信息芯片工作温度范围管脚封装MAX7219CNG0°C to+70°C24Narrow Plastic DIP MAX7219CWG0°C to+70°C24Wide SO MAX7219C/D0°C to+70°C Dice*MAX7219ENG-40°C to+85°C24Narrow Plastic DIP MAX7219EWG-40°C to+85°C24Wide SO MAX7219ERG-40°C to+85°C24Narrow CERDIP九、时序图十、详细描述(一)MAX7219和MAX7221的不同之处MAX7219和MAX7221是相同的除了以下两点:(1):MAX7219的段驱动有回流限制可以减少EMI;(2):MAX7219的串行口和SPI完全兼容。
MAX7219原理及其应用1
MAX7219原理及其应用西安通信学院(710106) 王建华 逄玉台摘 要 在单片机应用系统中,单片机与LED的连接有并行和串行方式。
由于串行方式占用单片机口线少,因而得到广泛应用。
MAX7219芯片是一个专用的八位LED显示驱动串行接口,文章介绍了其组成原理、应用电路、程序设计及应用中应注意的问题。
关键词 寄存器 液晶显示器 单片机MAX7219是微处理器和共阴极七段——八位LED显示、图条/柱图显示或64点阵显示接口的小型串行输入/输出芯片。
片内包括BCD译码器、多路扫描控制器、字和位驱动器和8×8静态RAM。
外部只需要一个电阻设置所有LED显示器字段电流。
MAX7219和微处理器只需三根导线连接,每位显示数字有一个地址由微处理器写入。
允许使用者选择每位是BCD译码或不译码。
使用者还可选择停机模式、数字亮度控制、从1~8选择扫描位数和对所有LED显示器的测试模式。
1 MAX7219工作原理1.1 MAX7219简介MAX7219和单片计算机连接有三条引线(DIN、CLK、LOAD),采用16位数据串行移位接收方式。
即单片机将16位二进制数逐位发送到DIN端,在CLK上升沿到来前准备就绪,CLK的每个上升沿将一位数据移入MAX7219内移位寄存器,当16位数据移入完,在LOAD引脚信号上升沿将16位数据装入MAX7219内的相应位置,在MAX7219内部硬件动态扫描显示控制电路作用下实现动态显示。
1.2 MAX7219引脚说明MAX7219为24引脚芯片,引脚排列如图1所示,各引脚功能如下:DIN:串行数据输入端;DIG0~DIG7:LED位线;LOAD:数据装载信号输入端;SEGA~SEGG,SEGDp:段码输出端;ISET:硬件亮度调节端;DOUT:串行数据输出端;CLK:移位脉冲输入端;V+:正电源;GND:地。
SEGDpSEGASEGCSEGDDOUTDINDIG0DIG4GNDDIG6DIG2DIG3DIG7GNDDIG5DIG1LOAD CLKSEGFSEGBSEGGISETSEGEV+图1 MAX7219引脚图1.3 MAX7219内部组成结构MAX7219组成如图2所示。