390 likes | 503 Views
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
E N D
PART 4TRAINING DELAY Dosen : DwisnantoPutro, ST, M.Eng
LED (LIGHT EMITING DIODE) • Untuk LED ANODA : Logika0 = led menyala Logika1 = led mati • Untuk LED KATODA : Logika0 = led mati Logika1 = led menyala Published By Stefanikha69
DELAY • Delay = tunda • Penundaanterhadapkinerjamikrokontroler Published By Stefanikha69
DELAY • Menghasilkandelaydalam program-C beradapada header delay.h yang harusdimasukan (include) sebelumdigunakan. • Sebelummemanggilfungsi, interupsiharusdimatikanterlebihdahulu, apabilatidakmakadelay akanlebih lama dari yang diharapkan. Jugasangatpentinguntukmenyebutkanfrekuensiclockchip IC AVR yang digunakanpada menu Project – configure - C compiler - Code Generation. Published By Stefanikha69
DELAY • Header delay #include <delay.h> • Perintah delay delay_ms(------); Waktutundadalammilidetik: Misalkan: delay_ms(1000); berartiditundaselama 1 detik Published By Stefanikha69
DELAY • Dengan system delay, menciptakan system sinyalpulsa Published By Stefanikha69
New Project Run CodeVision Published By Stefanikha69
Chip select Published By Stefanikha69
configuration chip select • Chip ATMEGA 8535 • Clock 8.000000 Mhz Published By Stefanikha69
Untuk port gunakan PORTC untuk LED PORTC.0 – PORTC.7 = output (0) Published By Stefanikha69
Save and Generate Published By Stefanikha69
Save File – make folder and files Published By Stefanikha69
Display Published By Stefanikha69
Configuration ready compile Published By Stefanikha69
CODE PROGRAM • Untukmenyalakanled bergantianmisalkanpadaposisiPORTC.0, PORTC.1 dan PORTC.2 denganmasing-masingwaktutundaselama 1 detik. (jadiwaktukeseluruhan yang dibutuhkansistemyaitu 3 detik) while(1){ PORTC=0b11111110; Delay_ms(1000); PORTC=0b11111101; Delay_ms(1000); PORTC=0b11111011; Delay_ms(1000); } } Published By Stefanikha69
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
Configuration PORT Programmer Published By Stefanikha69
Choice : • AVR Chip programmer type • COM PORT • BAUD RATE Published By Stefanikha69
COMPILER AND BUILD ALL PROGRAM Or Shift F9 Published By Stefanikha69
Connecting USB Downloader - PC/Laptop - Microcontroller, And.... Published By Stefanikha69
Process Downloading......... Published By Stefanikha69
FINISH Published By Stefanikha69
Solution : • Check COM PORT • Check Baud Rate • Check Connection Downloader • Check Prog/Serial TTL select Error DOWNLOADING Published By Stefanikha69
CV AVR WITH PROTEUS OPEN PROGRAM ISIS PROTEUS PROFESSIONAL Published By Stefanikha69
synchronization cv avr with proteus • Creat Project and Design • Double click pict microcntroller Published By Stefanikha69
synchronization cv avr with proteus Select clock frequency Select program file, (HEX file type) Published By Stefanikha69
synchronization cv avr with proteus • Running ISIS Proteus • FINISH... Created by. DwisnantoPutro, Manado, September 2012 Published By Stefanikha69
TASK BUATLAH project dengan system led berjalan pada PORTC.7, PORTC.6 dan PORTC.5 dengan masing-masing delay 250 ms Published By Stefanikha69
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
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
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
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
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
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
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