MAX7219中文资料
基于MAX7219的LED显示驱动设计

基于MAX7219的LED显示驱动设计沈锐【摘要】实现了一种驱动LED数码管动态显示的方案。
在分析数码管结构及显示原理的基础上,设计了驱动8位数码管的硬件电路,提出了自定义编码方式,在此基础上分析了数据传输过程,并设计了控制程序,实现了数码管的动态显示。
【期刊名称】《甘肃科技纵横》【年(卷),期】2012(041)006【总页数】3页(P39-41)【关键词】LED数码管;自定义编码;动态显示【作者】沈锐【作者单位】中船重工第七一口研究所,湖北宜昌443003【正文语种】中文【中图分类】TP273LED(Light Emitting Diode)数码管无论在工业生产、交通运输、还是仪器仪表上都有广泛的用途,不仅可以用来显示测量值,也可以用来表示系统的各种状态。
1 LED数码管显示原理[1]LED数码管(以下简称数码管)按各发光段的串并联方式分为串联式和并联式,由于串联式数码管控制起来较为复杂,且目前没有专用芯片可直接应用,只有通过分立开关器件或多路开关芯片等实现译码功能,因此较少使用。
而并联式数码管则控制方式相对简单,且可靠性更高,工程上应用的比较多。
并联式数码管按其内部LED公共端的极性分为共阴极数码管和共阳极数码管,实际中常用的LED数码管是并联式共阴极七段数码管,数码管各段编号如图1,结构原理如图2所示。
本文中VCC为5VDC。
共阳极数码管的控制方式与共阴极式类似,只是在决定哪一段被点亮时给出的信号不同。
为方便起见,本文仅讨论并联式共阴极七段数码管,下文中简称数码管。
图1 数码管各段编号图2 数码管结构原理由图2可看出,每个数码段通过限流电阻和译码开关(译码开关泛指能起到开关作用的器件,如三级管、MOSFET、普通开关等)相互并联,然后与电源连接,由译码电路控制译码开关的通断。
译码开关导通表示与该译码开关相联的数码段被点亮,译码开关关断表示与该译码开关相联的数码段熄灭,不同的数码段按规律点亮和熄灭就可显示“0”~“9”,共10个阿拉伯数字以及部分英文字母。
MAX7219单片以及级联驱动程序

MAX7219单片以及级联驱动程序2011-03-20 09:40说明一下:这个word版式是从百度上下载的,在原版中,作者只是写了驱动一片MAX7219的程序。
本人作为菜鸟,第一次使用MAX7219就用了两片级联来驱动15个数码管,按照原版程序驱动一片MAX7219是没有问题的,但是,驱动两片MAX7219就不行了。
自己先认真看了MAX7219的DataSsheet,因为英语是个二把刀,看的迷迷糊糊,似懂非懂(可见英语还是很重要的),又在网上搜索也没发现有正确的程序(都是有点儿问题,上网贴出来请教各位大虾的),没办法只能自力更生了,终于调出来了。
将原版增删修改,传上来共享,希望对以后某位菜鸟第一次使用MAX7219时有所帮助啦,嘿嘿!/**************************************************************** *常用符号定义******************************************************************/#define uchar unsigned char/**************************************************************** *定义MAX7219寄存器******************************************************************/#define REG_NO_OP 0x00 //定义空操作register#define DIG_1 0x01 // 定义数码管1 register#define DIG_2 0x02 // 定义数码管2 register#define DIG_3 0x03 // 定义数码管3 register#define DIG_4 0x04 // 定义数码管4 register#define DIG_5 0x05 // 定义数码管5 register#define DIG_6 0x06 // 定义数码管6 register#define DIG_7 0x07 // 定义数码管7 register#define DIG_8 0x08 // 定义数码管8 register#define REG_DECODE 0x09 // 定义解码控制register#define REG_INTENSITY 0x0a // 定义显示亮度register#define REG_SCAN_LIMIT 0x0b // 定义扫描限制register#define REG_SHUTDOWN 0x0c // 定义"shutdown"模式register#define REG_DISPLAY_TEST 0x0f // 定义"display test"模式register#define INTENSITY_MIN 0x00 // 定义最低显示亮度#define INTENSITY_MAX 0x0f // 定义最高显示亮度/****************************************************************** * 定义硬件引脚连接******************************************************************/#define DATA P2^3; //定义P3_5连接MAX7219 DATA引脚#define CLK P2^5; //定义P3_4连接MAX7219 CLK 引脚#define CS P2^4; //定义P3_3连接MAX7219 CS 引脚/***************************************************************** * 共阴极七段数码管显示对应段查询表(数字0-9分别对应code_table[0]-[9])***********************************************************/uchar code code_table[10]={0x7e,0x30,0x6d,0x79,0x33,0x5b,0x5f,0x70,0x7f,0x7b}; /*采用数组*//****************************************************************** * MAX7219_Send()描述: 向MAX7219传送一字节数据Arguments : dataout = data to sendReturns : none******************************************************************/ void send (uchar datain){char I,temp;for (i=8; i>0; i--){CLK=0; // CLK 置低temp=datain&0x80;if (temp==0x80) // 判断并输出一位DATA=1; // 输出"1"else // 或DATA=0; // 输出"0"datain<<=1; //datain左移位,以便再次与0x80按位与CLK=1; // CLK 置高}}/**************************************************************** * MAX7219_Write()/MAX7219_Write_1()描述: 向 MAX7219 写命令Arguments : reg_number = register to write todataout = data to write to MAX7219Returns : none************************************************************** */ void MAX7219_Write (uchar add1, uchar dat1) //向第一片MAX7219写数据{CS=0; // CS置低选通MAX7219send(add1); // 写register number 到MAX7219send(dat1); // 写data 到MAX7219CS=1; // 利用CS上升沿锁存以上移位进输入的16位数据}void MAX7219_Write_1(uchar add2,uchar dat2) //向第二片MAX7219写数据{CS=0;sent(add2);sent(dat2);CLK=1; // 第16.5个时钟周期,数据从第一片MAX7219的DOUT端开始输出sent(REG_NO_OP); //对第一片MAX7219进行空操作,sent(0x00);CS=1;}/******************************************************************** MAX7219_DisplayChar()描述: 使某一位显示一个数字Arguments : digit = digit number (0-7)character = character to display (0-9, A-Z)Returns : none****************************************************************/void MAX7219_DisplayChar (char digit, char character){MAX7219_Write(digit, character);}PS:这个函数可以不要,直接调用写数据函数就可以了(原版)/******************************************************************** MAX7219_Clear()/MAX7219_clear_1()描述: 清除所有位的显示Arguments : noneReturns : none*****************************************************************/ void MAX7219_Clear (){uchar i;for (i=0; i < 8; i++)MAX7219_Write(i, 0x00); // 清除第一片MAX7219所有位的显示}void MAX7219_Clear_1(){uchar i;for(i=1;i<=8;i++)MAX7219_Write_1(i,0x00); //清除第二片MAX7219所有位的显示}PS:可以两片一起清楚数据,但建议分开较好。
max7219驱动程序。doc

MAX7219驱动程序2007-04-27 10:21/***************************************************************** * 常用符号定义******************************************************************/#define uchar unsigned char/****************************************************************** * 定义MAX7219寄存器*******************************************************************/ #define REG_NO_OP 0x00 // 定义空操作 register #define DIG_1 0x01 // 定义数码管1 register #define DIG_2 0x02 // 定义数码管2 register #define DIG_3 0x03 // 定义数码管3 register #define DIG_4 0x04 // 定义数码管4 register #define DIG_5 0x05 // 定义数码管5 register #define DIG_6 0x06 // 定义数码管6 register #define DIG_7 0x07 // 定义数码管7 register#define DIG_8 0x08 // 定义数码管8 register #define REG_DECODE 0x09 // 定义解码控制 register #define REG_INTENSITY 0x0a // 定义显示亮度register #define REG_SCAN_LIMIT 0x0b // 定义扫描限制 register #define REG_SHUTDOWN 0x0c // 定义"shutdown"模式 register #defineREG_DISPLAY_TEST 0x0f // 定义"display test"模式 register #define INTENSITY_MIN 0x00 // 定义最低显示亮度 #define INTENSITY_MAX 0x0f // 定义最高显示亮度/******************************************************************** * * 定义硬件引脚连接********************************************************************* */ #define DATA P2^3; //定义P3_5连接MAX7219 DATA引脚 #define CLK P2^5; //定义P3_4连接MAX7219 CLK 引脚 #define CS P2^4; //定义P3_3连接MAX7219 CS 引脚(实际按7221设)/******************************************************************** *** * 共阴极七段数码管显示对应段查询表(数字0-9分别对应code_table[0]-[9])********************************************************************* **/ uchar code code_table[10]={0x7e,0x30,0x6d,0x79,0x33,0x5b,0x5f,0x70,0x7f,0x7b}; /*采用数组*//******************************************************************** *** * MAX7219_SendByte() * * 描述: 向MAX7219传送一字节数据 * Arguments : dataout = data to send * Returns : none********************************************************************* ****/ void MAX7219_SendByte (uchar dataout) { char i; for (i=8; i>0; i--) { uchar mask = 1 << (i - 1); // 设置掩码 CLK=0; // CLK 置低 if (dataout & mask) // 判断并输出一位 DATA=1; // 输出"1" else // 或 DATA=0; // "0" CLK=1; // CLK 置高 } }/******************************************************************** *** * MAX7219_Write() * * 描述: 向 MAX7219 写命令 * Arguments :reg_number = register to write to * dataout = data to write to MAX7219* Returns : none********************************************************************* ****** */ void MAX7219_Write (uchar reg_number, uchar dataout) { CS=0; // CS置低选通 MAX7219 MAX7219_SendByte(reg_number); // 写 register number 到 MAX7219 MAX7219_SendByte(dataout); // 写 data 到 MAX7219 CS=1; // 利用CS上升沿锁存以上移位进输入的16位数据 }/******************************************************************** ****** * MAX7219_DisplayChar() * * 描述: 使某一位显示一个数字 * Arguments : digit = digit number (0-7) * character = character to display (0-9, A-Z) * Returns : none********************************************************************* *****/ void MAX7219_DisplayChar (char digit, char character){ MAX7219_Write(digit, character); }/******************************************************************** ****** * MAX7219_Clear() * * 描述: 清除所有位的显示 * Arguments : none * Returns : none********************************************************************* ******/ void MAX7219_Clear (void) { uchar i; for (i=0; i < 8; i++) MAX7219_Write(i, 0x00); // 清除所有位的显示 }/******************************************************************** ****** * MAX7219_SetBrightness() * * 描述: 设置数码管显示亮度 * Arguments : brightness (0-15) * Returns : none********************************************************************* ******/ void MAX7219_SetBrightness (char brightness) { brightness &= 0x0f; // 屏蔽高位字节 MAX7219_Write(REG_INTENSITY, brightness); // 设置数码管显示亮度 }/******************************************************************** ****** * MAX7219_DisplayTestStart() * * 描述: 进入 test 模式 * Arguments : none * Returns : none********************************************************************* ******/ void MAX7219_DisplayTestStart (void){ MAX7219_Write(REG_DISPLAY_TEST, 1); // 置 MAX7219 为 test 模式 }/******************************************************************** ****** * MAX7219_DisplayTestStop() * * 描述: 退出 test 模式 * Arguments : none * Returns : none********************************************************************* ******/ void MAX7219_DisplayTestStop (void){ MAX7219_Write(REG_DISPLAY_TEST, 0); // 置 MAX7219 为正常显示模式 } /******************************************************************** ****** * MAX7219_ShutdownStart() * * 描述: 进入 shutdown 模式 * Arguments : none * Returns : none********************************************************************* ******/ void MAX7219_ShutdownStart (void) { MAX7219_Write(REG_SHUTDOWN, 0); // 置 MAX7219 为 shutdown 模式 }/******************************************************************** ****** * MAX7219_ShutdownStop() * * 描述: 退出 shutdown 模式 * Arguments : none * Returns : none********************************************************************* ******/ void MAX7219_ShutdownStop (void) { MAX7219_Write(REG_SHUTDOWN, 1); // 置 MAX7219 为正常显示模式 }/******************************************************************** ****** * MAX7219_Init() * * Des cription: MAX7219初始化模块; 应该先于其他MAX7219函数而被调用 * Arguments : none * Returns : none********************************************************************* ******/ void MAX7219_Init (void) { DATA=1; // 置DATA为1 CLK=1; // 置CLK 为1 CS=1; // 置CS 为1 MAX7219_Write(REG_SCAN_LIMIT, 7); // 设置为全显示 MAX7219_Write(REG_DECODE, 0x00); // 所有位设置为非解码方式MAX7219_ShutdownStop(); // 置 MAX7219 为正常显示模式 (非shutdown模式) MAX7219_DisplayTestStop(); // 置 MAX7219 为正常显示模式 (非test模式) MAX7219_Clear(); // 清除所有位的显示MAX7219_SetBrightness(INTENSITY_MAX); // 置最大亮度 }。
LED显示驱动器MAX7219的单片机接口技术及编程

LED显示驱动器MAX7219的单片机接口技术及编程
刘汉民
【期刊名称】《仪表技术与传感器》
【年(卷),期】2002(000)004
【摘要】介绍LED显示驱动器MAX7219结构原理、性能特点、应用电路以及编程方法.
【总页数】3页(P30-31,51)
【作者】刘汉民
【作者单位】佛山分析仪器厂,广东省佛山市,528041
【正文语种】中文
【中图分类】TN492;TP368.1
【相关文献】
1.MAX7219与单片机的两种接口方式及C51编程方法 [J], 于冬梅;张良祖
2.串行接口8位LED显示驱动器MAX7219 [J], 张志清
3.51单片机和MAX7219的接口及编程应用 [J], 刘爱娟;王青
4.51单片机和MAX7219的接口及编程应用 [J], 刘爱娟;王青
5.LED显示驱动器MAX7219与MCS-51单片机接口及应用 [J], 杨志峰
因版权原因,仅展示原文概要,查看原文内容请购买。
单片机时钟设计MAX7219驱动数码管

单片机时钟设计MAX7219驱动数码管#include#define uchar unsigned char#define uint unsigned intsbit DIN=P0^1; //"显示串行数据输入端"sbit LOAD=P0^2; //"显示数据锁存端"sbit CLK=P0^3; //"显示时钟输入端"#define DecodeMode 0x09 //"译码模式"#define Intensity 0x0a //"亮度"#define ScanLimit 0x0b //"扫描界限"#define ShutDown 0x0c //"掉电模式"#define DisplayTest 0x0f //"显示测试"uchar code seg_data[]={0x7E,0x30,0x6D,0x79,0x33,0x5B,0x5F,0x70,0x7F,0x7B}; //"0,1,2,3,4,5,6,7,8,9" uchar disp_buf[5];uchar code bit_tab[]={0x01,0x02,0x03,0x04};uchar hour=12,min=0,sec=0,count=0;bit flag;void delay (uint a) //" 毫秒延时函数"{uint i;while( --a != 0){for(i = 0; i < 110; i++);}}void write_max7219_byte(uchar temp){uchar i;for(i=0;i<8;i++){CLK=0;DIN=(bit)(temp&0x80);temp<<=1;CLK=1;}}void write_max7219(uchar address,uint dat){LOAD=0;write_max7219_byte(address);write_max7219_byte(dat);LOAD=1;}void Init_max7219 (void){write_max7219(ScanLimit,0x07); //*"设置扫描界限"*/write_max7219(DecodeMode,0xff); //*"设置译码模式"*/ write_max7219(Intensity,0x04); //*"设置亮度"*/write_max7219(ShutDown,0x01); //*"设置电源工作模式"*/ write_max7219(DisplayTest,0x01);delay(5);write_max7219(DisplayTest,0x00);}void conv(uchar in1,in2){disp_buf[0]=in1/10;disp_buf[1]=in1%10;disp_buf[2]=in2/10;if(flag==0)disp_buf[3]=(in2%10)|0x80;elsedisp_buf[3]=in2%10;}void display( ){write_max7219(bit_tab[0],disp_buf[0]); write_max7219(bit_tab[1],disp_buf[1]); write_max7219(bit_tab[2],disp_buf[2]); write_max7219(bit_tab[3],disp_buf[3]); }void init(){TMOD=0x01;TH0=(65536-50000)/256;TL0=(65536-50000)%256;EA=1;ET0=1;TR0=1;}void timer0() interrupt 1{TH0=(65536-50000)/256;TL0=(65536-50000)%256;count++;if(count==20){count=0;flag=~flag;sec++;if(sec==60) {sec=0;min++;if(min==60) {min=0;hour++;if(hour==24) {hour=0;min=0;sec=0;}}}}}void main() {init();Init_max7219 ( ); while(1){conv(hour,min); display( );}}。
LED显示驱动器MAX7219原理及应用

LED显示驱动器MAX7219原理及应用
常江;刘炳文
【期刊名称】《电测与仪表》
【年(卷),期】1996(033)006
【摘要】本文介绍了串行接口、8位数字LED显示驱动器MAX7219的内部结构、工作原理及硬件、软件应用设计。
【总页数】4页(P35-38)
【作者】常江;刘炳文
【作者单位】不详;不详
【正文语种】中文
【中图分类】TN873.93
【相关文献】
1.LED显示驱动器MAX7219的单片机接口技术及编程 [J], 刘汉民
2.串行LED显示驱动器MAX7219 [J], 黄晓兵;王立琦
3.串行LED显示驱动器MAX7219及其应用 [J], 胡奕明
4.串行LED显示驱动器MAX7219及其应用 [J], 胡奕明
5.LED显示驱动器MAX7219与MCS-51单片机接口及应用 [J], 杨志峰
因版权原因,仅展示原文概要,查看原文内容请购买。
max7219数码管驱动程序库函数

函数说明:初始化MAX7219芯片,MAX7219芯片按照顺序级联,
测试模式显示寄存器没有配置,若希望配置,应在max7219.h中将MAX7219_TestModeDisp_EN预定义为1,
并注意配置测试模式显示的时间,
若时间太短,将较难看到显示效果。
输入参数:n-----初始化芯片个数(n>=1,注意:第1个为第0号芯片,显示函数中有具体描述;
for(i=0;i<8;i++);//短延时
MAX7219_LOAD=0;
for(i=0;i<n;i++)//初始化几个MAX7219芯片,做几次设置操作
MAX7219_WriteAddrData (0x09,MAX7219_InitStructure.DecodeMode);//设置译码模式
MAX7219_LOAD=1;//LOAD上升沿锁存数据
*/
//#define DecodeMode0x09 //译码模式寄存器
//#define Intensity0x0a //亮度寄存器
//#define ScanLimit0x0b //扫描位数寄存器
//#define ShutDown0x0c //关机模式寄存器
//#define DisplayTest0x0f //显示测试寄存器
sbit MAX7219_DIN= P0^3; //串行数据输入
sbit MAX7219_CLK= P0^4; //串行时钟
sbit MAX7219_LOAD= P0^5; //显示数据锁存控制
/*****************************************************************
MAX7219及单片机的SPI接口设计

串行显示驱动器PS7219及单片机的SPI接口设计在单片机的应用系统中,为了便于人们观察和监视单片机的运行情况,常常需要用显示器显示运行的中间结果及状态等等。
因此显示器往往是单片机系统必不可少的外部设备之一。
常用的显示器有很多种,其中LED(发光二极管显示器)是应用较多的一种,它特别适用于强光和光线极弱的场合。
要使LED显示,必须提供段选码和位选码。
传统的硬件译码显示接口广泛采用由中央处理器CPU(如:Intel 8031)扩展I/O口(如:8255),然后再使用逻辑门驱动芯片(如7407等)驱动相应的位码和段码。
这种设计,芯片间连线十分复杂,系统工作可靠性不高,已越来越不适应单片机系统集成化、小型化的发展要求。
特别是系统并行扩展I/O,其缺点十分明显(1)连线太多,系统连线复杂,印制板布线不方便;(2)并行总线上挂靠的器件太多,系统工作的稳定性和可靠性低;(3)体积较大,集成度不高。
正是由于上述原因,近年来,各厂家相继开发出了集成度较高、驱动能力较强、驱动位数较多、功能齐全的LED显示驱动器。
本文介绍一种低价位、高性能的多位LED显示驱动器PS7219芯片,以及它与单片机89C51具体的SPI接口设计与应用软件。
1PS7219简介PS7219是一种新型的串行接口的8位数字静态显示芯片。
它是由武汉力源公司新推出的24脚双列直插式芯片,采用流行的同步串行外设接口(SPI),可与任何一种单片机方便接口,并可同时驱动8位LED (或64只独立LED),其引脚图如图1所示。
PS7219内部具有15×8RAM功能控制寄存器,可方便选址,对每位数字可单独控制、刷新、不需重写整个显示器。
显示数字亮度可由数字进行控制,每位具有闪烁使能控制位。
当引脚CON(13脚)置高电平,可禁止所有显示,达到降低功耗的效果,但同时并不影响对控制寄存器的修改。
PS7219还有一个掉电模式、一个允许用户从1位数显示到8位数显示选择的扫描界限寄存器和一个强迫所有LED接通的测试模式。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
_______________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.。