SlideShare a Scribd company logo
1 of 21
3 PERCOBAAN LED PADA ATMEGA-
16 MENGGUNAKAN BASCOM-AVR
KHAZIM FIKRI MAKSALENA 1710501022
DOSEN PENGAMPU R. SURYOTO EDY RAHARJO S. T., M. Eng
TEKNIK ELEKTRO
FAKULTAS TEKNIK
UNIVERSITAS TIDAR
FLOWCHART PROGRAM 1
LAMPU BERKEDIP SATU ARAH
START
COMPILER SETUP
HARDWARE SETUP
DO
LED ON
PORT A PIN 0
Wait 300ms
END
LED ON
PORT A PIN
7
LED ON
PORT A PIN
6
LED ON
PORT A
PIN 4
LED ON
PORT A
PIN 5
LED ON
PORT A
PIN 2
LED ON
PORT A
PIN 1
LED ON
PORT A
PIN 3
LOOP
Wait 300ms
Wait 300ms
Wait 300ms
Wait 300ms
Wait 300ms
Wait 300ms
Wait 300ms
Memulai program
Pendeklarasian Port yang akan digunakan
Memulai program atau perulangan perintah
Lampu yang menyala
START
COMPILER SETUP
HARDWARE SETUP
DO
LED ON
PORT A PIN
0
Delay / penundaan waktu
Kembali ke program awal
Program berakhir
Wait 300ms
END
LOOP
KODE PROGRAM 1
'program LED'
$regfile = "m161def.dat" 'library mikrokontroler yang dipakai,
$crystal = 8000000 'menyatakan clock oscillator yang dipakai 1 MHz,
Config Porta = Output 'mendeklarasikan port yang digunakan sebagai
output,
Do 'mulai menjalankan perintah dan perulangan/loop,
Porta = &B00000001 'PORTA PIN 0, LED menyala,
Waitms 300 'delay 300ms,
Porta = &B00000010 'PORTA PIN 1, LED menyala
Waitms 300 'delay 300ms,
Porta = &B00000100 'PORTA PIN 2, LED menyala,
Waitms 300 'delay 300ms,
Porta = &B00001000 'PORTA PIN 3, LED menyala,
Waitms 300 'delay 300ms,
 Porta = &B00010000 'PORTA PIN 4, LED menyala,
 Waitms 300 'delay 300ms,
 Porta = &B00100000 'PORTA PIN 5, LED menyala,
 Waitms 300 'delay 300ms,
 Porta = &B01000000 'PORTA PIN 6, LED menyala,
 Waitms 300 'delay 300ms,
 Porta = &B10000000 'PORTA PIN 7, LED menyala,
 Waitms 300 'delay 300ms,
 Loop 'kembali ke perintah awal, .
 End 'program berakhir.
FLOWCHART PROGRAM 2
LAMPU BERKEDIP BOLAK-BALIK
START
COMPILER SETUP
HARDWARE SETUP
LED ON
PORT A
PIN 0
WAIT 300MS
DO
LED ON
PORT A
PIN 1
WAIT 300MS
LED ON
PORT A
PIN 6
WAIT 300MS
LED ON
PORT A
PIN 5
WAIT 300MS
LED ON
PORT A
PIN 4
WAIT 300MS
LED ON
PORT A
PIN 3
WAIT 300MS
LED ON
PORT A
PIN 2
WAIT 300MS
LED ON
PORT A
PIN 4
WAIT 300MS
LED ON
PORT A
PIN 5
WAIT 300MS
LED ON
PORT A
PIN 6
WAIT 300MS
LED ON
PORT A
PIN 7
LOOP
END
WAIT 300MS
LED ON
PORT A
PIN 3
WAIT 300MS
LED ON
PORT A
PIN 2
WAIT 300MS
LED ON
PORT A
PIN 1
WAIT 300MS
LED OFF
PORT A
SEMUA PIN
WAIT 300MS
Memulai program
Pendeklarasian Port yang akan digunakan
Memulai program atau perulangan perintah
Lampu yang menyala
Delay / penundaan waktu
Kembali ke program awal
Program berakhir
START
COMPILER SETUP
HARDWARE SETUP
LED ON
PORT A
PIN 0
WAIT 300MS
DO
LOOP
END
KODE PROGRAM 2
 'program LED'
 $regfile = "m161def.dat" 'library mikrokontroler yang dipakai,
 $crystal = 8000000 'menyatakan clock oscillator yang dipakai 1 MHz,
 Config Porta = Output 'menyatakan PORT yang digunakan sebagai output,
 Do 'perintah dan perulangan dimulai,
 Porta = &B00000001 'PORTA PIN 0, LED menyala,
 Waitms 300 'delay 300ms,
 Porta = &B00000010 'PORTA PIN 1, LED menyala,
 Waitms 300 'delay 300ms,
 Porta = &B00000100 'PORTA PIN 2, LED menyala,
 Waitms 300 'delay 300ms,
 Porta = &B00001000 'PORTA PIN 3, LED menyala,
 Waitms 300 'delay 300ms,
 Porta = &B00010000 'PORTA PIN 4, LED menyala,
 Waitms 300 'delay 300ms,
 Porta = &B00100000 'PORTA PIN 5, LED menyala,
 Waitms 300 'delay 300ms,
 Porta = &B01000000 'PORTA PIN 6, LED menyala,
 Waitms 300 'delay 300ms,
 Porta = &B10000000 'PORTA PIN 7, LED menyala,
 Waitms 300 'delay 300ms,
 Porta = &B01000000 'PORTA PIN 6, LED menyala,
 Waitms 300 'delay 300ms,
 Porta = &B00100000 'PORTA PIN 5, LED menyala,
 Waitms 300 'delay 300ms,
 Porta = &B00010000 'PORTA PIN 4, LED menyala,
 Waitms 300 'delay 300ms,
 Porta = &B00001000 'PORTA PIN 3, LED menyala,
 Waitms 300 'delay 300ms,
 Porta = &B00000100 'PORTA PIN 2, LED menyala,
 Waitms 300 'delay 300ms,
 Porta = &B00000010 'PORTA PIN 1, LED menyala,
 Waitms 300 'delay 300ms,
 Porta = &B00000001 'PORTA PIN 0, LED menyala,
 Waitms 300 'delay 300ms,
 Porta = &B00000000 'PORTA PIN 0, LED menyala,
 Waitms 300 'delay 300ms,
 Loop 'kembali ke program awal'
 End 'program selesai.
FLOWCHART PROGRAM 3
LAMPU BERKEDIP DUA ARAH BOLAK-BALIK
START
DO
COMPILE SETUP
HARDWARE SETUP
LED ON
PORT A,
PIN 2,3,4,5
WAIT 300ms
LED ON
PORT A,
PIN 0,1,6,7
WAIT 300ms
LED ON
PORT A,
PIN 0 & 7
WAIT 300ms
LED ON
PORT A,
PIN 1 & 6
WAIT 300ms
LED ON
PORT A,
PIN 2 & 5
WAIT 300ms
LED ON
PORT A,
PIN 3 & 4
WAIT 300ms
LED ON
PORT A,
PIN 2 & 5
WAIT 300ms
LED ON
PORT A,
PIN 1 & 6
WAIT 300ms
LED ON
PORT A,
PIN 0 & 7
WAIT 300ms
LOOP
END
LED ON
PORT A,
PIN 0 &7
LED OFF
PORT A,
SEMUA
PIN
WAIT 300ms
LED ON
PORT A,
PIN 0,1,6,7
WAIT 300ms
WAIT 300ms
LED OFF
PORT A,
SEMUA
PIN
WAIT 300ms
KODE PROGRAM 3
 'program LED'
 $regfile = "m161def.dat" 'library mikrokontroler yang dipakai,
 $crystal = 8000000 'menyataka clock oscillator yang dipakai 1 MHz,
 Config Porta = Output 'mendeklarasikan port yang digunakan sebagai output,
 Do 'mulai menjalankan perintah dan perulangan/loop,
 Porta = &B10000001 'PORTA, PIN : 0 & 7, LED menyala,
 Waitms 100 'delay 100ms,
 Porta = &B01000010 'PORTA, PIN : 1 & 6, LED menyala,
 Waitms 100 'delay 100ms,
 Porta = &B00100100 'PORTA, PIN : 2 & 5, LED menyala,
 Waitms 100 'delay 100ms,
 Porta = &B00011000 'PORTA, PIN : 3 & 4, LED menyala,
 Waitms 100 'delay 100ms,
 Porta = &B00100100 'PORTA, PIN : 2 & 5, LED menyala,
 Waitms 100 'delay 100ms,
 Porta = &B01000010 'PORTA, PIN : 1 & 6, LED menyala,
 Waitms 100 'delay 100ms,
 Porta = &B10000001 'PORTA, PIN : 0 & 7, LED menyala,
 Waitms 100 'delay 100ms,
 Porta = &B11000011 'PORTA, PIN : 0,1,6,7, LED menyala,
 Waitms 100 'delay 100ms,
 Porta = &B00111100 'PORTA, PIN : 2,3,4,5, LED menyala,
 Waitms 100 'delay 100ms,
 Porta = &B11000011 'PORTA, PIN : 0,1,6,7, LED menyala,
 Waitms 100 'delay 100ms,
 Porta = &B00000000 'PORTA, PIN : MATI, semua LED mati,
 Waitms 100 'delay 100ms,
 Porta = &B11111111 'PORTA, PIN : 0 sampai 7, LED menyala,
 Waitms 100 'delay 100ms,
 Porta = &B00000000 'PORTA, PIN : MATI, semua LED mati,
 Waitms 100 'delay 100ms,
 Loop 'kembali ke perintah awal,
 End 'perintah berakhir.

More Related Content

What's hot

Cell phone detector ppt with circuit and block diagram
Cell phone detector ppt with circuit and block diagramCell phone detector ppt with circuit and block diagram
Cell phone detector ppt with circuit and block diagramVishnu Vijayan
 
8051 microcontroller training (2) (sahil gupta 9068557926)
8051 microcontroller training  (2) (sahil gupta   9068557926)8051 microcontroller training  (2) (sahil gupta   9068557926)
8051 microcontroller training (2) (sahil gupta 9068557926)Sahil Gupta
 
Password based wireless door opener security system
Password based wireless door opener security systemPassword based wireless door opener security system
Password based wireless door opener security systempragyajain53
 
Cell phone detector
Cell phone detectorCell phone detector
Cell phone detectorARIF HUSSAIN
 
Alcohol detection & driver safety
Alcohol detection & driver safetyAlcohol detection & driver safety
Alcohol detection & driver safetysanket jain
 
Automatic Garage System using VHDL
Automatic Garage System using VHDLAutomatic Garage System using VHDL
Automatic Garage System using VHDLAhmed Nabil
 

What's hot (9)

Apple 1 manual & warranty 1976
Apple 1 manual & warranty 1976Apple 1 manual & warranty 1976
Apple 1 manual & warranty 1976
 
Cell phone detector ppt with circuit and block diagram
Cell phone detector ppt with circuit and block diagramCell phone detector ppt with circuit and block diagram
Cell phone detector ppt with circuit and block diagram
 
8051 microcontroller training (2) (sahil gupta 9068557926)
8051 microcontroller training  (2) (sahil gupta   9068557926)8051 microcontroller training  (2) (sahil gupta   9068557926)
8051 microcontroller training (2) (sahil gupta 9068557926)
 
Password based wireless door opener security system
Password based wireless door opener security systemPassword based wireless door opener security system
Password based wireless door opener security system
 
Cell phone detector
Cell phone detectorCell phone detector
Cell phone detector
 
MPLABX with proteus
MPLABX with proteusMPLABX with proteus
MPLABX with proteus
 
Alcohol detection & driver safety
Alcohol detection & driver safetyAlcohol detection & driver safety
Alcohol detection & driver safety
 
Simple cell phone jammer
Simple cell phone jammerSimple cell phone jammer
Simple cell phone jammer
 
Automatic Garage System using VHDL
Automatic Garage System using VHDLAutomatic Garage System using VHDL
Automatic Garage System using VHDL
 

Similar to Ppt mikrokontroller

Program Running Led
Program Running LedProgram Running Led
Program Running LedNadaPutra
 
Apr9600 voice-recording-and-playback-system-with-j
Apr9600 voice-recording-and-playback-system-with-jApr9600 voice-recording-and-playback-system-with-j
Apr9600 voice-recording-and-playback-system-with-jicstation
 
Alcohol sensing alert with engine locking project
Alcohol sensing alert with engine locking projectAlcohol sensing alert with engine locking project
Alcohol sensing alert with engine locking projecthemanth prudhvi jidugu
 
Gas leakage detection system
Gas leakage detection systemGas leakage detection system
Gas leakage detection systemAashiq Ahamed N
 
Arduino projects & tutorials
Arduino projects & tutorialsArduino projects & tutorials
Arduino projects & tutorialsAnshu Pandey
 
ESD_Project-Report
ESD_Project-ReportESD_Project-Report
ESD_Project-ReportAhmad Faizan
 
MaxBotix Code Examples
MaxBotix Code ExamplesMaxBotix Code Examples
MaxBotix Code ExamplesMaxBotix Inc
 
Mom presentation_monday_arduino in the physics lab
Mom presentation_monday_arduino in the physics labMom presentation_monday_arduino in the physics lab
Mom presentation_monday_arduino in the physics labAnnamaria Lisotti
 
Chp7 pic 16 f84 interfacing - copy
Chp7 pic 16 f84 interfacing - copyChp7 pic 16 f84 interfacing - copy
Chp7 pic 16 f84 interfacing - copymkazree
 
Multi-Function Automatic Move Smart Car for Arduino
Multi-Function Automatic Move Smart Car for ArduinoMulti-Function Automatic Move Smart Car for Arduino
Multi-Function Automatic Move Smart Car for ArduinoWanita Long
 
IRJET -Arduino based Gas Leakage Detection for Living Security
IRJET -Arduino based Gas Leakage Detection for Living SecurityIRJET -Arduino based Gas Leakage Detection for Living Security
IRJET -Arduino based Gas Leakage Detection for Living SecurityIRJET Journal
 
2003 presentation24
2003 presentation242003 presentation24
2003 presentation24Sarth Lodhi
 
Ad90 Transponder Key Duplicator User Manual
Ad90 Transponder Key Duplicator User ManualAd90 Transponder Key Duplicator User Manual
Ad90 Transponder Key Duplicator User Manualobddeal
 
Arduino: Analog I/O
Arduino: Analog I/OArduino: Analog I/O
Arduino: Analog I/OJune-Hao Hou
 

Similar to Ppt mikrokontroller (20)

Running led
Running ledRunning led
Running led
 
Design and Implementation of smart office management system
Design and Implementation of smart office management systemDesign and Implementation of smart office management system
Design and Implementation of smart office management system
 
Program Running Led
Program Running LedProgram Running Led
Program Running Led
 
publish manual
publish manualpublish manual
publish manual
 
Apr9600 voice-recording-and-playback-system-with-j
Apr9600 voice-recording-and-playback-system-with-jApr9600 voice-recording-and-playback-system-with-j
Apr9600 voice-recording-and-playback-system-with-j
 
Alcohol sensing alert with engine locking project
Alcohol sensing alert with engine locking projectAlcohol sensing alert with engine locking project
Alcohol sensing alert with engine locking project
 
Gas leakage detection system
Gas leakage detection systemGas leakage detection system
Gas leakage detection system
 
Arduino projects & tutorials
Arduino projects & tutorialsArduino projects & tutorials
Arduino projects & tutorials
 
ESD_Project-Report
ESD_Project-ReportESD_Project-Report
ESD_Project-Report
 
MaxBotix Code Examples
MaxBotix Code ExamplesMaxBotix Code Examples
MaxBotix Code Examples
 
LUMOS
LUMOSLUMOS
LUMOS
 
Mom presentation_monday_arduino in the physics lab
Mom presentation_monday_arduino in the physics labMom presentation_monday_arduino in the physics lab
Mom presentation_monday_arduino in the physics lab
 
Anup2
Anup2Anup2
Anup2
 
Chp7 pic 16 f84 interfacing - copy
Chp7 pic 16 f84 interfacing - copyChp7 pic 16 f84 interfacing - copy
Chp7 pic 16 f84 interfacing - copy
 
Multi-Function Automatic Move Smart Car for Arduino
Multi-Function Automatic Move Smart Car for ArduinoMulti-Function Automatic Move Smart Car for Arduino
Multi-Function Automatic Move Smart Car for Arduino
 
IRJET -Arduino based Gas Leakage Detection for Living Security
IRJET -Arduino based Gas Leakage Detection for Living SecurityIRJET -Arduino based Gas Leakage Detection for Living Security
IRJET -Arduino based Gas Leakage Detection for Living Security
 
2003 presentation24
2003 presentation242003 presentation24
2003 presentation24
 
MITSUBISHI ELECTRIC SPLIT-TYPE
MITSUBISHI ELECTRIC SPLIT-TYPEMITSUBISHI ELECTRIC SPLIT-TYPE
MITSUBISHI ELECTRIC SPLIT-TYPE
 
Ad90 Transponder Key Duplicator User Manual
Ad90 Transponder Key Duplicator User ManualAd90 Transponder Key Duplicator User Manual
Ad90 Transponder Key Duplicator User Manual
 
Arduino: Analog I/O
Arduino: Analog I/OArduino: Analog I/O
Arduino: Analog I/O
 

Recently uploaded

Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxAdelaideRefugio
 
UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024Borja Sotomayor
 
The Liver & Gallbladder (Anatomy & Physiology).pptx
The Liver &  Gallbladder (Anatomy & Physiology).pptxThe Liver &  Gallbladder (Anatomy & Physiology).pptx
The Liver & Gallbladder (Anatomy & Physiology).pptxVishal Singh
 
Improved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppImproved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppCeline George
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesPooky Knightsmith
 
8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital ManagementMBA Assignment Experts
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfPondicherry University
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxCeline George
 
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...Nguyen Thanh Tu Collection
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaEADTU
 
The Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFThe Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFVivekanand Anglo Vedic Academy
 
How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17Celine George
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....Ritu480198
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnershipsexpandedwebsite
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...Nguyen Thanh Tu Collection
 
PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxMarlene Maheu
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文中 央社
 

Recently uploaded (20)

Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptx
 
UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024
 
The Liver & Gallbladder (Anatomy & Physiology).pptx
The Liver &  Gallbladder (Anatomy & Physiology).pptxThe Liver &  Gallbladder (Anatomy & Physiology).pptx
The Liver & Gallbladder (Anatomy & Physiology).pptx
 
Improved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppImproved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio App
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical Principles
 
8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management
 
ESSENTIAL of (CS/IT/IS) class 07 (Networks)
ESSENTIAL of (CS/IT/IS) class 07 (Networks)ESSENTIAL of (CS/IT/IS) class 07 (Networks)
ESSENTIAL of (CS/IT/IS) class 07 (Networks)
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
Supporting Newcomer Multilingual Learners
Supporting Newcomer  Multilingual LearnersSupporting Newcomer  Multilingual Learners
Supporting Newcomer Multilingual Learners
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptx
 
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
 
Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"
 
The Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFThe Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDF
 
How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptx
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
 

Ppt mikrokontroller

  • 1. 3 PERCOBAAN LED PADA ATMEGA- 16 MENGGUNAKAN BASCOM-AVR KHAZIM FIKRI MAKSALENA 1710501022 DOSEN PENGAMPU R. SURYOTO EDY RAHARJO S. T., M. Eng TEKNIK ELEKTRO FAKULTAS TEKNIK UNIVERSITAS TIDAR
  • 2. FLOWCHART PROGRAM 1 LAMPU BERKEDIP SATU ARAH
  • 3. START COMPILER SETUP HARDWARE SETUP DO LED ON PORT A PIN 0 Wait 300ms END LED ON PORT A PIN 7 LED ON PORT A PIN 6 LED ON PORT A PIN 4 LED ON PORT A PIN 5 LED ON PORT A PIN 2 LED ON PORT A PIN 1 LED ON PORT A PIN 3 LOOP Wait 300ms Wait 300ms Wait 300ms Wait 300ms Wait 300ms Wait 300ms Wait 300ms
  • 4. Memulai program Pendeklarasian Port yang akan digunakan Memulai program atau perulangan perintah Lampu yang menyala START COMPILER SETUP HARDWARE SETUP DO LED ON PORT A PIN 0
  • 5. Delay / penundaan waktu Kembali ke program awal Program berakhir Wait 300ms END LOOP
  • 7. 'program LED' $regfile = "m161def.dat" 'library mikrokontroler yang dipakai, $crystal = 8000000 'menyatakan clock oscillator yang dipakai 1 MHz, Config Porta = Output 'mendeklarasikan port yang digunakan sebagai output, Do 'mulai menjalankan perintah dan perulangan/loop, Porta = &B00000001 'PORTA PIN 0, LED menyala, Waitms 300 'delay 300ms, Porta = &B00000010 'PORTA PIN 1, LED menyala Waitms 300 'delay 300ms, Porta = &B00000100 'PORTA PIN 2, LED menyala, Waitms 300 'delay 300ms, Porta = &B00001000 'PORTA PIN 3, LED menyala, Waitms 300 'delay 300ms,
  • 8.  Porta = &B00010000 'PORTA PIN 4, LED menyala,  Waitms 300 'delay 300ms,  Porta = &B00100000 'PORTA PIN 5, LED menyala,  Waitms 300 'delay 300ms,  Porta = &B01000000 'PORTA PIN 6, LED menyala,  Waitms 300 'delay 300ms,  Porta = &B10000000 'PORTA PIN 7, LED menyala,  Waitms 300 'delay 300ms,  Loop 'kembali ke perintah awal, .  End 'program berakhir.
  • 9. FLOWCHART PROGRAM 2 LAMPU BERKEDIP BOLAK-BALIK
  • 10. START COMPILER SETUP HARDWARE SETUP LED ON PORT A PIN 0 WAIT 300MS DO LED ON PORT A PIN 1 WAIT 300MS LED ON PORT A PIN 6 WAIT 300MS LED ON PORT A PIN 5 WAIT 300MS LED ON PORT A PIN 4 WAIT 300MS LED ON PORT A PIN 3 WAIT 300MS LED ON PORT A PIN 2 WAIT 300MS LED ON PORT A PIN 4 WAIT 300MS LED ON PORT A PIN 5 WAIT 300MS LED ON PORT A PIN 6 WAIT 300MS LED ON PORT A PIN 7
  • 11. LOOP END WAIT 300MS LED ON PORT A PIN 3 WAIT 300MS LED ON PORT A PIN 2 WAIT 300MS LED ON PORT A PIN 1 WAIT 300MS LED OFF PORT A SEMUA PIN WAIT 300MS
  • 12. Memulai program Pendeklarasian Port yang akan digunakan Memulai program atau perulangan perintah Lampu yang menyala Delay / penundaan waktu Kembali ke program awal Program berakhir START COMPILER SETUP HARDWARE SETUP LED ON PORT A PIN 0 WAIT 300MS DO LOOP END
  • 14.  'program LED'  $regfile = "m161def.dat" 'library mikrokontroler yang dipakai,  $crystal = 8000000 'menyatakan clock oscillator yang dipakai 1 MHz,  Config Porta = Output 'menyatakan PORT yang digunakan sebagai output,  Do 'perintah dan perulangan dimulai,  Porta = &B00000001 'PORTA PIN 0, LED menyala,  Waitms 300 'delay 300ms,  Porta = &B00000010 'PORTA PIN 1, LED menyala,  Waitms 300 'delay 300ms,  Porta = &B00000100 'PORTA PIN 2, LED menyala,  Waitms 300 'delay 300ms,  Porta = &B00001000 'PORTA PIN 3, LED menyala,  Waitms 300 'delay 300ms,  Porta = &B00010000 'PORTA PIN 4, LED menyala,  Waitms 300 'delay 300ms,  Porta = &B00100000 'PORTA PIN 5, LED menyala,  Waitms 300 'delay 300ms,  Porta = &B01000000 'PORTA PIN 6, LED menyala,  Waitms 300 'delay 300ms,  Porta = &B10000000 'PORTA PIN 7, LED menyala,  Waitms 300 'delay 300ms,
  • 15.  Porta = &B01000000 'PORTA PIN 6, LED menyala,  Waitms 300 'delay 300ms,  Porta = &B00100000 'PORTA PIN 5, LED menyala,  Waitms 300 'delay 300ms,  Porta = &B00010000 'PORTA PIN 4, LED menyala,  Waitms 300 'delay 300ms,  Porta = &B00001000 'PORTA PIN 3, LED menyala,  Waitms 300 'delay 300ms,  Porta = &B00000100 'PORTA PIN 2, LED menyala,  Waitms 300 'delay 300ms,  Porta = &B00000010 'PORTA PIN 1, LED menyala,  Waitms 300 'delay 300ms,  Porta = &B00000001 'PORTA PIN 0, LED menyala,  Waitms 300 'delay 300ms,  Porta = &B00000000 'PORTA PIN 0, LED menyala,  Waitms 300 'delay 300ms,  Loop 'kembali ke program awal'  End 'program selesai.
  • 16. FLOWCHART PROGRAM 3 LAMPU BERKEDIP DUA ARAH BOLAK-BALIK
  • 17. START DO COMPILE SETUP HARDWARE SETUP LED ON PORT A, PIN 2,3,4,5 WAIT 300ms LED ON PORT A, PIN 0,1,6,7 WAIT 300ms LED ON PORT A, PIN 0 & 7 WAIT 300ms LED ON PORT A, PIN 1 & 6 WAIT 300ms LED ON PORT A, PIN 2 & 5 WAIT 300ms LED ON PORT A, PIN 3 & 4 WAIT 300ms LED ON PORT A, PIN 2 & 5 WAIT 300ms LED ON PORT A, PIN 1 & 6 WAIT 300ms LED ON PORT A, PIN 0 & 7 WAIT 300ms
  • 18. LOOP END LED ON PORT A, PIN 0 &7 LED OFF PORT A, SEMUA PIN WAIT 300ms LED ON PORT A, PIN 0,1,6,7 WAIT 300ms WAIT 300ms LED OFF PORT A, SEMUA PIN WAIT 300ms
  • 20.  'program LED'  $regfile = "m161def.dat" 'library mikrokontroler yang dipakai,  $crystal = 8000000 'menyataka clock oscillator yang dipakai 1 MHz,  Config Porta = Output 'mendeklarasikan port yang digunakan sebagai output,  Do 'mulai menjalankan perintah dan perulangan/loop,  Porta = &B10000001 'PORTA, PIN : 0 & 7, LED menyala,  Waitms 100 'delay 100ms,  Porta = &B01000010 'PORTA, PIN : 1 & 6, LED menyala,  Waitms 100 'delay 100ms,  Porta = &B00100100 'PORTA, PIN : 2 & 5, LED menyala,  Waitms 100 'delay 100ms,  Porta = &B00011000 'PORTA, PIN : 3 & 4, LED menyala,  Waitms 100 'delay 100ms,  Porta = &B00100100 'PORTA, PIN : 2 & 5, LED menyala,  Waitms 100 'delay 100ms,  Porta = &B01000010 'PORTA, PIN : 1 & 6, LED menyala,  Waitms 100 'delay 100ms,  Porta = &B10000001 'PORTA, PIN : 0 & 7, LED menyala,  Waitms 100 'delay 100ms,
  • 21.  Porta = &B11000011 'PORTA, PIN : 0,1,6,7, LED menyala,  Waitms 100 'delay 100ms,  Porta = &B00111100 'PORTA, PIN : 2,3,4,5, LED menyala,  Waitms 100 'delay 100ms,  Porta = &B11000011 'PORTA, PIN : 0,1,6,7, LED menyala,  Waitms 100 'delay 100ms,  Porta = &B00000000 'PORTA, PIN : MATI, semua LED mati,  Waitms 100 'delay 100ms,  Porta = &B11111111 'PORTA, PIN : 0 sampai 7, LED menyala,  Waitms 100 'delay 100ms,  Porta = &B00000000 'PORTA, PIN : MATI, semua LED mati,  Waitms 100 'delay 100ms,  Loop 'kembali ke perintah awal,  End 'perintah berakhir.