Home >Documents >Modul Mikrokontroler 2012

Modul Mikrokontroler 2012

Date post:26-Oct-2014
Category:
View:157 times
Download:1 times
Share this document with a friend
Transcript:

PRAKTIKUM MIKROKONTROLER

MODUL I PEMROGRAMAN PORT OUTPUT 1.1 Tujuan Setelah praktikum selesai dilakukan peserta harus dapat : Memahami cara mengeluarkan data ke port output Membuat program untuk mengirim data ke port

1.2 Langkah percobaan pengiriman data ke port Output 1.2.1 Langkah percobaan I mengirim data ke port Output Hubungkan port 1 DT-51 MinSys dengan Port Output DT-51 Trainer Board menggunakan kabel tipe Y. Hubungkan DT-51 MinSys dengan PC menggunakan kabel serial. Hubungkan DT-51 MinSys dengan sumber tegangan. Ketikkan program berikut ini, pada editor program, kemudian compile dan download ke DT-51 MinSys, dan amati hasilnya. Program I : Program mengirim data ke port 1 dengan instruksi bit $mod51 CSEG ORG LJMP ORG START: MOV SETB CLR SETB CLR SETB SETB SETB SETB SJMP END 4000H START 4100H SP,#30H P1.0 P1.1 P1.2 P1.3 P1.4 P1.5 P1.6 P1.7 $

LABORATORIUM ELEKTONIKA DIGITAL TEKNIK ELEKTRO INSTITUT TEKNOLOGI NASIONAL MALANG

PRAKTIKUM MIKROKONTROLER

Jika tidak ada kesalahan, program tersebut akan menyebabkan Output LED pada Tutorial Board berda pada kondisi sbb : Bit 6 Nyala Bit 5 Nyala Bit 4 Nyala Bit 3 Padam Bit 2 Nyala Bit 1 Padam Bit 0 Nyala

Bit 7 Nyala

1.2.1.1 Tugas dan pertanyaan : Buat program seperti diatas dengan menggunakan instruksi SETB dan CLR untuk mendapatkan keluaran data 10101010. 1.2.2 Langkah Percobaan 2 Hubungkan port 1 DT-51 MinSys dengan Port Output DT-51 Trainer Board menggunakan kabel tipe Y. Hubungkan DT-51 MinSys dengan Pc menggunakan kabel serial. Hubungkan DT-51 MinSys dengan sumber tegangan. Ketikkan program berikut ini, pada editor program, kemudian compile dan download ke DT-51 MinSys, dan amati hasilnya. Program II : $MOD CSEG ORG AJMP ORG Delay : Del1 : MOV MOV DJNZ DJNZ RET MOV MOV ACALL Delay MOV ACALL Delay AJMP END 4000H START 4100H R2,#0FFH R1,#0FFH R1,$ R2,Del1

START: XX:

SP,#30H P1,#0FFH P1,#00H XX

1.2.2.1Tugas dan peartanyaan :LABORATORIUM ELEKTONIKA DIGITAL TEKNIK ELEKTRO INSTITUT TEKNOLOGI NASIONAL MALANG

PRAKTIKUM MIKROKONTROLER

Buat program seperti diatas dengan menggunakan instruksi MOV untuk mendapatkan keluaran data 1111000 dan 0000111 secara bergantian. 1.3 Program untuk menggerakkan Motor Stepper Data Motor Stepper Step 1 2 3 4 SW1 1 0 0 0 SW2 0 1 0 0 SW3 0 0 1 0 SW4 0 0 0 1

1.3.1 Langkah percobaan menggunakan Motor Stepper Hubungkan Port DT-51 MinSys dengan Modul motor stepper menggunakan kabel yang ada pada motor stepper. Hubungkan DT-51 MinSys dengan PC menggunakan Kabel serial Hubungkan DT-51 MinSys dengan sumber tegangan. Ketikkan program berikut ini, pada editor program, kemudian compile dan download ke DT-51 MinSys, dan amati hasilnya. Program motor steper $mod51 cseg org ljmp org mulai: mov call mov call mov call mov call ljmp 4000h mulai 4100h p1,#10h tunda p1,#20h tunda p1,#40h tunda p1,#80h tunda mulai r2,#0ffh r1,#0ffh r1,$ r2,tunda1

tunda: mov tunda1: mov djnz djnz ret end

LABORATORIUM ELEKTONIKA DIGITAL TEKNIK ELEKTRO INSTITUT TEKNOLOGI NASIONAL MALANG

PRAKTIKUM MIKROKONTROLER

1.3.2 Tugas dan pertanyaan Buat program untuk arah putaran motor 180 ke kanan Buat program untuk arah putaran motor 360 ke kiri dengan membalik urutan data motor stepper

1.4 Jawaban Tugas dan pertanyaan ................................................................................................................................................ ................................................................................................................................................LABORATORIUM ELEKTONIKA DIGITAL TEKNIK ELEKTRO INSTITUT TEKNOLOGI NASIONAL MALANG

PRAKTIKUM MIKROKONTROLER

................................................................................................................................................ ................................................................................................................................................ ................................................................................................................................................ ................................................................................................................................................ ................................................................................................................................................ ................................................................................................................................................ ................................................................................................................................................ ................................................................................................................................................ ................................................................................................................................................ ................................................................................................................................................ ................................................................................................................................................ ................................................................................................................................................ ................................................................................................................................................ ................................................................................................................................................ ................................................................................................................................................ ................................................................................................................................................ ................................................................................................................................................ ................................................................................................................................................ ................................................................................................................................................ ................................................................................................................................................ ................................................................................................................................................ ................................................................................................................................................ ................................................................................................................................................ ................................................................................................................................................ ................................................................................................................................................ ................................................................................................................................................ ................................................................................................................................................ ................................................................................................................................................ ................................................................................................................................................ ................................................ 1.5 Analisa Data ................................................................................................................................................ ................................................................................................................................................LABORATORIUM ELEKTONIKA DIGITAL TEKNIK ELEKTRO INSTITUT TEKNOLOGI NASIONAL MALANG

PRAKTIKUM MIKROKONTROLER

................................................................................................................................................ ................................................................................................................................................ ................................................................................................................................................ ................................................................................................................................................ ................................................................................................................................................ ................................................................................................................................................ ................................................................................................................................................ ................................................................................................................................................ ................................................................................................................................................ ................................................................................................................................................ ...........................................................................................

Popular Tags: