LAMPIRAN A SKEMATIK RANGKAIAN
LA-1 GAMBAR RANGKAIAN CONVERTER TEGANGAN UNTUK LED BERUKURAN 8X8 Vcc R4 R3 Q4 Vcc1 Q3 R6 R5 Q6 Vcc2 Q5 R7 R8 Q7 Vcc3 Q8 R9 R10 Q9 Vcc4 Q10 Output Input Scanning(1/0) R12 R11 Q12 Vcc5 Q11 R14 R13 Q14 Vcc6 Q13 R16 R15 Q16 Vcc7 Q15 R18 R17 Q18 Q17 Ket: = PNP = NPN
LA-2 GAMBAR RANGKAIAN CONSTANT CURRENT SINK UNTUK LED UKURAN 8X8 Input Q2 D1 R1 D2 Input Q1 R2 Ket : = PNP = NPN D1-D16 = Diode 1N4148 Input = Input CPLD 33V Q4 R3 D3 D4 Input Q3 R4 Q5 R6 D6 D5 Input Q6 R5 Output Q8 Input PWM R7 D7 D8 Input Q7 R8 Q15 R16 D16 D15 Input Input Q16 R15 Q14 R13 D13 D14 Q13 R14 Q11 R12 D12 D11 Input Q12 R11 Q9 R10 D10 D9 Q10 R9
GAMBAR SKEMATIK AVR ATMEGA8515L LA-3
LAMPIRAN B LISTING PROGRAM AVR ATMEGA8515L
LB-1 //filename >> SPI.C// //************************************ This program was produced by the CodeWizardAVR V1.24.8d Professional Automatic Program Generator Copyright 1998-2006 Pavel Haiduc HP InfoTech s.r.l. http://www.hpinfotech.com Project : Version : Date : 16-Dec-2006 Author : Freeware for evaluation and noncommercial use only Company : Comments: Chip type : ATmega8515L Program type : Application Clock frequency : 4000000 MHz Memory model : Small External SRAM size : 0 Data Stack size : 128 ************************************/ void reset(void); void init(void); #include <mega8515.h> // Declare your global variables here #define t3k 0x05 #define t15k 0x04 #define t62k 0x03 #define t500k 0x02 #define t4000k 0x01 #define RC PORTA.0 #define RR PINA.1 #define SRST PORTA.2 #define SCK PORTA.3 #define MOSI PORTA.4 int idata=0 iaddr; char status=0; #include "lain/anim.h" //bisa diganti dengan gambar yang lain //dengan mengganti file header yang berisi data // Timer 1 overflow interrupt service routine interrupt [TIM1_OVF] void timer1_ovf_isr(void) // Place your code here if(status) idata++; } status=!status; if (idata==ndata) idata=0; // SPI functions #include <spi.h> #include <delay.h> void init(void) // Declare your local variables here // Input/Output Ports initialization // Port A initialization // Func7=In Func6=In Func5=In Func4=Out //Func3=Out Func2=Out Func1=In Func0=Out // State7=T State6=T State5=T State4=0 //State3=0 State2=1 State1=T State0=0 PORTA=0x04; DDRA=0x1D; // Port B initialization // Func7=Out Func6=In Func5=Out Func4=Out //Func3=In Func2=In Func1=In Func0=In // State7=0 State6=T State5=0 State4=0 //State3=T State2=T State1=T State0=T PORTB=0x00; DDRB=0xB0; // 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; // Port E initialization // Func2=In Func1=In Func0=In // State2=T State1=T State0=T PORTE=0x00; DDRE=0x00; // Timer/Counter 0 initialization // Clock source: System Clock // Clock value: Timer 0 Stopped // Mode: Normal top=ffh // OC0 output: Disconnected TCCR0=0x00; TCNT0=0x00; OCR0=0x00; // Timer/Counter 1 initialization
LB-2 // Clock source: System Clock // Clock value: 15625 khz // Mode: Normal top=ffffh // OC1A output: Discon. // OC1B output: Discon. // Noise Canceler: Off // Input Capture on Falling Edge // Timer 1 Overflow Interrupt: On // Input Capture Interrupt: Off // Compare A Match Interrupt: Off // Compare B Match Interrupt: Off TCCR1A=0x00; TCCR1B=t62K; TCNT1H=0x00; TCNT1L=0x00; ICR1H=0x00; ICR1L=0x00; OCR1AH=0x00; OCR1AL=0x00; OCR1BH=0x00; OCR1BL=0x00; // External Interrupt(s) initialization // INT0: Off // INT1: Off // INT2: Off MCUCR=0x00; EMCUCR=0x00; // Timer(s)/Counter(s) Interrupt(s) initialization TIMSK=0x80; // Analog Comparator initialization // Analog Comparator: Off // Analog Comparator Input Capture by //Timer/Counter 1: Off ACSR=0x80; // SPI initialization // SPI Type: Master // SPI Clock Rate: 0000 khz // SPI Clock Phase: Cycle Half // SPI Clock Polarity: High // SPI Data Order: MSB First //SPCR=0x5B; SPCR=0x58; SPSR=0x00; // Global enable interrupts #asm("sei") } void reset(void) SRST=0; delay_us(1); SRST=1; RC=0; iaddr=0; SCK=0; } void main(void) int i; init(); reset(); while (1) // Place your code here if (RR==1) for (i=0; i<8; i++) spi(getdata(idataiaddr++)); //spi(iaddr); if (iaddr==szdata) iaddr=0; } RC = 1; RC = 0; } }; }
LB-3 //filename >> kotak.h// #ifndef HEADER_SKRIPSI #define HEADER_SKRIPSI typedef unsigned char BYTE; #define ndata 13 #define ncol 8 #define nrow 8 #define szdata 64 #define getdata(nindex) (data[((n)*szdata) + (index)]) flash BYTE data[ndata * szdata] = 255 223 191 159 127 95 63 31 255 223 191 159 127 95 63 31 255 223 191 159 127 95 63 31 255 223 191 159 127 95 63 31 255 223 191 159 127 95 63 31 255 223 191 159 127 95 63 31 255 223 191 159 127 95 63 31 255 223 191 159 127 95 63 31 0 255 0 0 0 0 255 0 0 255 0 0 0 0 255 0 0 255 0 0 0 0 255 0 0 255 0 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 255 0 0 255 0 0 0 0 255 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 255 255 0 0 0 0 0 0 255 255 0 0 0 0 0 0 0 0 0 0 0 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 127 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 191 255 255 255 255 255 255 255 255 0 0 0 0 0 0 0 0 255 0 0 0 0 0 0 255 255 0 255 255 255 255 0 255 255 0 255 255 255 255 0 255 255 0 255 255 255 255 0 255 255 0 255 255 255 255 0 255 255 0 0 0 0 0 0 255 255 255 255 255 255 255 255 255 255 255 0 0 0 0 255 255 255 255 0 255 255 0 255 255 255 255 0 255 255 0 255 255 255 255 0 0 0 0 255 255 255 255 255 255 255 255 255 255
LB-4 255 255 255 0 0 255 255 255 255 255 255 0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 }; #endif //filename >> anim.h// #ifndef AKHIR_H #define AKHIR_H #define ndata 33 #define ncol 8 #define nrow 8 #define szdata 64 #define getdata(nindex) (data[(n)][(index)]) unsigned char flash data[ndata][szdata]= 255 223 191 160 120 90 60 30 //1 0 0 0 0 0 0 0 0} 0 0 0 128 0 0 0 0 //2 0 0 128 0 0 0 0 0 0 128 0 0 0 0 0 0 128 0 0 0 0 0 0 0 63 0 0 0 0 0 0 0 0 63 0 0 0 0 0 0 0 0 63 0 0 0 0 0 0 0 0 63 0 0 0 0} 0 0 0 191 0 0 0 0 //3 0 0 191 0 0 0 0 0 0 191 0 0 0 0 0 0 191 0 0 0 0 0 0 0 128 0 0 0 0 0 0 63 0 128 0 0 0 0 63 0 0 0 128 0 0 63 0 0 0 0 0 128 63 0 0 0} 0 0 0 255 63 0 0 0 //4 0 0 255 0 0 63 0 0 0 255 0 0 0 0 63 0 255 0 0 0 0 0 0 63 191 0 0 0 0 0 0 128 0 191 0 0 0 0 128 0 0 0 191 0 0 128 0 0 0 0 0 191 128 0 0 0} 0 0 0 255 128 0 0 0 //5 0 0 255 0 0 128 0 0 0 255 0 0 0 0 128 0 255 0 0 0 0 0 0 128 255 0 0 0 0 0 0 191 0 255 0 0 0 0 191 0 0 0 255 0 0 191 0 0 0 0 0 255 191 0 0 0} 0 0 0 255 191 0 0 0 //6 0 0 255 0 0 191 0 0 0 255 0 0 0 0 191 0 255 0 0 0 0 0 0 191 255 0 0 0 0 0 0 255 0 255 0 0 0 0 255 0 0 0 255 0 0 255 0 0 0 0 0 255 255 0 0 0}
LB-5 0 0 0 255 255 0 0 0 //7 0 0 255 0 0 255 0 0 0 255 0 0 0 0 255 0 255 0 0 0 0 0 0 255 255 0 0 0 0 0 0 255 0 255 0 0 0 0 255 0 0 0 255 0 0 255 0 0 0 0 0 255 255 0 0 0} 0 0 0 255 255 0 0 0 //8 0 0 255 255 0 255 0 0 0 255 255 0 0 0 255 0 255 255 0 0 0 0 0 255 255 0 0 0 0 0 0 255 0 255 0 0 0 0 255 0 0 0 255 0 0 255 0 0 0 0 0 255 255 0 0 0} 0 0 0 255 255 0 0 0 //9 0 0 255 255 0 255 0 0 0 255 255 0 0 0 255 0 255 255 0 0 0 0 0 255 255 255 0 0 0 0 0 255 0 255 255 0 0 0 255 0 0 0 255 255 0 255 0 0 0 0 0 255 255 0 0 0} 0 0 0 255 255 0 0 0 //10 0 0 255 255 0 255 0 0 0 255 255 0 0 0 255 0 255 255 0 0 0 0 0 255 255 255 0 0 0 0 255 255 0 255 255 0 0 255 255 0 0 0 0 255 255 0 0 0} 0 0 0 255 255 0 0 0 //11 0 255 255 0 0 255 255 0 255 255 0 0 0 0 255 255 255 255 0 0 0 0 255 255 0 255 255 0 0 255 255 0 0 0 0 255 255 0 0 0} 0 0 0 255 255 0 0 0 //12 255 255 255 0 0 255 255 255 255 255 255 0 0 255 255 255 0 0 0 255 255 0 0 0} 0 0 0 255 255 0 0 0 //13 0 255 255 170 170 255 255 0 255 255 170 0 0 170 255 255 255 255 170 0 0 170 255 255 0 255 255 170 170 255 255 0 0 0 0 255 255 0 0 0} 0 0 0 255 255 0 0 0 //14 0 255 255 85 85 255 255 0 255 255 85 0 0 85 255 255 255 255 85 0 0 85 255 255 0 255 255 85 85 255 255 0 0 0 0 255 255 0 0 0} 0 0 0 255 255 0 0 0 //15 0 0 255 170 170 255 0 0 0 255 170 64 64 170 255 0 255 170 64 0 0 64 170 255 255 170 64 0 0 64 170 255 0 255 170 64 64 170 255 0 0 0 255 170 170 255 0 0 0 0 0 255 255 0 0 0} 0 0 0 170 170 0 0 0 //16 0 0 170 85 85 170 0 0 0 170 85 0 0 85 170 0 170 85 0 0 0 0 85 170 170 85 0 0 0 0 85 170 0 170 85 0 0 85 170 0 0 0 170 85 85 170 0 0 0 0 0 170 170 0 0 0} 0 0 0 85 85 0 0 0 //17 0 0 85 0 0 85 0 0 0 85 0 0 0 0 85 0 85 0 0 0 0 0 0 85 85 0 0 0 0 0 0 85 0 85 0 0 0 0 85 0 0 0 85 0 0 85 0 0 0 0 0 85 85 0 0 0} //18 0 0 0 0 0 0 0 0} //19 0 0 0 32 32 0 0 0 0 0 0 32 32 0 0 0 0 0 0 0 0 0 0 0}
LB-6 //20 0 0 0 32 32 0 0 0 0 0 32 96 96 32 0 0 0 0 32 96 96 32 0 0 0 0 0 32 32 0 0 0 0 0 0 0 0 0 0 0} //21 0 0 0 32 32 0 0 0 0 0 32 96 96 32 0 0 0 32 96 190 190 96 32 0 0 32 96 190 190 96 32 0 0 0 32 96 96 32 0 0 0 0 0 32 32 0 0 0 0 0 0 0 0 0 0 0} 0 0 0 32 32 0 0 0 //22 0 0 32 96 96 32 0 0 0 32 96 190 190 96 32 0 32 96 190 255 255 190 96 32 32 96 190 255 255 190 96 32 0 32 96 190 190 96 32 0 0 0 32 96 96 32 0 0 0 0 0 32 32 0 0 0} 0 0 0 96 96 0 0 0 //23 0 0 96 190 190 96 0 0 0 96 190 255 255 190 96 0 96 190 255 255 255 255 190 96 96 190 255 255 255 255 190 96 0 96 190 255 255 190 96 0 0 0 96 190 190 96 0 0 0 0 0 96 96 0 0 0} 0 0 0 190 190 0 0 0 //24 0 0 190 255 255 190 0 0 0 190 255 255 255 255 190 0 190 255 255 255 255 255 255 190 190 255 255 255 255 255 255 190 0 190 255 255 255 255 190 0 0 0 190 255 255 190 0 0 0 0 0 190 190 0 0 0} 0 0 0 255 255 0 0 0 //25 0 0 0 255 255 0 0 0} 0 0 0 128 128 0 0 0 //26 0 0 128 255 255 128 0 0 0 128 255 255 255 255 128 0 128 255 255 255 255 255 255 128 128 255 255 255 255 255 255 128 0 128 255 255 255 255 128 0 0 0 128 255 255 128 0 0 0 0 0 128 128 0 0 0} //27 0 0 0 0 0 0 0 0} //28 0 0 128 128 128 128 0 0 0 128 255 255 255 255 128 0 0 128 255 255 255 255 128 0 0 128 255 255 255 255 128 0 0 128 255 255 255 255 128 0 0 0 128 128 128 128 0 0 0 0 0 0 0 0 0 0} //29 0 0 0 0 0 0 0 0} //30 0 0 128 128 128 128 0 0 0 0 128 255 255 128 0 0 0 0 128 255 255 128 0 0 0 0 128 128 128 128 0 0 0 0 0 0 0 0 0 0} //31 0 0 0 255 255 0 0 0 0 0 0 255 255 0 0 0 0 0 0 0 0 0 0 0} //32 0 0 0 128 128 0 0 0 0 0 0 128 128 0 0 0 0 0 0 0 0 0 0 0}
LB-7 //33 0 0 0 0 0 0 0 0} }; #endif