LAMPIRAN A
LA-1
GAMBAR RANGKAIAN CONVERTER TEGANGAN UNTUK LED
BERUKURAN 8X8
Input Scanning(1/0) Ket: BC177 = PNP BC107 = NPN Output R3 1k R4 1k R5 1k R6 1k R7 1k R8 1k R9 1k R10 1k R11 1k R12 1k R13 1k R14 1k R15 1k R16 1k R17 1k R18 1k Vcc 5V Q3 BC177 Q4 BC107 Vcc1 5V Q5 BC177 Q6 BC107 Q7 BC107 Q8 BC177 Vcc2 5V Q9 BC107 Q10 BC177 Vcc3 5V Vcc4 5V Q11 BC177 Q12 BC107 Vcc5 5V Q13 BC177 Q14 BC107 Vcc6 5V Q15 BC177 Q16 BC107 Vcc75V Q17 BC177 Q18 BC107LA-2
GAMBAR RANGKAIAN CONSTANT CURRENT SINK UNTUK LED UKURAN
8X8
Inpu t PWM Outpu t Input Inpu t Input Input Inpu t In put Input Input Ket : BC177 = PNP BC107 = NPN D1-D16 = Diode 1N4 148 Input = Input CPLD 3,3V Q1 6 BC107 Q1 5 BC 17 7 D16 DIODE D15 DI OD E D1 4 DI OD E D13 DIODE Q1 4 BC 17 7 Q1 3 BC107 Q1 2 BC107 Q11 BC177 D1 2 DI OD E D11 DI OD E Q1 0 BC107 Q9 BC17 7 D10 DIODE D9 DI OD E D8 DIO DE D7 DIODE Q8 BC177 Q7 BC10 7 D5 DI OD E D6 DIODE Q5 BC17 7 Q6 BC10 7 Q3 BC10 7 Q4 BC17 7 D3 DIODE D4 DIODE D2 DIO DE D1 DIODE Q2 BC177 Q1 BC10 7 R1 6 10 0 R15 10 oh m R1 4 10 oh m R1 3 10 0 R1 2 10 0 R1 1 10 o hm R1 0 10 0 R9 10 o hm R8 10 o hm R7 100 R5 10 ohm R6 100 R3 100 R4 10 o hm R2 10 o hm R1 100LA-3
LAMPIRAN B
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 non-commercial use only
Company : Comments:
Chip type : ATmega8515L Program type : Application Clock frequency : 4,000000 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;
LB-2
// Clock source: System Clock // Clock value: 15,625 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: 1000,000 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(iData,iAddr++)); //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(n,index) (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, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 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, 255, 0, 0, 0, 0, 255, 0, 0, 255, 255, 255, 255, 255, 255, 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, 255, 255, 255, 255, 0, 0, 0, 0, 255, 0, 0, 255, 0, 0, 0, 0, 255, 0, 0, 255, 0, 0, 0, 0, 255, 255, 255, 255, 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, 0, 255, 255, 0, 0, 0, 0, 0, 0, 255, 255, 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 , 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, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 0, 0, 255, 255, 255, 255, 255, 255, 0, 0, 255, 255, 255, 255, 255, 255, 0, 0, 255, 255, 255, 255, 255, 255, 0, 0, 255, 255, 255, 255, 255, 255, 0, 0, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 255, 255, 255, 255, 255, 255, 255, 255, 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, 255, 255, 255, 255, 255, 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, 255, 255, 255, 255, 255, 255, 255, 255 ,
LB-4
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 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, 255, 255, 255, 255, 255, 255, 255, 255 , 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 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(n,index) (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, 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, 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},