Friday, June 20, 2014

Running teks sederhana dengan Atmega 8

Asslamualaikum Wr Wb

sudah lama gak nulis di blog ini lg,,,
mumpung ada kesempatan nulis ,,,saya mau share project saya yang berhasil saya aplikasikan yaitu Running teks sederhana menggunakan at mega 8. Saya waktu itu harus bisa bikin running teks ini soalnya buat kejutan cewek saya yang lagi ultah,jd mau gak mau harus jadi project ini,,hehehehe "Buat motivasi dan akhirnya dia suka :D ",,,, ...langsung aja saya mulai dari awal ,,heheheh gak bisa bosa basi,,,,,,

1. Running teks 8x8 = 4 buah
dengan konfigurasi pin :


                 atau bisa bikin sendiri dengan led biasa dirangkai matrix,,tp rada ribet heheheh,,,

2. IC sheft register SN74HC595  = 4 buah

3. Transistor NPN 2n222a  = 8 buah
4. Atmega 8 = 1 buah
5. regulator 7805 = 1 buah
6. header cover 10 pin untuk pin downloader = 1 buah
7. resistor 1 k = 10 buah
9. xtal 12 Mhz
10. capacitor 22 pf
11. Catu daya ( bisa battrai kotak 9 v / adaptor diatas 5 v)


Skema Rangkaian menggunakan proteus dengan ATmega 8:




source code bahasa c Atmega 8 :


/*****************************************************
This program was produced by the
CodeWizardAVR V2.05.3 Standard
Automatic Program Generator
© Copyright 1998-2011 Pavel Haiduc, HP InfoTech s.r.l.
http://www.hpinfotech.com

Project :
Version :
Date    : 24/12/2013
Author  : PerTic@n
Company : If You Like This Software,Buy It
Comments:


Chip type               : ATmega8
Program type            : Application
AVR Core Clock frequency: 12,000000 MHz
Memory model            : Small
External RAM size       : 0
Data Stack size         : 256
*****************************************************/

#include <mega8.h> 
#include <delay.h>
#define data_hi PORTC.0=1
#define data_lo PORTC.0=0

int i,c,geser,ulang;

unsigned char v[]={
0,0,0,0,0,0,0,0,0,0,0,

127,32,16,32,127,0,              //W
48,74,74,74,124,0,               //a
126,16,8,8,112,0,                //h
38,72,72,72,62,0,              //y
62,64,64,32,126,0,           //u
48,72,72,72,126,0,          //d
126,0,                              //i
0,0,
127,8,8,8,127,0,//H
126,0,          //i
48,72,72,72,126,0,//d
48,74,74,74,124,0,//a
38,72,72,72,62,0,//y
48,74,74,74,124,0,//a
8,62,72,64,32,0,//t
0,0,0,0, 
14,31,62,124,62,31,14,0,0,0,0,0,//love

127,73,73,54,0,//B

60,82,82,82,92,0,//e
126,26,42,68,0,//R
8,62,72,64,32,0,//t
126,16,8,8,112,0,//h
48,74,74,74,124,0,//a

0,0,

38,73,73,73,50,0,//s
48,74,74,74,124,0,//a
126,26,42,68,0,//R
126,0, 0,0,         //i


127,9,25,41,70,0,//R
60,82,82,82,92,0,//e
36,74,74,82,36,0,//s
126,18,18,18,12,0,//p
48,74,74,74,124,0,//a
8,62,72,64,32,0,//t

126,0, 0,0,         //i

0,0,126,223,187,191,191,187,223,126,0,0,0,

127,9,9,1,0,
60,66,66,66,60,0,
126,26,42,68,0,//R
60,82,82,82,92,0,//e
30,32,64,32,30,0,
60,82,82,82,92,0,//e
126,26,42,68,0,//R
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,

/*60,82,82,82,92,0,//e
124,2,124,2,124,0,//m
60,66,66,60,0,//o
126,4,2,2,124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,//n
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,

//0,14,17,34,68,34,17,14,0,0,0,love
60,82,82,82,92,0,//e
124,2,124,2,124,0,//m
60,66,66,60,0,//o
126,4,2,2,124,0,//n


127,73,73,73,65,0,//E
126,26,42,68,0,//R
60,82,82,82,92,0,//e
126,4,2,2,124,0,0,0,//n

14,31,62,124,62,31,14,0,0,0,//love

127,65,65,34,28,0,//D
60,82,82,82,92,0,//e

38,73,73,73,50,0,//s
38,72,72,72,62,0,0,0,0,0,0,0,0,0,00,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0//y
*/};


unsigned char D[]={

255,255,24,24,24,24,255,255,0,//H
252,254,51,51,51,51,254,252,0,//A
255,255,51,51,51,63,30,0,//P
255,255,51,51,51,63,30,0,//P
3,7,12,248,248,12,7,3,//Y
0,0,0,0,0,
255,255,153,153,153,153,255,118,0,
255,255,0, //I
255,255,27,27,59,123,207,142,0,//R
3,3,3,255,255,3,3,3,0,//T
255,255,24,24,24,24,255,255,0,//H
0,0,0,0,0,
255,255,195,195,195,195,126,60,0,
252,254,51,51,51,51,254,252,0,//A
3,7,12,248,248,12,7,3,//Y
0,0,0,0,0,
255,255,219,219,219,195,195,0,
255,255,6,12,12,6,255,255,0,
126,255,195,129,129,195,255,126,0,
255,255,14,28,56,112,255,255,0,0,0,0,0,
0,194,227,227,243,223,206,204,0,
0,102,195,219,219,255,110,0,0,
3,3,255,255,3,3,0,
255,255,12,12,252,248,0,




};

unsigned char U[]={
/*
0,0,0,70,73,73,73,73,49,0,//s
60,82,82,82,92,0,//e
126,64,64,0,//L
48,74,74,74,124,0,//a
124,2,124,2,124,0,//m
48,74,74,74,124,0,//a
8,62,72,64,32,0,0,0,0,//t

8,62,72,64,32,0,//t
126,0,          //i
48,72,72,72,126,0,//d
62,64,64,32,126,0,//u
126,26,42,68,0,//R
0,0,0,0,0,
0,8,28,62,127,28,28,28,28,//panah
28,28,28,28,28,28,28,0,0,
0,8,28,62,127,28,28,28,28,//panah
28,28,28,28,28,28,28,0,0,
0,8,28,62,127,28,28,28,28,//panah
28,28,28,28,28,28,28,0,0,
0,8,28,62,127,28,28,28,28,//panah
28,28,28,28,28,28,28,0,0,
0,8,28,62,127,28,28,28,28,//panah
28,28,28,28,28,28,28,0,0,
0,8,28,62,127,28,28,28,28,//panah
28,28,28,28,28,28,28,0,0,
0,8,28,62,127,28,28,28,28,//panah
28,28,28,28,28,28,28,0,0,*/

//8,12,10,127,8,0,//4
255,255,224,224,231,231,0,0,231,231,255,255,
0,0,0,0,
70,73,73,73,73,49,0,//s
60,82,82,82,92,0,//e
60,66,66,66,36,0,//c
60,66,66,60,0,//o
126,4,2,2,124,0,//n
48,72,72,72,126,0,// d

0,0,0,0,0,

62,64,60,64,62,0,//w
60,82,82,82,92,0,0,0,0,0,//e

126,4,2,2,124,0,//n
60,82,82,82,92,0,//e
30,32,64,32,30,0,//v
60,82,82,82,92,0,//e
126,26,42,68,0,0,0,0,0,//R

48,72,72,72,126,0,// d
126,0,          //i
60,82,82,82,92,0,0,0,0,//e

14,31,62,124,62,31,14,0,0,0,//love

38,73,73,73,50,0,//s
126,0,          //i
126,4,2,2,124,0,//n
60,66,66,66,36,0,//c
60,82,82,82,92,0,0,0,//e

34,65,73,73,54,0,//3
66,127,64,0,0,0,0,//1

127,65,65,34,28,0,//D
60,82,82,82,92,0,//e
38,73,73,73,50,0,0,0,0,//s

66,97,81,73,70,0,//2
62,65,65,65,62,0,//0
66,127,64,0,//1
66,127,64,0,0,0,//1
127,62,28,8,
127,62,28,8,
127,62,28,8,0,0,0,0,


38,72,72,72,62,0,//y
62,64,64,32,126,0,//u
48,72,72,72,126,0,//d
126,0,0,//i
64,0,0,

124,2,124,2,124,0,//m
62,64,64,32,126,0,//u
32,66,66,66,62,0,//j
48,74,74,74,124,0,//a
126,8,8,8,112,0,//h
126,0,//i
48,72,72,72,126,0,0,//d
64,0,0,

62,64,64,64,62,0,//u
60,66,66,66,36,0,//c
126,0,0,//i
64,0,0,


124,2,124,2,124,0,//m
48,74,74,74,124,0,//a
124,2,124,2,124,0,//m
48,74,74,74,124,0,//a
48,72,72,72,126,0,//d
0,0,0,0,
8,28,62,127,8,28,62,127,8,28,62,127,

};

void clock(){
PORTC.1=0;
PORTC.2=1;
PORTC.1=1;
PORTC.2=0;
delay_us(700);}

void cepet(){
PORTC.1=0;
PORTC.2=1;
PORTC.1=1;
PORTC.2=0;
delay_us(470);}


void satu(){

 for(geser=0;geser<320;geser++){//lama tampil

            for(ulang=0;ulang<2;ulang++){//speed
            for(i=0;i<32;i++)   //i=jumlah kolom dot matrik 1 kolom =7
                {
                c=i-(33-geser);
               
                PORTD=v[c];
                if(i==1)
                data_hi;
                else
                data_lo;
                clock();
                }
                }
                }  ;}
               
                 
 void dua(){ while(3){
 for(geser=0;geser<250;geser++){//lama tampil

            for(ulang=0;ulang<2;ulang++){//speed
            for(i=0;i<29;i++)   //i=jumlah kolom dot matrik 1 kolom =7
                {
                c=i-(29-geser);
               
                PORTD=D[c];
                if(i==1)
                data_hi;
                else
                data_lo;
                clock();
                }
                }
                }  ;} };
void main(void)
{

PORTB=0xff;
DDRB=0x00;


PORTC=0x00;
DDRC=0xff;

PORTD=0x00;
DDRD=0xff;




while (1)
      { if (PINB.0==0) {  satu();
                                    };
     
         if (PINB.1==0) {  dua();
                                    };
     
     
      }
}

saya juga berhasil membuat running teks dengan ATmega 16
hasil simulasi di proteus.......

source code running teks atmega 16 :

/*****************************************************
This program was produced by the
CodeWizardAVR V2.05.3 Standard
Automatic Program Generator
© Copyright 1998-2011 Pavel Haiduc, HP InfoTech s.r.l.
http://www.hpinfotech.com

Project :
Version :
Date    : 12/12/2013
Author  : PerTic@n
Company : If You Like This Software,Buy It
Comments:


Chip type               : ATmega16
Program type            : Application
AVR Core Clock frequency: 12,000000 MHz
Memory model            : Small
External RAM size       : 0
Data Stack size         : 256
*****************************************************/

#include <mega16.h>

#include <delay.h>
#define data_hi PORTB.0=1
#define data_lo PORTB.0=0

int i,c,geser,ulang;
unsigned char U[]={

255,255,224,224,231,231,0,0,231,231,255,255,
0,0,0,0,
70,73,73,73,73,49,0,//s
60,82,82,82,92,0,//e
60,66,66,66,36,0,//c
60,66,66,60,0,//o
126,4,2,2,124,0,//n
48,72,72,72,126,0,// d

0,0,0,0,0,

62,64,60,64,62,0,//w
60,82,82,82,92,0,0,0,0,0,//e

126,4,2,2,124,0,//n
60,82,82,82,92,0,//e
30,32,64,32,30,0,//v
60,82,82,82,92,0,//e
126,26,42,68,0,0,0,0,0,//R

48,72,72,72,126,0,// d
126,0,          //i
60,82,82,82,92,0,0,0,0,//e

14,31,62,124,62,31,14,0,0,0,//love

38,73,73,73,50,0,//s
126,0,          //i
126,4,2,2,124,0,//n
60,66,66,66,36,0,//c
60,82,82,82,92,0,0,0,//e

34,65,73,73,54,0,//3
66,127,64,0,0,0,0,//1

127,65,65,34,28,0,//D
60,82,82,82,92,0,//e
38,73,73,73,50,0,0,0,0,//s

66,97,81,73,70,0,//2
62,65,65,65,62,0,//0
66,127,64,0,//1
66,127,64,0,0,0,//1
127,62,28,8,
127,62,28,8,
127,62,28,8,0,0,0,0,


38,72,72,72,62,0,//y
62,64,64,32,126,0,//u
48,72,72,72,126,0,//d
126,0,0,//i
64,0,0,

124,2,124,2,124,0,//m
62,64,64,32,126,0,//u
32,66,66,66,62,0,//j
48,74,74,74,124,0,//a
126,8,8,8,112,0,//h
126,0,//i
48,72,72,72,126,0,0,//d
64,0,0,};

void clock(){
PORTC.1=0;
PORTC.2=1;
PORTC.1=1;
PORTC.2=0;
delay_us(500);}

void cepet(){
PORTB.1=0;
PORTB.2=1;
PORTB.1=1;
PORTB.2=0;
delay_us(470);}


void dua(){
while (2){
 for(geser=0;geser<400;geser++){//lama tampil
            for(ulang=0;ulang<2;ulang++){ //speed
            for(i=0;i<30;i++)   //i=jumlah kolom dot matrik 1 kolom =7
                {
                c=i-(30-geser);
               
                PORTA=~U[c];
                if(i==1)
                data_hi;
                else
                data_lo;
                cepet();
                }
                }
                ;};}
               };


void main(void)
{
// Declare your local variables here

// Input/Output Ports initialization
// Port A initialization
// Func7=Out Func6=Out Func5=Out Func4=Out Func3=Out Func2=Out Func1=Out Func0=Out
// State7=0 State6=0 State5=0 State4=0 State3=0 State2=0 State1=0 State0=0
PORTA=0x00;
DDRA=0xFF;

// Port B initialization
// Func7=Out Func6=Out Func5=Out Func4=Out Func3=Out Func2=Out Func1=Out Func0=Out
// State7=0 State6=0 State5=0 State4=0 State3=0 State2=0 State1=0 State0=0
PORTB=0x00;
DDRB=0xFF;

// Port C initialization
// Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In
// State7=T State6=T State5=T State4=T State3=T State2=T State1=T State0=T
PORTC=0x00;
DDRC=0x00;

// Port D initialization
// Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In
// State7=T State6=T State5=T State4=T State3=T State2=T State1=T State0=T
PORTD=0x00;
DDRD=0x00;

// Timer/Counter 0 initialization
// Clock source: System Clock
// Clock value: Timer 0 Stopped
// Mode: Normal top=0xFF
// OC0 output: Disconnected
TCCR0=0x00;
TCNT0=0x00;
OCR0=0x00;

// Timer/Counter 1 initialization
// Clock source: System Clock
// Clock value: Timer1 Stopped
// Mode: Normal top=0xFFFF
// OC1A output: Discon.
// OC1B output: Discon.
// Noise Canceler: Off
// Input Capture on Falling Edge
// Timer1 Overflow Interrupt: Off
// Input Capture Interrupt: Off
// Compare A Match Interrupt: Off
// Compare B Match Interrupt: Off
TCCR1A=0x00;
TCCR1B=0x00;
TCNT1H=0x00;
TCNT1L=0x00;
ICR1H=0x00;
ICR1L=0x00;
OCR1AH=0x00;
OCR1AL=0x00;
OCR1BH=0x00;
OCR1BL=0x00;

// Timer/Counter 2 initialization
// Clock source: System Clock
// Clock value: Timer2 Stopped
// Mode: Normal top=0xFF
// OC2 output: Disconnected
ASSR=0x00;
TCCR2=0x00;
TCNT2=0x00;
OCR2=0x00;

// External Interrupt(s) initialization
// INT0: Off
// INT1: Off
// INT2: Off
MCUCR=0x00;
MCUCSR=0x00;

// Timer(s)/Counter(s) Interrupt(s) initialization
TIMSK=0x00;

// USART initialization
// USART disabled
UCSRB=0x00;

// Analog Comparator initialization
// Analog Comparator: Off
// Analog Comparator Input Capture by Timer/Counter 1: Off
ACSR=0x80;
SFIOR=0x00;

// ADC initialization
// ADC disabled
ADCSRA=0x00;

// SPI initialization
// SPI disabled
SPCR=0x00;

// TWI initialization
// TWI disabled
TWCR=0x00;

while (1)
      {
      dua();

      }
}



bagi yang serius mencoba pasti bakal bisa,,,,,,,Alhamdulillah saya sudah membuktikannya,,,
videonya bisa dilihat di youtube http://www.youtube.com/watch?v=6qbZZC-4Ceo

Untuk merubah tampilan huruf yang keluar ,saya menggunakan aplikasi ecek ecek konverter milik seseorang yang dishare di internet jg,,,hehehe sama2 berbagi ......
 
bagi yang ingin file skema rangkaian dan source code bahasa c bisa kirim PM ke facebook saya " Wahyudi Hidayat " saya lulusan Universitas Muhammadiyah malang,,elektro .karena kalo email kadang suka eror ,,,....
smoga bermanfaat....

Wassalamualaikum Wr Wb