Aplikasi Mikrokontroler Sebagai Karakter Generator Televisi Niki Guinea/0422135 Jurusan Teknik Elektro, Fakultas Teknik, Universitas Kristen Maranatha Jalan Prof. drg. Suria Sumantri, MPH. No. 65 Bandung 40164, Indonesia
[email protected] ABSTRAK Dalam rangka memperkenalkan barang dan/atau jasanya, produsen membutuhkan media. Media tersebut bisa dalam bentuk media cetak maupun media elektronik. Salah satu media elektronik yang mempunyai fasilitas visualisasi adalah televisi. Melalui televisi dapat ditampilkan informasi baik teks maupun gambar. Pada tugas akhir ini telah direalisasikan alat untuk menampilkan karakter yang dimasukkan melalui keyboard ke layar televisi. Alat tersebut direalisasikan dengan menggunakan dua buah mikrokontroler yaitu AVR ATMega8 dan AVR ATMega16. ATMega16 berguna untuk menerima kode layout yang dikirimkan oleh keyboard, menerjemahkannya menjadi kode ASCII, dan kemudian mengirimkannya ke ATMega8 melalui port serialnya. ATMega8 bertugas menerima data dari ATMega16, kemudian mengolah dan memprosesnya menjadi sinyal data dan sinyal sinkronisasi, dan dengan bantuan suatu interface kedua sinyal tersebut dilakukan rendering menjadi sinyal komposit video sehingga dapat ditampilkan pada televisi dengan spesifikasi : berukuran 40x25 karakter dan karakter yang ditampilkan berwarna putih dengan layar berwarna hitam. Yang dimaksud karakter di sini adalah hanya angka dan huruf. Hasil pengujian yang dilakukan pada tugas akhir ini menunjukan bahwa alat ini sudah berfungsi dengan baik, yaitu dapat menampilkan karakter yang ingin ditampilkan ke layar televisi tanpa flicker.
kata kunci: keyboard, kode layout keyboard, AVR ATMega8, AVR ATMega16, interface.
i
Universitas Kristen Maranatha
Application Of Microcontroller For Television Character Generator Niki Guinea/0422135 Electrical Engineering, Engineering Faculty, Christian Maranatha University Prof. drg. Suria Sumantri, MPH Street No. 65, Bandung 40164, Indonesia
[email protected] ABSTRACT In order to inform their goods and/or service, a producer needs a media. That media can be form a printed media and electronic media. One of the media which have visualization is a television. Television can display the information both of text and picture. This final project has been realized an equipment which it’s function is to display the characters as we type at keyboard to the television. It has been realized by using two pieces microcontrollers, AVR ATMega8 and AVR ATMega16. The ATMega16 receive the keyboard’s layout code, decode it into ASCII code, then send it into ATMega8 by serial port. ATMega8 receive the data from ATMega16 then process it into data and synchronize signal, and by using an interface they are rendered into composite video signal, so it can be shown at television by : 40x25 monochrome character. There just figure and letters. The result of the experiment in this final assignment shows this tools can be used in properly, it can display the character which is want to show into television without flicker.
keyword: keyboard, keyboard’s layout code, AVR ATMega8, AVR ATMega16, interface.
ii
Universitas Kristen Maranatha
DAFTAR ISI
LEMBAR PENGESAHAN SURAT PERNYATAAN ABSTRAK.......................................................................................................... i ABSTRACT....................................................................................................... ii KATA PENGANTAR...................................................................................... iii DAFTAR ISI......................................................................................................v DAFTAR LAMPIRAN....................................................................................vii DAFTAR TABEL...........................................................................................viii DAFTAR GAMBAR........................................................................................ ix
BAB I PENDAHULUAN I.1 Latar Belakang.............................................................................................. 1 I.2 Perumusan Masalah...................................................................................... 1 I.3 Tujuan........................................................................................................... 2 I.4 Pembatasan Masalah.....................................................................................2 I.5 Sistematika Penulisan................................................................................... 2
BAB II DASAR TEORI II.1 Mikrokontroler.............................................................................................4 II.1.1 Arsitektur ATMega8.................................................................... 5 II.1.2 Blok Diagram ATMega8.............................................................. 7 II.1.3 Peta Memori ATMega8................................................................ 8 II.1.4 Arsitektur ATMega16................................................................ 10 II.1.5 Blok Diagram ATMega16.......................................................... 14 II.1.6 Peta Memori ATMega16............................................................ 16 II.1.7 Komunikasi Serial USART........................................................ 18 II.2 Sinyal Video.............................................................................................. 19 II.3.Pengulasan (Scanning).............................................................................. 20 II.4 Pulsa Sinkronisasi Horizontal....................................................................22 II.5 Pulsa Sinkronisasi Vertikal........................................................................23
iii
Universitas Kristen Maranatha
II.6 Standar Sistem Televisi............................................................................. 23 II.6.1 PAL (Phase Alternating Lines).................................................. 23 II.6.2 NTSC (National Television System Committee)....................... 23 II.6.3 SECAM (Sequentiel Couleur A Memoire)…………………… 24 II.7 Keyboard....................................................................................................24
BAB III PERANCANGAN DAN REALISASI III.1Cara Kerja................................................................................................. 26 III.2 Keyboard.................................................................................................. 27 III.3 Karakter Generator Televisi..................................................................... 27 III.3.1 Blok Konverter Kode Layout Keyboard ke Kode ASCII......... 28 III.3.2 Blok TV Terminal..................................................................... 29 III.3.3 Interface.....................................................................................30 III.4 Perancangan Perangkat Lunak................................................................ 32
BAB IV DATA PENGAMATAN DAN ANALISA IV.1 Pengukuran Sinyal Keluaran pada X3..................................................... 36 IV.2 Hasil Tampilan.........................................................................................38 IV.2.1 Hasil Tampilan pada Televisi................................................... 38 IV.2.2 Hasil Tampilan pada Komputer dengan Bantuan TV Tuner.... 39 IV.2.3 Hasil Tampilan pada Televisi dengan Sistem Lain (NTSC).... 45
BAB V KESIMPULAN DAN SARAN V.1 Kesimpulan............................................................................................... 46 V.2 Saran..........................................................................................................46
DAFTAR PUSTAKA...................................................................................... 47
iv
Universitas Kristen Maranatha
DAFTAR LAMPIRAN
LAMPIRAN A List Program CodeVision ATMega16........................................................... A-1 List Program untuk ATMega8 (TV Terminal).............................................. A-7 LAMPIRAN B Skematik rangkaian keseluruhan................................................................... B-1 LAMPIRAN C Foto Alat........................................................................................................ C-1 LAMPIRAN D Datasheet ATMega8...................................................................................... D-1 Datasheet ATMega16.................................................................................... D-7
v
Universitas Kristen Maranatha
DAFTAR TABEL
Tabel 2.1 Fungsi Khusus Port B ATMega8....................................................... 6 Tabel 2.2 Fungsi Khusus Port D ATMega8.......................................................7 Tabel 2.3 Fungsi Khusus Port B ATMega16................................................... 12 Tabel 2.4 Fungsi khusus Port C ATMega16.................................................... 13 Tabel 2.5 Fungsi khusus Port D ATMega16....................................................14 Tabel 3.1 Setting Keluaran Dari Mikrokontroler ATMega8........................... 31
vi
Universitas Kristen Maranatha
DAFTAR GAMBAR
Gambar II.1 Konfigurasi Pin ATMega8............................................................ 5 Gambar II.2 Blok Diagram Fungsional ATMega8............................................ 8 Gambar II.3 Peta Memori Program ATMega8.................................................. 9 Gambar II.4 Peta Memori Data ATMega8.......................................................10 Gambar II.5 Konfigurasi Pin ATMega16.........................................................11 Gambar II.6 Blok Diagram Fungsional ATMega16.........................................15 Gambar II.7 Peta Memori Program ATmega16.............................................. 16 Gambar II.8 Peta Memori Data ATmega16..................................................... 17 Gambar II.9 Tiga Level Sinyal Video..............................................................19 Gambar II.10 Proses Interlace Scanning.......................................................... 21 Gambar II.11 Interface Keyboard.................................................................... 24 Gambar II.12 Perbandingan Sinyal Klok dan Sinyal Data.............................. 25 Gambar III.1 Diagram Blok............................................................................. 26 Gambar III.2 Data Layout Keyboard............................................................... 27 Gambar III.3 Skema Rangkaian Blok Konverter Data Layout Keyboard ke kode ASCII.................................................................................28 Gambar III.4 Skema Rangkaian Blok TV Terminal........................................ 29 Gambar III.5 Rangkaian Interface....................................................................31 Gambar III.6 Diagram Alir Sistem.................................................................. 33 Gambar III.7 Diagram Alir Subroutine TV TERMINAL................................34 Gambar III.8 Diagram Alir PAL Sinkronisasi................................................. 35 Gambar IV.1 Bentuk Sinyal jika Tidak Ada Data yang Dikirim..................... 36 Gambar IV.2 Bentuk Sinyal jika Dikirim Data Huruf ”J”............................... 37 Gambar IV.3 Bentuk Sinyal Data.................................................................... 37 Gambar IV.4 Start Up TV Terminal................................................................ 38 Gambar IV.5 Tampilan pada Televisi.............................................................. 39 Gambar IV.6 Tampilan pada Komputer.......................................................... 39 Gambar IV.7 Tampilan Jika Layar Penuh....................................................... 40
vii
Universitas Kristen Maranatha
Gambar IV.8 Tampilan Setengah Layar.......................................................... 40 Gambar IV.9 Variasi Tampilan dengan Menggunakan Fungsi Enter..............40 Gambar IV.10 Membuat Gambar Menggunakan Huruf atau Angka...............41 Gambar IV.11 Contoh Pemasangan Iklan........................................................41 Gambar IV.12 Karakter yang dapat ditampilkan............................................. 42 Gambar IV.13 Variasi Tampilan ”Menggambar Tangga”............................... 42 Gambar IV.14 Contoh Tampilan ”Operasi Matematika”................................ 43 Gambar IV.15 Contoh Pemasangan Iklan Baris.............................................. 43 Gambar IV.16 Contoh Pemasangan Iklan Kolom........................................... 44 Gambar IV.17 Tampilan pada Televisi dengan Sistem NTSC........................ 44
viii
Universitas Kristen Maranatha