DT-IO Application Note

dokumen-dokumen yang mirip
DT-I/O DT-I/O. Application Note AN171

SPC Application Note. SPC IR Transceiver. Gambar 1 Blok Diagram AN159. RX (PORTD.0 J13 pin3 / J4 pin2)

Starter Kit Application Note AN165 - Update Tampilan Character LCD Berbasis USB Flash Disk

DT-BASIC Application Note

DT-BASIC Application Note

DT-AVR Application Note

PC-Link Application Note

DT-I/O. DT-I/O Application Note

DT-AVR Application Note

SPC SPC. SPC Application Note AN175 Bluetooth Mobile Robot. Application Note AN175

DT-AVR Application Note AN191 SMS Gateway dengan GSM STARTER KIT

DHT11 Temperature and Humidity Sensor Board Gambar 1 Blok Diagram AN196. 5V (Power) GND (Power)

DT-PROTO Application Note AN219 Kontrol Lampu Secara Nirkabel berbasiskan Smarphone Android dan

DT-AVR Low Cost Micro System. Gambar 1 Blok Diagram AN154. RXD (J13 Pin 3) TXD (J8 Pin 4) GND (J10/J11/J12/J13 Pin 1) GND (J7/J8 Pin 1)

DT-AVR. Application Note AN214

DT-AVR. AVR Application Note AN160 Graphic LCD Dengan Bahasa C. Application Note AN160

DT-I/O. I/O Application Notes AN164 Komunikasi Jarak Jauh antara 2 PC dengan RS-485. Application Note AN164

DT-AVR Application Note. Gambar 1 Blok Diagram AN133

DT-Sense Current Sensor With OpAmp Gambar 1 Blok Diagram AN212

DT-SENSE Application Note

DT-AVR Application Note

PC-Link. 1x Komputer / Laptop dengan OS Windows 2000, Windows XP atau yang lebih tinggi. Gambar 1 Blok Diagram AN200

DT-SENSE Application Note

DT-I/O DT-I/O. Application Note. Application Note AN193

DT-51 Application Note

DT-AVR Low Cost Nano System. Gambar 1 Blok Diagram Remote TV Berbasis ATtiny2313. DT-I/O I/O Logic Tester

PC-Link Application Note

PC-Link. Gambar 1 Blok Diagram AN201. AGND (J3 pin 1) Pin 1 VCC (J3 pin 2) Pin 3 Dapat dipilih salah satu dari A0 s.d. A7 (J3 pin 3 s.d.

DT-AVR Application Note

DT-AVR Application Note

PC-Link. PC-Link. Application Note AN202

DT-AVR DT-AVR ApplicationNote

DT-AVR. Application Note AN213

STARTER KIT Application Note AN162 Web Scrapping Dengan GSM STARTER KIT

DT-AVR Application Note

DT-AVR. Gambar 1 Blok Diagram AN177

DT-AVR Application Note

DT Series Application Note

SPC Application Note. SPC Blue-Link (J2) Tabel 1 Hubungan SPC Blue-Link Dengan Komputer

DT-AVR Application Note. AN186 Digital Compass

DT-AVR Application Note

DT-51 Application Note

Gambar 1 Diagram Blok AN215. DT-AVR Maxiduino DT-Proto Header Shield DT-I/O Level Converter

DT-ARM Application Note. AN221 Web Server I/O Remote

DT-SENSE Application Note

DT-SENSE Application Note AN168 Color Game. Gambar 1 Blok Diagram AN168

Gambar 1 Blok Diagram AN190. P1.0 (J3 pin 3) IN1 (J1 pin3) Tabel 1 Hubungan antar PC-Link Serial PPI dan DT-I/O Quad Relay Board12V

PC-Link Application Note

DT-SENSE Color Sensor Q uick S tart

DT-AVR Application Note

DT-AVR Application Note

PC-Link Application Note

DT-Sense Application Note

Gambar 1 Blok Diagram AN217. DT-AVR Maxiduino DT-Proto Header Shield DT-I/O Level Converter

DT-I/O. Application Note AN211. Komunikasi data saat ini terus dikembangkan dan diimplementasikan di dalam setiap bidang, seperti proses

DT-AVR DT-AVR Application Note

DT-51 Application Note

DT-AVR Application Note

EMS Application Note. 1x Kabel USB 1x Komputer (Memiliki wireless adapter, serta wireless network melalui router atau program Connectify)

DT-AVR Application Note Monitoring Suhu Nirkabel (Bahasa BASIC)

DT-51 Application Note

AVR Application Note AN187 Monitoring Suhu Nirkabel (Bahasa C)

DT-AVR Application Note

DT-51 Application Note

Akses SD Card & FRAM Menggunakan AVR. Oleh: Tim IE

DT-SENSE. Temperature Sensor

DT-BASIC Application Note

PC-Link Application Note

DT-AVR Application Note

Gambar 1 Blok Diagram AN190. P1.0 (J3 pin 3) IN1 (J1 pin3) Tabel 1 Hubungan antar PC-Link Serial PPI dan DT-I/O Quad Relay Board12V

DT-SENSE. Humidity Sensor

DT-SENSE. Barometric Pressure & Temperature Sensor

DT-SENSE. UltraSonic Ranger (USR)

DT-BASIC Mini System. Gambar 1 Blok Diagram AN132

DT-AVR. DT-AVR Application Note AN207 Library USB Controller untuk Komunikasi Serial pada DT-AVR Inoduino

de KITS Application Note AN54 How 2 Use de KITS AVR ISP Programmer Cable

DT-AVR. Application Note AN192 - Web Based Temperature Monitoring System Oleh : Tim IE

AVR Application Note AN95 Wireless Chatting with PC

DT-SENSE. Temperature & Humidity Sensor

DT-AVR Application Note

DT-BASIC Application Note

DT-51 Application Note

DT-AVR Application Note

DT-51 Application Note

de KITS Application Note AN30 Rotating Display with DT-51 MinSys & de KITS SPC DC Motor

DT-AVR Low Cost Nano. System. Gambar 1 Blok Diagram AN153. RXD TXD (J8 Pin 4) GND GND (J8 Pin 1)

DT-AVR. DT-AVR Application Note AN208 Library USB Controller untuk Komunikasi Paralel pada DT-AVR Inoduino

DT-AVR DT-AVR. Application Note AN203

DT-51 Application Note

Application Note. Oleh: Tim Digiware dan Hadid T.B. - Sihmanto - Idam F.R. (Institut Teknologi Sepuluh Nopember)

Akses SD Card & FRAM Menggunakan MCS-51. Oleh: Tim IE

DT-SENSE. Color Sensor

asic Application Note AN97 BASIC Chatting

DT-AVR Application Note

DT-SENSE. IR Proximity Detector

DT-AVR Application Note

GPS Starter Kit Application Note AN GPS - GPS Navigator. Oleh: Tim IE

Application Note. Adapun blok diagram secara keseluruhan adalah sebagai berikut: AN156 Touch Screen Panel Graphic LCD 320 x 240

Gambar 1 Blok Diagram AN72. (a) (b) (c) Gambar 2 SPC Seven Segment (a), DT-51 Low Cost Micro System (b), dan DT-51 Low Cost Nano System (c)

BAB V PENGUJIAN DAN ANALISIS. dapat berjalan sesuai perancangan pada bab sebelumnya, selanjutnya akan dilakukan

Transkripsi:

DT-I/O DT-IO Application Note AN151 Ekspansi 2 Pin I/O AVR Menjadi 8 Input/Output Oleh: Tim IE Mengembangkan aplikasi yang cukup besar dan kompleks tentu membutuhkan pin untuk I/O yang banyak. Kendala yang sering kali dihadapi adalah permasalahan port I/O yang disediakan di mikrokontroler/mikroprosesor kurang untuk memenuhi kebutuhan aplikasi tersebut. Solusi untuk permasalahan tersebut adalah dengan cara melakukan ekspansi dari port yang tersedia. Terdapat beberapa teknik yang dapat digunakan untuk pengolahan ekspansi port tersebut antara lain dengan menggunakan bantuan IC multiplexer. Selain menggunakan teknik tersebut, dapat juga menggunakan DT-I/O I 2 C to Parallel Converter. Modul ini berfungsi sebagai modul ekspansi 2 pin I/O menjadi 16 pin I/O. Pada aplikasi kali ini akan dibahas mengenai cara penggunaan DT-I/O I 2 C to Parallel Converter dan contoh aplikasi yang dapat dikembangkan dengan tambahan beberapa modul lain menggunakan bantuan kompiler CodeVisionAVR yang berbasis C-Language. Adapun modul yang diperlukan dalam aplikasi kali ini : DT-AVR Low Cost Nano System/DT-AVR Low Cost Micro System. DT-I/O I²C to Parallel Converter. DT-I/O Neo Relay Board. DT-I/O 4 x 4 Keypad Module. Blok diagram dari sistem secara keseluruhan adalah sebagai berikut : DT-I/O 3 x 4 Keypad Module DT-AVR Low Cost Nano System DT-I/O I²C to Paralel Converter DT-I/O Neo Relay Board Gambar 1 Blok Diagram AN151 Page 1 of 6

Hubungan antara modul-modul tersebut adalah sebagai berikut : DT-AVR Low Cost Nano System GND VCC DT-I/O I²C to Paralel Converter GND +5 VDC * PORTD.2 (J8.5) SDA (J1) * PORTD.3 (J8.6) SCL (J1) * Pin ini tidak mutlak dan dapat diganti pin lain tetapi harus mengubah program Tabel 1 Hubungan DT-AVR Low Cost Nano System dengan DT-I/O I²C to Paralel Converter DT-I/O I²C to Paralel Converter DT-I/O Neo Relay Board Pin 0 (J5.3) Relay 1 (J1.3) Pin 1 (J5.4) Relay 2 (J1.4) Pin 2 (J5.5) Relay 3 (J1.5) Pin 3 (J5.6) Relay 4 (J1.6) Pin 4 (J5.7) Relay 5 (J1.7) Pin 5 (J5.8) Relay 6 (J1.8) Pin 6 (J5.9) Relay 7 (J1.9) Pin 7 (J5.10) Relay 8 (J1.10) Tabel 2 Hubungan DT-I/O I²C to Paralel Converter dengan DT-I/O Neo Relay Board DT-AVR Low Cost Nano System VCC (J7.2) PORTB.0 (J7.3) DT-I/O 4x4 Keypad Module VCC C1 PORTB.1 (J7.4) C2 PORTB.2 (J7.5) C3 PORTB.3 (J7.6) C4 PORTB.4 (J7.7) R1 PORTB.5 (J7.8) R2 PORTB.6 (J7.9) R3 PORTB.7 (J7.10) R4 Tabel 3 Hubungan DT-AVR Low Cost Nano System dengan DT-I/O 4x4 Keypad Module Page 2 of 6

Keterangan : Resistor pull-up untuk SDA dan SCL di DT-I/O I²C to Parallel Converter harus dipasang, caranya dengan memasang jumper pin 1-2 di J4 dan jumper pin 3-4 di J4. Pada DT-I/O Neo Relay Board, atur jumper J4 pada posisi 1-2. DT-I/O I²C to Paralel Converter memerlukan catu daya +5 Volt DC. DT-I/O Neo Relay Board memerlukan catu daya +5 Volt untuk rangkaian relay dan +12 Volt untuk relay, pastikan tidak salah antara catudaya +5 Volt dengan +12 Volt. Hubungan GND antara semua modul harus saling terhubung. Setelah semua pengaturan selesai, isikan kode program k.hex ke dalam DT-AVR Low Cost Nano System dengan mengunakan bantuan DT-HiQ AVR In System Programmer / DT-HiQ AVR USB ISP ataupun alat programmer yang lain yang memiliki fitur In-System Programming. Secara singkat, program k.hex akan membaca input dari penekanan keypad. Jika tombol 1 ditekan, maka program akan mengirimkan perintah untuk menghidupkan relay ke-1. Demikian juga untuk tombol 2 8 akan menghidupkan relay ke 2 8 dan tombol 9 akan mematikan semua relay. Flowchart dari main program k.hex sebagai berikut : Start Init variabel n = 0x10, Drelay = 0x00 Init PORTB low nibble sebagai input Init PORTB high nibble sebagai output Init Timer0 untuk interupt Overflow setiap ~0,510 ms Init I²C Init PORT 0 DT I/O I²C Converter sebagai output Endless Loop Gambar 2. Flowchart Main Program Page 3 of 6

Penjelasan program sebagai berikut : 1. Pertama kali program akan melakukan inisialisasi variabel, port dan timer DT-AVR Low Cost Nano System, serta inisialisasi komunikasi I²C dengan DT-I/O I²C to Parallel Converter. 2. Variabel "n" digunakan untuk nilai scanning baris DT-I/O 4 x 4 Keypad Module. Nilai awal = 0x10. 3. Variabel "Drelay" digunakan untuk menampung data keadaan relay. Nilai awal Drelay = 0x00 (semua relay aktif pada awal program). 4. PORTB high nibble adalah PORTB.4 s.d PORTB.7, sedangkan PORTB low nibble adalah PORTB.0 s.d PORTB.3. PORTB ini digunakan untuk keperluan scanning keypad. 5. Interrupt Timer0 digunakan untuk men-scan keypad setiap sekitar 0,51 ms. Pengaturan nilai 0,51 ms ini ada di register TCCR0B (dapat dibaca di datasheet ATtiny2313). Sedangkan pengaktifan interrupt overflow timer0 ada di register TIMSK. Pengaturan untuk program ini: TCCR0B = 0x02 TIMSK = 0x02 6. Inisialisasi I²C digunakan untuk mengatur port 0 di DT-I/O I²C to Parallel Converter sebagai output. 7. Program utama di aplikasi ini seluruhnya ada di interrupt overflow timer yang terjadi setiap 0,51 ms. Flowchart dari subrutin Interrup Timer0 dari program k.hex sebagai berikut : Start Interrupt Timer0 TIMSK = 0x00 (matikan interrupt timer) Beri Nilai Low Baris ke-n Baca Nilai input di low nibble PORTB simpan di variabel data Delay selama 10 ms Invers variabel Data' 1 Page 4 of 6

1 n = 0x80? Data = 0x08? Relay ke-1 Data = 0x04? Relay ke-2 Data = 0x02? Relay ke-3 n = 0x40? Data = 0x08? Relay ke-4 n = 0x10 n = 0x80? Geser variabel n 1 bit ke kiri TIMSK = 0x02 (hidupkan interrupt timer) return Data = 0x04? Data = 0x02? n = 0x20? Data = 0x08? Data = 0x04? Relay ke-5 Relay ke-6 Relay ke-7 Relay ke-8 Data = 0x02? Matikan semua Relay Gambar 3 Flowchart Subrutin Interrupt Timer0 Penjelasan program sebagai berikut : 1. Setiap kali interrupt terjadi, program akan memberi nilai LOW baris ke-n dari DT-IO 4x4 Keypad Module. Setelah itu program akan membaca nilai kolom 1 s.d 4 dengan perintah : data=((pinb.3<<3) (PINB.2<<2) (PINB.1<<1) (PINB.0<<0)) Data kolom ini ada di low nibble variabel kemudian data di inversi, karena data kolom yang dibaca sebelumnya adalah aktif low (tujuan inversi sebenarnya hanya untuk memudahkan pengolahan data selanjutnya). 2. Setelah data kolom diperoleh, langkah selanjutnya adalah mencocokkannya dengan baris yang sekarang di -scan. Kombinasi data baris yang sedang di-scan dengan data kolom yang dibaca inilah yang digunakan untuk menentukan relay mana yang akan diaktifkan/dimatikan. Page 5 of 6

3. Varibel n digeser untuk scanning baris selanjutnya. if(n==0x80) n=0x10; else n<<=1; Di aplikasi kali ini hanya menggunakan 9 tombol dari 16 tombol yang tersedia pada di DT-IO 4x4 Keypad Module, sedangkan di DT-IO I²C to Paralel Converter hanya menggunakan 8 port I/O dari 16 port I/O yang ada. Sehingga terdapat banyak port yang tersisa untuk aplikasi yang lebih kompleks. Listing program terdapat pada file AN151.ZIP. Selamat berinovasi! CodeVisionAVR is copyright by Pavel Haiduc, HP InfoTech s.r.l. All trademarks, trade names, company names, and product names are the property of their respective owners. All softwares are copyright by their respective software publishers and/or creators. Page 6 of 6