Professional Documents
Culture Documents
1. Development System
2. Digital I/O
3. Traffic Light Controller
4. 7 Segment Display
5. LCD
6. Dot Matrik
7. Keypad
8. Serial RS232
9. Sensor suhu LM35
10. USB Downloader
Kelengkapan : Keterangan :
Konektor J1 sd J4 merupakan port ekspansi dari PORTA, PORTB, PORTC dan PORTD :
1. Kabel koneksi (pelangi 10 pin) : 2
No Pin J1 J2 J3 J4
2. Kabel koneksi (pelangi 6 pin) : 1
1 PORTA.0 PORTB.0 PORTC.0 PORTD.0
3. Kabel USB printer 2 PORTA.1 PORTB.1 PORTC.1 PORTD.1
4. Kabel Serial 3 PORTA.2 PORTB.2 PORTC.2 PORTD.2
5. Power Supply 4 PORTA.3 PORTB.3 PORTC.3 PORTD.3
5 PORTA.4 PORTB.4 PORTC.4 PORTD.4
6 PORTA.5 PORTB.5 PORTC.5 PORTD.5
7 PORTA.6 PORTB.6 PORTC.6 PORTD.6
8 PORTA.7 PORTB.7 PORTC.7 PORTD.7
9 VCC VCC VCC VCC
10 GND GND GND GND
Konektor J5 adalah koneksi dengan USB Downloader. 4 Digit 4 control Segment d control
5 Digit 5 control Segment e control
No Pin J5 6 Digit 6 control Segment f control
1 MISO 7 Digit 7 control Segment g control
2 MOSI 8 Digit 8 control Segment h control
3 SCK 9 VCC -
4 SS 10 - -
5 RST
6 GND
3. DIGITAL I/O
No Pin J1 J2
1 Dig.Out 1 (L1) Dig.Input 1 (sw 1)
2 Dig.Out 2 (L2) Dig.Input 2 (sw 2)
3 Dig.Out 3 (L3) Dig.Input 3 (sw 3)
4 Dig.Out 4 (L4) Dig.Input 4 (sw 4)
5 Dig.Out 5 (L5) Dig.Input 5 (sw 5)
6 Dig.Out 6 (L6) Dig.Input 6 (sw 6)
7 Dig.Out 7 (L7) Dig.Input 7 (sw 7)
8 Dig.Out 8 (L8) Dig.Input 8 (sw 8)
Keterangan : 9 VCC -
10 - GND
No Pin J1 J2
1 Digit 1 control Segment a control
2 Digit 2 control Segment b control
3 Digit 3 control Segment c control
Keterangan :
No Pin J1
1 Row 1
2 Row 2
3 Row 3
4 Row 4
5 Column 1
Keterangan : 6 Column 2
7 Column 3
8 -
No Pin J1 J2 9 -
1 RS Pemilih koneksi pin RW. 10 -
2 Option Jika RW akan diaktifkan
3 E posisi jumper pada : 1-2
4 D4 Jika RW langsung di-ground-
5 D5 kan posisi jumper pada : 2-3
6. TRAFFIC LIGHT CONTROLLER
6 D6
7 D7
8 D8
9 VCC
10 GND
Untuk mengatur kecerahan tulisan digunakan trimpot contrast
Keterangan : Keterangan :
No Pin J1 J2 No Pin J1 J2
1 H2 control H1 control 1 Baris 1 Kolom 1
2 K2 control K1 control 2 Baris 2 Kolom 2
3 M2 control M1 control 3 Baris 3 Kolom 3
4 M3 control H4 control 4 Baris 4 Kolom 4
5 - K4 control 5 Baris 5 Kolom 5
6 - M4 control 6 Baris 6 -
7 - H3 control 7 Baris 7 -
8 - K3 control 8 - -
9 Vcc - 9 - VCC
10 - - 10 - -
7. DOT MATRIX
8. RS-232 CONVERTER
TX = Transmitter (terhubung ke
pin TXD microcontroller)
RX = Receiver (terhubung ke
pin RXD microcontroller)
PC.6 7 / LED 7
PC.7 8 / LED 8
+5V 9 /+5V
GND 10
End
Ddrc = &HFF
Ddra = &HFF
Do
Do
Porta = &B11011110
Portc = &B11110011
Wait 3
Porta = &B11011101
Portc = &B11110011
Hubungan antara mikrokontroler dengan LED : Wait 1
Mikrokontroller Traffic Light Mikrokontroller Traffic Light Porta = &B11110011
PA.0 1 / H1 PC.0 1 / H4 Portc = &B11110011
PA.1 2 / K1 PC.1 2 / K4 Wait 3
PA.2 3 / M1 PC.2 3 / M4
Porta = &B11101011
PA.3 4 / H2 PC.4 4 /M3
Portc = &B11110011
PA.4 5 / K2 - -
PA.5 6 / M2 - - Wait 1
PA.6 7 / H3 - - Porta = &B10011011
PA.7 8 / K3 - - Portc = &B11111011
+5V 9 - - Wait 3
GND 10 - - Porta = &B01011011
Portc = &B11111011
Buat program di BASCOM-AVR : Wait 1
'====================================== Porta = &B11011011
'Program 2: Traffic Light Portc = &B11110110
'Chip : ATmega8535 Wait 3
'Clock : 16.000.000 Hz Porta = &B11011011
'====================================== Portc = &B11110101
' www.inkubator-teknologi.com @2012 Wait 1
'====================================== Loop
$regfile = "m8535.dat" End
$crystal = 16000000
Compile kemudian download ke mikrokontroler. Bisa juga download langsung PB.7 8 / seg h PD.7 8 / dig 8
file Program2.hex yang ada di CD. +5V 9 +5V 9
Hasil : LED akan nyala dengan konfigurasi seperti pada traffic light. GND 10 GND 10
Compile kemudian download ke mikrokontroler. Cara mendownload lihat di file Buat program di BASCOM-AVR :
Instalasi USB Downloader.pdf '======================================
Bisa juga download langsung file Program7.hex yang ada di CD. 'Program 7: Membaca Keypad 3x4 tampil di LCD
Hasil : LED 1, 3, 5, 7 nyala. LED 2, 4, 6, 8 padam. 'Chip : ATmega8535
'Clock : 16.000.000 Hz
'============================================
Praktikum 7 : Keypad ' www.inkubator-teknologi.com @2012
'============================================
Koneksikan J4 (PORTD) pada Development System ke J1 pada LCD. Gunakan $regfile = "m8535.dat"
kabel pelangi 10 pin. Jumper J2 pada LCD pada posisi 2+3 $crystal = 16000000
Koneksikan J3 (PORTC) pada Development System ke J1 pada Keypad. Gunakan Ddrc = &B11110000
kabel pelangi 10 pin. Portc = &HFF
Config Lcdpin = Pin , Rs = Portd.0 , E = Portd.2 , Db4 = Portd.4
Config Lcdpin = Pin , Db5 = Portd.5 , Db6 = Portd.6 , Db7 = Portd.7
Config Lcd = 16 * 2
Cursor Off
Cls
Lcd "Tekan Keypad"
Do
Hubungan antara mikrokontroler dengan Keypad dan LCD :
'kolom 1 aktif
Portc = &B11101111
Mikrokontroler Keypad Mikrokontroler LCD
If Pinc.0 = 0 Then
PC.0 1 / Row 1 PD.0 1 / RS
PC.1 2 / Row 2 GND 2 / RW Locate 2 , 1
PC.2 3 / Row 3 PD.2 3/E Lcd "Tombol 1"
PC.3 4 / Row 4 PD.3 4/- Elseif Pinc.1 = 0 Then
PC.4 5 / Col 1 PD.4 5 / DB4 Locate 2 , 1
PC.5 6 / Col 2 PD.5 6 / DB5 Lcd "Tombol 4"
PC.6 7 / Col 3 PD.6 7 / DB6 Elseif Pinc.2 = 0 Then
PC.7 PD.7 8 / DB7 Locate 2 , 1
+5V 9 +5V 9 Lcd "Tombol 7"
GND 10 GND 10
Elseif Pinc.3 = 0 Then
'kolom 3 aktif
Portc = &B10111111
If Pinc.0 = 0 Then
Locate 2 , 1
Lcd "Tombol 3" Hubungan antara mikrokontroler dengan modul RS-232 :
Elseif Pinc.1 = 0 Then Minsis 16 Modul Serial
Locate 2 , 1 PD.0 / RXD RX
Lcd "Tombol 6" PD.1 / TXD TX
Elseif Pinc.2 = 0 Then +5V +5V
Locate 2 , 1 GND GND
Lcd "Tombol 9"
SCHEMATICS : VCC
R16
1. Development System R4 R3 R5 R6 R19 R7 R8
330 330 330 330 330 330 330 330
J12
VCC
C5 100 nF 1 2
D2 D3 D4 D5 D12 D6 D7 3 4
U18
10
D11 VCC 5 6
40 22 LED LED LED LED LED LED LED 7 8
VCC
39 PA0(ADC0) (SCL)PC0 23 J8 9 10
J6
38 PA1(ADC1) (SDA)PC1 24
1 2 37 PA2(ADC2) PC2 25 1 2 CON10A
3 4 36 PA3(ADC3) PC3 26 3 4
5 6 35 PA4(ADC4) PC4 27 VCC 5 6
7 8 34 PA5(ADC5) PC5 28 7 8
VCC 9 10 33 PA6(ADC6) (TOSC1)PC6 29 9 10
PA7(ADC7) (TOSC2)PC7 CON10A
CON10A
1 14
2 PB0(XCK/TO) (RXD)PD0 15
3 PB1(T1) (TXD)PD1 16
4 PB2(INT2/AIN0)(INT0)PD2 17
5 PB3(OC0/AIN1)(INT1)PD3 18
6 PB4(SS) (OC1B)PD4 19
J7
7 PB5(MOSI) (OCB1A)PD5 20 J9
1 2 8 PB6(MISO) (ICP1)PD6 21
3 4 PB7(SCK) (OC2)PD7 1 2
VCC 5 6 9 30 3 4
7 8 RST AVCC VCC 5 6
9 10 12 31 7 8
XTAL2 GND 9 10
CON10A Y1
GND
13 32 CON10A
XTAL1 AREFF
J15 11.0592MHz
11
C2 C3 ATMega8535
5 22pF 22pF
4 VCC VCC 1 2
3
2 J3 3 4
VCC VCC
1
SW1 R1 L1 10uF D14 J3 5 6
2 7 8
1 LED 1
CON5
2 SW1 SW2 SW3 SW4 SW5 SW6 SW7 SW8 9 10
RESET C1 C4
10nF
4K7 CON2 100nF CON10A
CON2
R1
220
D3
VCC 5. Dot Matrik
R1 330
VCC
J1
D2
LED R2 330
1 2
3 4 VCC VCC
3
R8 7 x 330
5 6 BC557
2
7 8 R1 7 x 330
D4
LED R3 330 Q1
9 10
1
CON10A R10 R11 R12 R6 R5 R4 D1 D2 D3 D4 D5
3
330 330 330 LED J1 R9
BC557
2
1 2 Q2 R2
3 4
5 6
D3 D2 D4 D3 D2 D4
1
7 8 D6 D7 D8 D9 D10
9 10
LED LED LED LED LED LED RESISTOR
3
R10
BARIS BC557
2
Q3 R3
J2 VCC
1
D3 R9 330 D11 D12 D13 D14 D15
1 2
3 4
3
R11
BC557
5 6 2
Q4 R4
7 8 D2
LED R8 330
9 10
1
D16 D17 D18 D19 D20
CON10A
3
D4 R12
LED R7 330 BC557
2
Q5 R5
1
D21 D22 D23 D24 D25
LED
3
R13
BC557
2
Q6 R6
4. 7 Segment
1
D26 D27 D28 D29 D30
3
R14
BC557
2
Q7 R7
1
J2 a
D31 D32 D33 D34 D35
b
1 2 c J2
3 4 d 1 2
5 6 e 3 4
7 8 f 5 6
9 10 g o o o o o o o o 7 8
9 10
CON10A h
KOLOM
R2 330
1
1
R3 330
2 Q2 2 Q1 2 Q5 2 Q6 2 Q7 2 Q8 2 Q9 2 Q10
VCC
BC557 BC557 BC557 BC557 BC557 BC557 BC557 BC557
3
3
J1
1 2
3 4
VCC 5 6
7 8
9 10
CON10A
1 2 3
VCC
J1 SW5 SW6 SW7
1 2
CONNECTOR DB9 (MALE)
16
4 5 6
3 4 U3 MAX232
5 6 12 13 1
SW8 SW9 SW10
VCC
7 8 PORTD.0 R1OUT R1IN
9 10 8 9 6
7 8 9 11 R2IN R2OUT 14 2
CON10A PORTD.1 T1IN T1OUT
10 7 7
SW11 SW12 SW13 C5 T2IN T2OUT 3
* 0 # 1 8
1uF C+ 2 4
3 V+ 9
4 C1- C6 5
C4 C2+ 6 1uF
GND
1uF 5 V- P2
C2- C7
1uF
15
7. LCD 2x16
LCD 2X16
10
11
12
13
14
15
16
VCC VCC
1
2
3
4
5
6
7
8
9
VCC
VCC VCC
1
2 J1 U1 LM35
1
Trimport 2
J2 1 2 1 2
3 4 VS+ VOUT 3
1 5 6 R1 HEADER 3
GND
2 7 8 47
3
3 VCC 9 10
CON10A
CON3
3
C1
1uF C2
1uF