launcher
• 博客等级：
• 博客积分：0
• 博客访问：171,156
• 关注人气：171
• 获赠金笔：0支
• 赠出金笔：0支
• 荣誉徽章：

16*16LED点阵完整原理图和程序

(2011-05-12 20:31:50)

原理图

1、三极管部分

2、74HC595部分

3、引出接到点阵的排针

#include
#include<74HC595.h>
#define uchar unsigned char
#define uint unsigned int
//列扫描数组
uchar code table_L[]={0xff,0x7f, 0xff,0xbf, 0xff,0xdf, 0xff,0xef, 0xff,0xf7, 0xff,0xfb, 0xff,0xfd, 0xff,0xfe,
0x7f,0xff, 0xbf,0xff, 0xdf,0xff, 0xef,0xff, 0xf7,0xff, 0xfb,0xff, 0xfd,0xff, 0xfe,0xff};
//字模数组
uchar code table_H[]={
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

0x00,0x08,0x40,0x04,0x40,0x02,0xFE,0x7F,0x20,0x01,0x20,0x02,0x00,0x40,0x20,0x49,
0x20,0x49,0xFE,0x3F,0x90,0x24,0x90,0x24,0x90,0x20,0x80,0x20,0x00,0x20,0x00,0x00,
0x00,0x10,0x80,0x0C,0x80,0x02,0xF8,0x3F,0x40,0x01,0x40,0x0A,0x00,0x04,0x40,0x02,
0x40,0x01,0xFC,0x7F,0x20,0x01,0x20,0x02,0x00,0x04,0x00,0x08,0x00,0x08,0x00,0x00,
0x00,0x00,0x00,0x00,0xE0,0x01,0x20,0x06,0x20,0x05,0x20,0x05,0xFE,0x3F,0x90,0x42,
0x10,0x42,0x10,0x42,0xF0,0x41,0x00,0x40,0x00,0x40,0x00,0x38,0x00,0x00,0x00,0x00,
0x00,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x88,0x00,0x88,0x20,0x88,0x20,0xE4,0x40,
0x94,0x3F,0x4C,0x00,0x44,0x00,0x40,0x00,0x40,0x00,0x40,0x00,0x00,0x00,0x00,0x00,
0x00,0x10,0x80,0x08,0x90,0x04,0x90,0x02,0xF0,0x7F,0x48,0x01,0x44,0x01,0x00,0x02,
0x50,0x02,0xA0,0x02,0x00,0x02,0xFE,0xFF,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x00,
0x00,0x04,0x40,0x04,0x40,0x22,0xFE,0x7F,0x20,0x01,0x20,0x20,0x00,0x20,0x20,0x15,
0x20,0x09,0xFE,0x08,0x90,0x16,0x90,0x21,0x00,0x60,0x00,0x40,0x00,0x40,0x00,0x00,
0x00,0x00,0x00,0x40,0x80,0x20,0x80,0x10,0x80,0x08,0x80,0x06,0xFE,0x01,0x40,0x02,
0x40,0x04,0x40,0x08,0x40,0x10,0x40,0x20,0x00,0x60,0x00,0x40,0x00,0x40,0x00,0x00,
0x00,0x00,0x80,0x09,0xE0,0x08,0x44,0x08,0x48,0x08,0x40,0x09,0xA4,0x48,0xA8,0x86,
0xA0,0x7D,0xB0,0x04,0x2E,0x04,0x20,0x04,0x60,0x04,0x20,0x00,0x00,0x00,0x00,0x00,
0x00,0x20,0x40,0x11,0x40,0x0A,0x20,0x04,0xE0,0x0B,0x00,0x40,0x80,0x20,0x70,0x18,
0x4E,0x07,0x20,0x08,0xA0,0x10,0x60,0x20,0x20,0x60,0x00,0x40,0x00,0x40,0x00,0x00,
0x80,0x10,0x80,0x10,0x88,0x12,0x90,0x1D,0x00,0x10,0xF0,0x13,0x10,0x12,0x08,0x11,
0x0C,0x20,0xE0,0x2F,0x10,0x20,0x10,0x61,0xF0,0x61,0x00,0x20,0x00,0x20,0x00,0x00,
0x00,0x00,0x40,0x20,0x20,0x30,0xF0,0x03,0x0C,0x18,0x40,0x20,0xA0,0x41,0x18,0x48,
0x16,0x52,0xF0,0x43,0x08,0x50,0xA8,0x60,0x18,0x45,0x00,0x08,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x33,0xF8,0x33,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x33,0xF8,0x33,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02,
0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02,
0x00,0x00,0x00,0x06,0x80,0x03,0x00,0x00,0x00,0x10,0x00,0x20,0x00,0x40,0xFC,0x3F,
0x00,0x00,0x00,0x00,0x40,0x00,0x80,0x01,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x04,0x40,0x02,0x40,0x01,0xFE,0x7F,0x20,0x01,0x20,0x43,0x40,0x21,0xC8,0x1E,
0x78,0x00,0x28,0x00,0x64,0xFE,0xA4,0x00,0x20,0x01,0x00,0x02,0x00,0x02,0x00,0x00,
0x00,0x00,0x40,0x00,0x88,0x30,0x10,0x0E,0x00,0x40,0x20,0x30,0xA0,0x0D,0x60,0x01,
0xA2,0x3E,0x94,0x00,0xD0,0x1E,0x90,0x20,0x10,0x20,0x00,0x20,0x00,0x38,0x00,0x00,
0x00,0x10,0x80,0x10,0x80,0x08,0x40,0x04,0x40,0x03,0xC0,0x20,0x00,0x40,0xFC,0x7F,
0x80,0x00,0x40,0x01,0x20,0x02,0x18,0x04,0x00,0x0C,0x00,0x08,0x00,0x08,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
};
uchar L=0,H=0;
uint t=0,x=0;
#define h sizeof(table_H)
void main()
{
// extern uint h;
EA=1;
ET0=1;
TMOD=0x01;
TH0=(65536-1000)/256;//1ms进一次中断刷新显示一列
TL0=(65536-1000)%6;
TR0=1;
// h=sizeof(table_H);
while(1)
{
if(L==32)
{
L=0;
H=0;
}

}
}
void T0_time() interrupt 1
{
TH0=(65536-1000)/256;
TL0=(65536-1000)%6;
Input(table_L[L]);
Input(table_L[L+1]);
Input(table_H[H+x]);
Input(table_H[H+x+1]);
Output();
L=L+2;
// if(L==32)L=0;
H=H+2;
// if(H==32)H=0;
t++;
if(t==100)//移动
{
t=0;
x=x+2;
if(x>=h-32)x=0;
}
}

//SCK上升沿读取数据(由高位送数据)，RCK上升沿输出锁存数据  。没有严格的时间要求
sbit SI=P2^4;//数据口
sbit SCK=P2^6;//数据输入时钟线
sbit RCK=P2^5;//数据输出时钟线
void  Input(unsigned char dat)
{
char i;
for(i=0;i<8;i++)
{
dat=dat<<1;
SCK=0;
SI=CY;//取出最高位
SCK=1;//上升沿
}
}
void Output()
{
RCK=0;
RCK=1;//上升沿输出锁存数据
}

0