part 4 training delay

39
PART 4 TRAINING DELAY Dosen : Dwisnanto Putro, ST, M.Eng

Upload: dalia

Post on 09-Jan-2016

33 views

Category:

Documents


1 download

DESCRIPTION

PART 4 TRAINING DELAY. Dosen : Dwisnanto Putro , ST, M.Eng. LED (LIGHT EMITING DIODE). Untuk LED ANODA : Logika 0 = led menyala Logika 1 = led mati Untuk LED KATODA : Logika 0 = led mati Logika 1 = led menyala. DELAY. Delay = tunda - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: PART  4 TRAINING  DELAY

PART 4TRAINING DELAYDosen : Dwisnanto Putro, ST, M.Eng

Page 2: PART  4 TRAINING  DELAY

• Untuk LED ANODA : Logika 0 = led menyala

Logika 1 = led mati

• Untuk LED KATODA : Logika 0 = led mati

Logika 1 = led menyala

LED (LIGHT EMITING DIODE)

Published By Stefanikha69

Page 3: PART  4 TRAINING  DELAY

Published By Stefanikha69

Page 4: PART  4 TRAINING  DELAY

Published By Stefanikha69

Page 5: PART  4 TRAINING  DELAY

•Delay = tunda

• Penundaan terhadap kinerja mikrokontroler

•DELAY

Published By Stefanikha69

Page 6: PART  4 TRAINING  DELAY

• Menghasilkan delay dalam program-C berada pada header delay.h yang harus dimasukan (include) sebelum digunakan.

• Sebelum memanggil fungsi, interupsi harus dimatikan terlebih dahulu, apabila tidak maka delay akan lebih lama dari yang diharapkan. Juga sangat penting untuk menyebutkan frekuensi clock chip IC AVR yang digunakan pada menu Project – configure - C compiler - Code Generation.

•DELAY

Published By Stefanikha69

Page 7: PART  4 TRAINING  DELAY

• Header delay#include <delay.h>

• Perintah delay

delay_ms(------);

Waktu tunda dalam milidetik:Misalkan:delay_ms(1000); berarti ditunda selama 1 detik

•DELAY

Published By Stefanikha69

Page 8: PART  4 TRAINING  DELAY

• Dengan system delay, menciptakan system sinyal pulsa

•DELAY

Published By Stefanikha69

Page 9: PART  4 TRAINING  DELAY

•New Project

• Run CodeVision

Published By Stefanikha69

Page 10: PART  4 TRAINING  DELAY

Published By Stefanikha69

Page 11: PART  4 TRAINING  DELAY

• Chip select

Published By Stefanikha69

Page 12: PART  4 TRAINING  DELAY

configuration chip select• Chip ATMEGA 8535• Clock 8.000000 Mhz

Published By Stefanikha69

Page 13: PART  4 TRAINING  DELAY

•Untuk port gunakan PORTC untuk LED PORTC.0 – PORTC.7 = output (0)

Published By Stefanikha69

Page 14: PART  4 TRAINING  DELAY

• Save and Generate

Published By Stefanikha69

Page 15: PART  4 TRAINING  DELAY

• Save File – make folder and files

Published By Stefanikha69

Page 16: PART  4 TRAINING  DELAY

•Display

Published By Stefanikha69

Page 17: PART  4 TRAINING  DELAY

•Configuration ready compile

Published By Stefanikha69

Page 18: PART  4 TRAINING  DELAY

Published By Stefanikha69

Page 19: PART  4 TRAINING  DELAY

•CODE PROGRAM• Untuk menyalakan led bergantian misalkan pada posisi PORTC.0,

PORTC.1 dan PORTC.2 dengan masing-masing waktu tunda selama 1 detik. (jadi waktu keseluruhan yang dibutuhkan sistem yaitu 3 detik)

while(1){

PORTC=0b11111110;Delay_ms(1000);PORTC=0b11111101;Delay_ms(1000);PORTC=0b11111011;Delay_ms(1000);

} }

Published By Stefanikha69

Page 20: PART  4 TRAINING  DELAY

SETTING USB – DOWNLOADER :• INSTALL DEVICE USB DOWNLOADER• CONNECT USB DOWNLOADER TO PC/LAPTOP

SETTING COM PORT:• COMPUTER -> MANAGE -> DEVICE MANAGER• PORT (COM &LPT) -> PROLIFIC USB TO SERIAL COMM PORT (COM....)

Published By Stefanikha69

Page 21: PART  4 TRAINING  DELAY

•Configuration PORT Programmer

Published By Stefanikha69

Page 22: PART  4 TRAINING  DELAY

Choice :• AVR Chip programmer type• COM PORT• BAUD RATE

Published By Stefanikha69

Page 23: PART  4 TRAINING  DELAY

•COMPILER AND BUILD ALL PROGRAM

Or Shift F9

Published By Stefanikha69

Page 24: PART  4 TRAINING  DELAY

• Connecting USB Downloader - PC/Laptop - Microcontroller, And....

Published By Stefanikha69

Page 25: PART  4 TRAINING  DELAY

• Process Downloading.........

Published By Stefanikha69

Page 26: PART  4 TRAINING  DELAY

FINISH

Published By Stefanikha69

Page 27: PART  4 TRAINING  DELAY

• Error DOWNLOADING

Solution :• Check COM PORT• Check Baud Rate• Check Connection Downloader• Check Prog/Serial TTL select

Published By Stefanikha69

Page 28: PART  4 TRAINING  DELAY

•CV AVR WITH PROTEUS

OPEN PROGRAM ISIS PROTEUS PROFESSIONAL

Published By Stefanikha69

Page 29: PART  4 TRAINING  DELAY

• synchronization cv avr with proteus• Creat Project and Design•Double click pict microcntroller

Published By Stefanikha69

Page 30: PART  4 TRAINING  DELAY

• synchronization cv avr with proteus• Select clock frequency• Select program file, (HEX file type)

Published By Stefanikha69

Page 31: PART  4 TRAINING  DELAY

• synchronization cv avr with proteus

• Running ISIS Proteus

• FINISH...

Created by. Dwisnanto Putro, Manado, September 2012

Published By Stefanikha69

Page 32: PART  4 TRAINING  DELAY

TASK•BUATLAH project dengan system led berjalan pada PORTC.7, PORTC.6 dan PORTC.5 dengan masing-masing delay 250 ms

Published By Stefanikha69

Page 33: PART  4 TRAINING  DELAY

TASK•BUATLAH project dengan system led berjalan pada PORTC.0, PORTC.2, PORTC.4 dan PORTC.6 dengan sistem led menyala secara berurutan bergantian. masing-masing delay 100 ms.

Published By Stefanikha69

Page 34: PART  4 TRAINING  DELAY

TASK•BUATLAH project dengan system led berjalan pada PORTC.0 s/d PORTC.3. masing-masing delay 150 ms. Misalkan:•Step 1: hanya PORTC.0 menyala•Step 2: hanya PORTC.1 menyala •Step 3: hanya PORTC.2 menyala •Step 4: hanya PORTC.3 menyala

Published By Stefanikha69

Page 35: PART  4 TRAINING  DELAY

TASK• BUATLAH project dengan system led berjalan pada

PORTC.1 s/d PORTC.6. masing-masing delay 100 ms. Misalkan:• Step 1: hanya PORTC.1 mati• Step 2: hanya PORTC.2 mati • Step 3: hanya PORTC.3 mati • Step 4: hanya PORTC.4 mati• Step 5: hanya PORTC.5 mati• Step 6: hanya PORTC.6 mati(PORTC Yang lain menyala)

Published By Stefanikha69

Page 36: PART  4 TRAINING  DELAY

TASK• BUATLAH project dengan system led berjalan pada PORTC.0 s/d PORTC.7. masing-masing delay 100 ms. (Secara berurutan menyala dari PORTC.0 s/d PORTC.7)

Published By Stefanikha69

Page 37: PART  4 TRAINING  DELAY

TASK• BUATLAH project dengan system led berjalan pada PORTC.0 s/d PORTC.7. masing-masing delay 100 ms. (Secara berurutan menyala dari PORTC.7 s/d PORTC.0)

Published By Stefanikha69

Page 38: PART  4 TRAINING  DELAY

TASK• BUATLAH project dengan system led berjalan pada PORTC.0 s/d PORTC.7. masing-masing delay 100 ms. Misalkan:• Step 1: PORTC.0 dan PORTC.7 ON• Step 2: PORTC.1 dan PORTC.6 ON• Step 3: PORTC.2 dan PORTC.5 ON• Step 4: PORTC.3 dan PORTC.4 ON

Published By Stefanikha69

Page 39: PART  4 TRAINING  DELAY

TASK• BUATLAH project dengan system led berjalan pada

PORTC.0 s/d PORTC.7. masing-masing delay 100 ms. Misalkan:• Step 1: PORTC.0 dan PORTC.7 ON• Step 2: PORTC.1 dan PORTC.6 ON• Step 3: PORTC.2 dan PORTC.5 ON• Step 4: PORTC.3 dan PORTC.4 ON• Step 5: PORTC.2 dan PORTC.5 ON• Step 6: PORTC.1 dan PORTC.6 ON• Step 7: PORTC.0 dan PORTC.7 ON

Published By Stefanikha69