微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 嵌入式设计 > 8X8点阵原理及驱动

8X8点阵原理及驱动

时间:11-25 来源:互联网 点击:
8X8点阵的实际外观图如下:
一共64个发光点构成,上下两排引脚,每排8个,一共16个
点阵侧面有文字的那面对准自己,

(图 1)

8X8点阵的显示原理:
8X8点阵共由64个发光二极管组成,且每个发光二极管是

放置在行线和列线的交叉点上,当对应的某一行置1电平,某一列置0电平,则相应的

二极管就亮;如要将第一个点点亮,则1脚接高电平a脚接低电平,则第一个点就亮了;

如果要将第一行点亮,则第1脚要接高电平,而(a、b、c、d、e、f、g、h )

这些引脚接低电平,那么第一行就会点亮;如要将第一列点亮,

则第a脚接低电平,而(1、2、3、4、5、6、7、8)接高电平,那么第一列就会点亮.



(图 2)

8*8点阵实际的引脚(图一)的不是一排阳极,一排阴极,(就像键盘一样不是abcd按顺序排的)所以焊接有点麻烦,8×8LED点阵引脚图如下:
1,2,3,4,5,6,7,8是行(阳极)
a,b,c,d,e,f,g,h是列(阴极)//此处说的都是行阳型8*8点阵,行阴的略
外面的1~16就是实际的管脚,见图一



移位锁存器74HC595原理


74HC595是一个串入并出的芯片,通过一个for(i=0;i<8;i++)来存储数据。
具体来说就是第一个时钟信号来到时低位的数据向高位挪动一位,
在这个程序中是SH_CP 信号,当SH_CP是一个上跳沿时,
传入的形参Data与0x80相与,得到的数为1,则通过SDATA置1,否通过置为0,
并存储在74HC595的相应位置(最低位即Q0那)上,
DS内部也自动左移一位数据
然后dat向左移一位,使次高位变为最高位与0x80相与,
并存储。通过8次后,就可以得到数据,并存储在Q0~Q7中了,
这时ST_CP一个上跳沿,数据即送出去了.

与8*8LED连接如下:
显示0~59
C语言代码:
#include
#define uchar unsigned char
#define uint unsigned int

void Ser_IN(uchar Data)
{
uchar i;
for(i=0;i<8;i++)
{
SH_CP=0; //先置为低
DS=Data&0x80;//取数据的最高位
Data<=1; //讲数据的次高位移到最高位,为下一次取数据做准备
SH_CP=1; // 再置为高,产生移位时钟上升沿,储存器里的数据移位,数据输入
}
}

void Par_OUT(void)
{
ST_CP=0;//先置为低
ST_CP=1;//再置为高,产生时钟上升沿,上升沿时,数据并行输出
}

uchar code tab[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};//列
uchar code tabdigit[60][8]={ //字模取模方向 阴码 逆向逐列式
{0x00,0x3E,0x41,0x41,0x3E,0x00,0x00,0x00},
{0x00,0x42,0x7F,0x40,0x00,0x00,0x00,0x00},
{0x00,0x62,0x51,0x49,0x46,0x00,0x00,0x00},
{0x00,0x22,0x49,0x49,0x36,0x00,0x00,0x00},
{0x00,0x38,0x26,0x7F,0x20,0x00,0x00,0x00},
{0x00,0x4F,0x49,0x49,0x31,0x00,0x00,0x00},
{0x00,0x3E,0x49,0x49,0x32,0x00,0x00,0x00},
{0x00,0x03,0x71,0x09,0x07,0x00,0x00,0x00},
{0x00,0x36,0x49,0x49,0x36,0x00,0x00,0x00},
{0x00,0x26,0x49,0x49,0x3E,0x00,0x00,0x00},
{0x02,0xFF,0x00,0x00,0xFF,0x81,0xFF,0x00},
{0x02,0xFF,0x00,0x02,0xFF,0x00,0x00,0x00},
{0x02,0xFF,0x00,0xF3,0x91,0x99,0xCF,0x00},
{0x02,0xFF,0x00,0x42,0x89,0x89,0x89,0x76},
{0x02,0xFF,0x00,0x1C,0x13,0x10,0xFF,0x10},
{0x02,0xFF,0x00,0x4F,0x89,0x89,0x89,0x71},
{0x02,0xFF,0x00,0x7C,0x92,0x91,0x91,0x60},
{0x02,0xFF,0x00,0x01,0xF9,0x05,0x03,0x00},
{0x02,0xFF,0x00,0x76,0x89,0x89,0x89,0x76},
{0x02,0xFF,0x00,0x4E,0x91,0x91,0x91,0x7E},
{0xE2,0x91,0x89,0x86,0x00,0xFF,0x81,0xFF},
{0xE2,0x91,0x89,0x86,0x00,0x02,0xFF,0x00},
{0x79,0x49,0x4F,0x00,0x7A,0x4A,0x4E,0x00},
{0x79,0x49,0x4F,0x00,0x49,0x49,0x49,0x36},
{0x79,0x49,0x4F,0x00,0x1E,0x10,0xFF,0x10},
{0x79,0x49,0x4F,0x00,0x4E,0x4A,0x7A,0x00},
{0x79,0x49,0x4F,0x00,0xFE,0x92,0x92,0x60},
{0x79,0x49,0x4F,0x00,0x79,0x05,0x03,0x00},
{0x79,0x49,0x4F,0x00,0x76,0x89,0x89,0x76},
{0x79,0x49,0x4F,0x00,0x4E,0x91,0x91,0x7E},
{0x42,0x89,0x89,0x76,0x00,0xFE,0x82,0xFE},
{0x42,0x89,0x89,0x76,0x00,0x02,0xFF,0x00},
{0x42,0x89,0x89,0x76,0x00,0xF9,0x89,0x8F},
{0x42,0x89,0x89,0x76,0x00,0x89,0x89,0xFF},
{0x42,0x89,0x89,0x76,0x00,0x0F,0x08,0xFF},
{0x42,0x89,0x89,0x76,0x00,0x9E,0x92,0xF2},
{0x42,0x89,0x89,0x76,0x00,0xFF,0x89,0xF9},
{0x42,0x89,0x89,0x76,0x01,0x01,0xFD,0x03},
{0x42,0x89,0x89,0x76,0x00,0xFF,0x89,0xFF},
{0x42,0x89,0x89,0x76,0x00,0xCF,0x89,0xFF},
{0x1F,0x10,0xFF,0x00,0x7E,0x81,0x81,0x7E},
{0x1F,0x10,0xFF,0x00,0x02,0xFF,0x00,0x00},
{0x1F,0x10,0xFF,0x00,0xE2,0x91,0x89,0xC6},
{0x1F,0x10,0xFF,0x00,0x42,0x89,0x89,0x76},
{0x1F,0x10,0xFF,0x00,0x1E,0x10,0xFF,0x10},
{0x1F,0x10,0xFF,0x00,0x8F,0x89,0x89,0xF9},
{0x1F,0x10,0xFF,0x00,0xFF,0x89,0x89,0xF9},
{0x1F,0x10,0xFF,0x00,0x03,0xF9,0x05,0x03},
{0x0F,0x08,0xFF,0x00,0x76,0x89,0x89,0x76},
{0x1F,0x10,0xFF,0x00,0x4E,0x91,0x91,0x7E},
{0x4F,0x49,0x79,0x00,0x3E,0x41,0x41,0x3E},
{0x4F,0x49,0x79,0x00,0x00,0x02,0x7F,0x00},
{0x4F,0x49,0x79,0x00,0x62,0x51,0x49,0x46},
{0x4F,0x49,0x79,0x00,0x42,0x89,0x89,0x76},
{0x4F,0x49,0x79,0x00,0x1E,0x10,0x7E,0x10},
{0x4F,0x49,0x79,0x00,0x4F,0x49,0x79,0x00},
{0x4F,0x49,0x79,0x00,0x7F,0x49,0x79,0x00},
{0x4F,0x49,0x79,0x00,0x01,0x7D,0x03,0x01},
{0x4F,0x49,0x79,0x00,0x76,0x89,0x89,0x76},
{0x4F,0x49,0x79,0x00,0x0E,0x91,0x91,0x7E},
};

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top