/*****************************************************
This program was produced by the
CodeWizardAVR V2.05.0 Professional
Automatic Program Generator
© Copyright 1998-2010 Pavel Haiduc, HP InfoTech s.r.l.
http://www.hpinfotech.com Project :
Version :
Date : 24-11-2016
Author : NeVaDa
Company :
Comments:
Chip type : ATmega8
Program type : Application
AVR Core Clock frequency: 8.000000 MHz
Memory model : Small
External RAM size : 0
Data Stack size : 256
*****************************************************/
#include <mega8.h>
#include <delay.h>
#include <string.h>
#define DS PORTC.1
#define STCP PORTC.2
#define SHCP PORTC.0
#define E1 PORTD.7 //active high
#define A PORTD.4
#define B PORTD.5
#define C PORTD.6
//#define port_ (PORTD.1,PORTD.6);
unsigned char i,c_dai=0;
unsigned char scan_variant;
unsigned char quet[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};
unsigned char chuoi[]="hello";
//unsigned char chuoi[]="Hello This Is My Project Using Matrix LED Hope You Enjoy It";
unsigned char mang[];
unsigned int _16_bit[];
unsigned flash hello[]= {//chuoi[i]
//unsigned char chuoi[]="XINCHAOHELLOMYPROJECT";
//0E0H,1FH,90H,0H,88H,0H,88H,0H,88H,0H,90H,0H,0E0H,1FH,0H,0H
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,//space (ascii code: 32)
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0x1F,0xE0,0x0F,0xE0,0x67,0xFE,0x67,0xFE,0x67,0xFE,0x0F,0xE0,0x1F,0xE0,0xFF,0xFF,
//0x1F,0xE0,0x6F,0xFF,0x77,0xFF,0x77,0xFF,0x77,0xFF,0x6F,0xFF,0x1F,0xE0,0xFF,0xFF,//A65
//0F8H,1FH,88H,10H,88H,10H,88H,10H,88H,10H,88H,10H,70H,0FH,0H,0H
0x07,0xE0,0x07,0xE0,0x67,0xE6,0x67,0xE6,0x67,0xE6,0x0F,0xF0,0x9F,0xF9,0xFF,0xFF,
//0x07,0xE0,0x77,0xEF,0x77,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,2H,0H,4H,0H,8H,0F8H,1FH,0H,0H
0x07,0xF0,0xFF,0xEF,0xFF,0xF7,0xFF,0xFB,0xFF,0xF7,0xFF,0xEF,0x07,0xF0,0xFF,0xFF,//W
//0x18,0x1C,0x20,0x02,0x40,0x01,0x80,0x00,0x40,0x01,0x20,0x02,0x18,0x1C,0x00,0x00,
0xE7,0xE3,0xDF,0xFD,0xBF,0xFE,0x7F,0xFF,0xBF,0xFE,0xDF,0xFD,0xE7,0xE3,0xFF,0xFF,//X
//18H,0H,20H,0H,40H,0H,80H,1FH,40H,0H,20H,0H,18H,0H,0H,0H
0xE7,0xFF,0xDF,0xFF,0xBF,0xFF,0x7F,0xE0,0xBF,0xFF,0xDF,0xFF,0xE7,0xFF,0xFF,0xFF,//Y
//8H,1CH,8H,12H,8H,11H,88H,10H,48H,10H,28H,10H,18H,10H,0H,0H
0xF7,0xE7,0xF7,0xEB,0xF7,0xED,0xF7,0xEE,0x77,0xEF,0xB7,0xEF,0xC7,0xEF,0xFF,0xFF,//Z
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xFF,0xF3,0xBF,0xED,0xBF,0xED,0xBF,0xED,0xBF,0xED,0x7F,0xF0,0xFF,0xEF,0xFF,0xFF,//a97
0x07,0xE0,0x7F,0xF7,0xBF,0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two led code are buildt and one is located in flash memory, the other must be located in
flash memory, if not mcu only run with led code in flash memory
**********8*********************************/
flash unsigned char oneday[]= {
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,
0xFC,0x22,0x21,0x21,0x21,0x22,0xFC,0x00,
0xFF,0x89,0x89,0x89,0x89,0x89,0x76,0x00,
0x7E,0x81,0x81,0x81,0x81,0x81,0x62,0x00,
0xFF,0x81,0x81,0x81,0x81,0x42,0x3C,0x00,
0xFF,0x89,0x89,0x89,0x89,0x81,0x42,0x00,
0xFF,0x09,0x09,0x09,0x09,0x01,0x01,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,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,
};
void shift_check(unsigned char b)
{
unsigned char _shift_;
for(_shift_=0;_shift_<8;_shift_++)
{
PORTB.1=b&0x80;//get msb bit
PORTB.0=1;
delay_us(1);
PORTB.0=0;
b<<=1;//shift and make value of b variant<==>b=(b>>1);
}
}
void shift_checks(unsigned char *p,unsigned char element)
{
unsigned char b,cnt;
for(cnt=0;cnt<element;cnt++)
{
b=*(p+element-cnt-1);
shift_check(b);
}
PORTB.3=1;
delay_ms(1);
PORTB.3=0;
}
void get_code_shift()
{
{
unsigned char count,group,result=0,count1=0,count2=0,count3;
unsigned char ffering[2];
for(group=0;group<2;group++)
{
for(count=0;count<16;count++)
{
count1++;
if(i+group>=c_dai)
{
mang[result]=0x00;
}
else
{
mang[result]=hello[(chuoi[i+group]*16-512)+count];
}
result++;
}
}
//cac ma led 8 bit duoc lay ra da kiem tra lai va da dung het khong sai.
for(count1=0;count1<32;count1+=2) //chua lay dung code
{
_16_bit[count1/2]=((mang[count1+1]<<8)|mang[count1]);//da kiem tra, khong sai!?
}
//khi ghep lai thanh so 16 bit, khi lay ra lai 8 bit thi chi co 8 bit cao dung
// cac bit thap chi dung dung nhat o thanh ma led dau tien (_16_bit[0])
//con lai sai het.
ffering[0]=mang[6]; //nhu the nay ma cung truyen sai ma led nua
ffering[1]=mang[7]; //nhu the nay ma cung truyen sai ma led nua
shift_checks(ffering,2);
while(1);
for(count3=0;count3<16;count3++)
{
ffering[0]=_16_bit[count3]&0x00ff;
ffering[1]=_16_bit[count3]>>8;
shift_checks(ffering,2);
delay_ms(1500);
}
// ffering[0]=0x55;
// ffering[1]=0x55;
// shift_checks(ffering,2);
// delay_ms(500);
// ffering[0]=~0x55;
// ffering[1]=~0x55;
// shift_checks(ffering,2);
// delay_ms(500);
// ffering[0]=0x55;
// ffering[1]=0x55;
// shift_checks(ffering,2);
// delay_ms(500);
// ffering[0]=~0x55;
// ffering[1]=~0x55;
// shift_checks(ffering,2);
// delay_ms(500);
while(1);
}
}
void shift_char_up()
{
unsigned char j,k,m,n,buffer[4];
c_dai=strlen(chuoi);
for(i=0;i<c_dai;i++)
{
for(j=0;j<16;j+=2)
{
get_code_shift();
for(n=0;n<8;n++)
{
_16_bit[n]>>n;
_16_bit[n+1]>>n;
for(k=0;k<8;k++)
{
scan_variant=0;
for(m=0;m<16;m+=2)
{
buffer[0]=_16_bit[n]&0x00ff;
buffer[1]=_16_bit[n]>>8;
buffer[2]=_16_bit[n+1]&0x00ff;
buffer[3]=_16_bit[n+1]>>8;
_74hc595s(buffer,4);
PORTD=~(0x01<<scan_variant);
delay_ms(8);
PORTD=0xff;
delay_us(1);
scan_variant++;
}
}
}
}
}
}
void main(void)
{
PORTB=0x00;
DDRB=0xff;
PORTC=0x00;
DDRC|=(1<<DDC0)|(1<<DDC1)|(1<<DDC2);
PORTD=0x00;
DDRD=0xff;
while (1)
{
//_scan_forward();
//_scan_reverse();//this function cause while function is
*ẩn*abled// because it's the true simple prt
//check();
//check_16();
shift_char_up();
//check_any_function();
//check_out();
}
}