SlideShare a Scribd company logo
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

Apple 1 manual & warranty 1976
Apple 1 manual & warranty 1976Apple 1 manual & warranty 1976
Apple 1 manual & warranty 1976
Online Fashion Success
 
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
Vishnu 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 system
pragyajain53
 
Cell phone detector
Cell phone detectorCell phone detector
Cell phone detector
ARIF HUSSAIN
 
MPLABX with proteus
MPLABX with proteusMPLABX with proteus
MPLABX with proteus
Jabez Winston
 
Alcohol detection & driver safety
Alcohol detection & driver safetyAlcohol detection & driver safety
Alcohol detection & driver safety
sanket jain
 
Automatic Garage System using VHDL
Automatic Garage System using VHDLAutomatic Garage System using VHDL
Automatic Garage System using VHDL
Ahmed 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

Running led
Running ledRunning 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
Dhaka University of engineering & technology
 
Program Running Led
Program Running LedProgram Running Led
Program Running Led
NadaPutra
 
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
icstation
 
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
hemanth prudhvi jidugu
 
Gas leakage detection system
Gas leakage detection systemGas leakage detection system
Gas leakage detection system
Aashiq Ahamed N
 
Arduino projects & tutorials
Arduino projects & tutorialsArduino projects & tutorials
Arduino projects & tutorials
Anshu Pandey
 
ESD_Project-Report
ESD_Project-ReportESD_Project-Report
ESD_Project-ReportAhmad Faizan
 
MaxBotix Code Examples
MaxBotix Code ExamplesMaxBotix Code Examples
MaxBotix Code Examples
MaxBotix 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 lab
Annamaria 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 Arduino
Wanita 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 Security
IRJET Journal
 
2003 presentation24
2003 presentation242003 presentation24
2003 presentation24Sarth Lodhi
 
MITSUBISHI ELECTRIC SPLIT-TYPE
MITSUBISHI ELECTRIC SPLIT-TYPEMITSUBISHI ELECTRIC SPLIT-TYPE
MITSUBISHI ELECTRIC SPLIT-TYPE
MUSTAFA AHMED ABDULJABBAR
 
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

Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Po-Chuan Chen
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 

Recently uploaded (20)

Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 

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.