Selasa, 07 Juni 2011
Simulasi Mikrokontroler, Membuat TRAFFICT LIGHT
05.45 |
Diposting oleh
Unknown
Kali ini kita belajar simulasi membuat traffict light sederhana. Kenapa sederhana?? hhm…. konsep traffict light sangat mudah dipahami bila kita mulai dari yang sederhana. Yaah.. kita bikin 2 lampu traffict light dulu, biar pembaca paham bagaimana cara membuat programnya.
Idenya sederhana, cuma menghidupkan lampu hijau dan merah bergantian, plus counternya. yuuk,, kita simak!
2. Ini dia komponen yang diperlukan.
- Atmega32
- 7Segment 4 buah (2 hijau, 2 merah)
- TRAFFICT LIGHT (Sudah disediakan oleh PROTEUS)
- Transistor BC107 (untuk saklar counter)
- dan resistor 10K
Gambar 1. Komponen
Gambar 2. Rangkaian
Gambar 2, saya menggunakan fasilitas wireless cable. Blok Traffict2 nampak tidak berhubungan langsung dengan AVR, namun karena dimasing2 port namanya sama, maka otomatis mereka saling berhubungan sesuai namanya. Klik pada gambar untuk melihat lebih jelas.
4. Bagaimana programnya?? yuph, ini dia program dalam bahasa BASCInya. Silakan co-pas ke BASCOM-AVR kamu.01 | $crystal = 12000000$regfile = "m32def.dat" |
02 | Config Porta = Output |
03 | Config Portb = Output |
04 | Config Portc = Output |
05 |
06 | Merah1 Alias Porta.0 |
07 | Kuning1 Alias Porta.1 |
08 | Hijau1 Alias Porta.2 |
09 | Merah2 Alias Porta.3 |
10 | Kuning2 Alias Porta.4 |
11 | Hijau2 Alias Porta.5 |
12 | Hijaucounter1 Alias Porta.6 |
13 | Merahcounter1 Alias Porta.7 |
14 | Hijaucounter2 Alias Portb.0 |
15 | Merahcounter2 Alias Portb.1 |
16 |
17 | Dim C As Integer |
18 | Declare Sub Segment(byval Dataa As Integer) |
19 |
20 | Do |
21 | Hijau1 = 1 |
22 | Kuning1 = 0 |
23 | Merah1 = 0 |
24 | Hijaucounter1 = 1 |
25 | Merahcounter1 = 0 |
26 | Hijau2 = 0 |
27 | Kuning2 = 0 |
28 | Merah2 = 1 |
29 | Hijaucounter2 = 0 |
30 | Merahcounter2 = 1 |
31 |
32 | C = 10 |
33 | Do |
34 | Call Segment(c) |
35 | Waitms 100 |
36 | Decr C |
37 | Loop Until C = 0 |
38 | Hijaucounter1 = 0 |
39 | Merahcounter2 = 0 |
40 | Hijau1 = 0 |
41 | Kuning1 = 1 |
42 | Waitms 100 |
43 | Hijau1 = 0 |
44 | Hijaucounter1 = 0 |
45 | Merahcounter1 = 1 |
46 | Kuning1 = 0 |
47 | Merah1 = 1 |
48 | Hijau2 = 1 |
49 | Kuning2 = 0 |
50 | Merah2 = 0 |
51 | Hijaucounter2 = 1 |
52 | Merahcounter2 = 0 |
53 | C = 10 |
54 | Do |
55 | Call Segment(c) |
56 | Waitms 100 |
57 | Decr C |
58 | Loop Until C = 0 |
59 | Hijaucounter2 = 0 |
60 | Merahcounter1 = 0 |
61 | Hijau2 = 0 |
62 | Kuning2 = 1 |
63 | Waitms 100 |
64 | Loop |
65 | End |
66 |
67 | Sub Segment() |
68 | Select Case Dataa |
69 | Case 0 : Portc = 0 |
70 | Case 1 : Portc = 63 '0 |
71 | Case 2 : Portc = 6 '1 |
72 | Case 3 : Portc = 91 '2 |
73 | Case 4 : Portc = 79 '3 |
74 | Case 5 : Portc = 102 '4 |
75 | Case 6 : Portc = 109 '5 |
76 | Case 7 : Portc = 125 '6 |
77 | Case 8 : Portc = 7 '7 |
78 | Case 9 : Portc = 127 '8 |
79 | Case 10 : Portc = 111 '9 |
80 | End Select |
81 | End Sub |
5. Menggunakan BASCOM-AVR, simpan dengan nama Traffict.BAS, kemudian compile.
6. Download file Traffict.HEX (hasil compile) dari AVR di PROTEUS.
7. jalankan simulasi…
Gambar 3. Hasil
Klik untuk memperbesar gambar
|
Label:
MIKROKONTROLER
Langganan:
Posting Komentar (Atom)
Labels
- 4shared.com (2)
- antivirus (2)
- Antivirus 2011 (8)
- banner (1)
- CARA MEMBUAT (4)
- Cara mendaftar (11)
- Cheat Game (8)
- deep freeze (1)
- Download (59)
- Download Aplikasi Phonsel (11)
- FD (1)
- Flasdisk (1)
- flasdisk eror (1)
- format windows (1)
- Game (14)
- Game PC (5)
- Hacker (10)
- IDM (1)
- iklan gratis (1)
- Ilmu ngeBLOG (48)
- Ilmu TEKNOLOGI (84)
- Info POLMA (19)
- Info Teknologi (4)
- instal ulang windows xp (4)
- Intenet Download manager (3)
- Internet (40)
- jaringan LAN (2)
- Kumputer (29)
- LAN (1)
- membuat banner (2)
- membuat iklan (1)
- Mendapatkan $$$ sangat mudah (2)
- MIKROKONTROLER (12)
- pasang iklan (1)
- perawatan windows (2)
- Phonsel (5)
- Soal-soal latihan (3)
- Software (39)
- Themes Windos-XP (1)
- Tukar LINK (2)
- Tutorial (71)
- uninstall (1)
- windows (11)
- windows SP2 (4)
Blog Archive
-
▼
2011
(179)
-
▼
Juni
(52)
- Cara Mudah Menghapus autorun.inf
- Google Pagerank Update | cara ceck page-rank
- Themes | Windos-XP
- Guitar Hero World Tour
- 7 Sins PC (18+ )
- SWAT 4 + Crack - Mediafire
- Modifikasi CD Installasi Windows Dengan NLite
- Asembling CD Installer WIN Xp/2000/2003
- Blue Screen Error Message
- Shortcut perintah Run di Windows XP (command line)
- Tips Bekerja Cepat Dengan Shortcut Windows XP
- Mengatasi Proteksi Klik Kanan Pada Website
- Software Mereset BIOS
- Software Protected Folder Untuk Melindungi File Pe...
- Ebook Gratis: Windows 7 Power Users Guide
- Cara Merubah Bahasa Windows 7 ke Bahasa Indonesia
- Cara Menghapus Recent Document di Microsot Word 2007
- Virtual DJ v7.0 PRO With Crack
- Universal Extractor 1.6.1.50
- Internet Download Accelerator 5.9.3.125
- Crack Aktifasi Windows 7 All Version
- Cara Mengoptimalkan IDM
- Antivirus Palsu Berkeliaran
- Tampilan Baru Blogger Draft di Tahun 2011
- Free download Game Counter strike
- Crash Time 4 : The Syndicate - FLT - Mediafire Game
- Cara Mengatasi masalah WiFi pada XP, Vista, 7 deng...
- Front Mission Evolved
- F1 2010 - Razor1911 | Duckload
- Pool Hall Pro - Reloaded
- WINNING ELEVEN 9 Full + Rip [Mediafire PC game]
- Football Manager 2008 + Update Season 2010 - 2011
- Front Mission Evolved - Mediafire
- Farming Simulator 2011 - Mediafire
- MotoGP 2 Rip - Mediafire
- Pro Evolution Soccer 2011 + Latest Patch - Mediafire
- CARA KOMPUTER MEMERIKSA LJK
- Membuat Program Portable Jadi Installan
- Membuat Software Installan Jadi Portable,
- Mengganti Logon Screen Windows
- Mengganti Booting Screen Windows
- Memanfaatkan Komputer Sebagai Efek Gitar
- Download PROTEUS V 7.1 SP4 GRATIS
- Membuat program mikrokontroler menggunakan CodeVis...
- Belajar simulasi AVR dan Seven Segment
- Simulasi Mikrokontroler, Menggunakan AVR dan LED
- Simulasi Mikrokontroler, Membuat TRAFFICT LIGHT
- Tips Membersihkan RAM Tanpa Restart
- USB Download
- Process Tools For Windows
- Key Logger | Tool Pencuri Informasi
- Cara Membuat ScreenShot Full Page Dengan Add Ons M...
-
▼
Juni
(52)
0 komentar:
Posting Komentar