Anda di halaman 1dari 29

Sistem Mikrokontroler dan Antarmuka

Kontrak Kuliah

09.01.2019

Indra Hardian Mulyadi

Indra Hardian Mulyadi, ST., M.Eng Pengenalan Mikrokontroler


indra@polibatam.ac.id Page 1
Kontrak Kuliah
• SISMUKA_Kontrak Perkuliahan_Indra.pdf
• Tambahan:
– Bonus diberikan jika bertanya atau mengoreksi dosen
(berbobot)
– Kelas Siang: Kehadiran dihitung per SKS.
• 1 SKS Teori = 50 menit
• 1 SKS Praktikum = 170 menit
– Kelas Malam: Kehadiran dihitung per sesi (sistem lama)
– Keterlambatan: Maksimal 20 menit.
• Update nilai dapat dilihat di: https://bit.ly/2CjGuYH

Indra Hardian Mulyadi, ST., M.Eng Pengenalan Mikrokontroler


indra@polibatam.ac.id Page 2
Bab 1
Pengenalan Mikrokontroler

09.01.2019

Indra Hardian Mulyadi

Indra Hardian Mulyadi, ST., M.Eng Pengenalan Mikrokontroler


indra@polibatam.ac.id Page 3
Isi
• Apa Itu Mikrokontroler
• Perbedaan Mikroprosesor dan Mikrokontroler
• Contoh Aplikasi Mikrokontroler
• Contoh Arsitektur dan Famili Mikrokontroler
• Istilah-Istilah Dalam Mikrokontroler

Indra Hardian Mulyadi, ST., M.Eng Pengenalan Mikrokontroler


indra@polibatam.ac.id Page 4
A microcontroller (or MCU for microcontroller unit) is a
small computer on a single integrated circuit.

Indra Hardian Mulyadi, ST., M.Eng Pengenalan Mikrokontroler


indra@polibatam.ac.id Page 5
Contoh Aplikasi Sederhana
• Blinking LED • Sensor LDR
• Mini Traffic Light • Sensor getar piezoelectric
• Brightness LED • Sensor jarak photodiode
• Lampu Pemadam Mini • Sensor jarak ultrasonic
• Sensor gerak PIR
• Multiple LED
• Sensor suhu LM35
• Display 7 Segment
• Sensor suhu dan
• Saklar Push button kelembaban DHT11
• LED bar graph • Komunikasi dengan
• Kendali motor servo Bluetooth (ke Smartphone)
• Kendali motor DC • Ethernet
• Play melodi • Micro SD card
• Komunikasi Wifi
• Komunikasi serial

Indra Hardian Mulyadi, ST., M.Eng Pengenalan Mikrokontroler


indra@polibatam.ac.id Page 6
Mikro prosesor vs kontroler
• Mikroprosesor adalah istilah yang merujuk pada Central
Processing Unit (CPU) komputer digital untuk tujuan
umum.
• Mikrokontroler = Mikroprosesor + Memory + Peripheral
Interfaces

Indra Hardian Mulyadi, ST., M.Eng Pengenalan Mikrokontroler


indra@polibatam.ac.id Page 7
Komponen Utama MCU
• Central Processing Unit (CPU)
• Memory
• System Clock (Oscillator)
• Peripherals

Indra Hardian Mulyadi, ST., M.Eng Pengenalan Mikrokontroler


indra@polibatam.ac.id Page 8
Indra Hardian Mulyadi, ST., M.Eng Pengenalan Mikrokontroler
indra@polibatam.ac.id Page 9
Penjualan
• Historically, the 8-bit segment has dominated the MCU market [..]
16-bit microcontrollers became the largest volume MCU category in
2011, overtaking 8-bit devices for the first time that year [..] IC
Insights believes the makeup of the MCU market will undergo
substantial changes in the next five years with 32-bit devices
steadily grabbing a greater share of sales and unit volumes. By
2017, 32-bit MCUs are expected to account for 55% of
microcontroller sales [..] In terms of unit volumes, 32-bit MCUs are
expected account for 38% of microcontroller shipments in 2017,
while 16-bit devices will represent 34% of the total, and 4-/8-bit
designs are forecast to be 28% of units sold that year. The 32-bit
MCU market is expected to grow rapidly due to increasing demand
for higher levels of precision in embedded-processing systems and
the growth in connectivity using the Internet. [..] In the next few
years, complex 32-bit MCUs are expected to account for over 25%
of the processing power in vehicles.
• — IC Insights, MCU Market on Migration Path to 32-bit and ARM-
based Devices
Indra Hardian Mulyadi, ST., M.Eng Pengenalan Mikrokontroler
indra@polibatam.ac.id Page 10
Aplikasi Mikrokontroler: Embedded System
• An embedded system is a computer system with a
dedicated function within a larger mechanical or
electrical system, often with real-time computing
constraints.
• It is embedded as part of a complete device often
including hardware and mechanical parts. Embedded
systems control many devices in common use today.
• 98% of all microprocessors are manufactured as
components of embedded systems
• Embedded system vs. General purpose computers: low
power consumption, small size, rugged operating
ranges, and low per-unit cost

Indra Hardian Mulyadi, ST., M.Eng Pengenalan Mikrokontroler


indra@polibatam.ac.id Page 11
Contoh Aplikasi Embedded System
• Embedded systems are commonly found in consumer,
cooking, industrial, automotive, medical, commercial and
military applications.
• Consumer electronics include MP3 players, mobile
phones, videogame consoles, digital cameras, GPS
receivers, and printers. Household appliances, such as
microwave ovens, washing machines and dishwashers,
include embedded systems to provide flexibility,
efficiency and features. Home automation uses wired-
and wireless-networking that can be used to control
lights, climate, security, audio/visual, surveillance, etc.,
all of which use embedded devices for sensing and
controlling.

Indra Hardian Mulyadi, ST., M.Eng Pengenalan Mikrokontroler


indra@polibatam.ac.id Page 12
Indra Hardian Mulyadi, ST., M.Eng Pengenalan Mikrokontroler
indra@polibatam.ac.id Page 13
https://epsnews.com/2017/05/01/nxp-tops-microcontroller-supplier-ranking/
May 1, 2017

Indra Hardian Mulyadi, ST., M.Eng Pengenalan Mikrokontroler


indra@polibatam.ac.id Page 14
8051 PIC AVR ARM
8-bit for standard 32-bit mostly also
Bus width 8/16/32-bit 8/32-bit
core available in 64-bit

UART, USART,
UART, USART, LIN, I2C, SPI,
PIC, UART,
SPI, I2C, (special CAN, USB,
Communication UART, USART, LIN,
purpose AVR Ethernet, I2S,
Protocols USART,SPI,I2C CAN, Ethernet,
support CAN, DSP, SAI (serial
SPI, I2S
USB, Ethernet) audio
interface), IrDA

12 4 1
1 clock/
Speed Clock/instruction Clock/instruction clock/ instruction
instruction cycle
cycle cycle cycle
ROM, SRAM, FL Flash, SRAM, Flash, SDRAM,
Memory SRAM, FLASH
ASH EEPROM EEPROM
Memory Von Neumann Harvard Modified Harvard
Modified
Architecture architecture architecture architecture

Indra Hardian Mulyadi, ST., M.Eng Pengenalan Mikrokontroler


indra@polibatam.ac.id Page 15
8051 PIC AVR ARM
Power
Average Low Low Low
Consumption
PIC16,PIC17, Tiny, Atmega,
ARMv4,5,6,7 and
Families 8051 variants PIC18, PIC24, Xmega, special
series
PIC32 purpose AVR

Community Vast Very Good Very Good Vast

Apple, Nvidia,
NXP, Atmel, Silicon
Qualcomm,
Labs, Dallas,
Manufacturer Microchip Average Atmel (Microchip) Samsung
Cyprus, Infineon,
Electronics, and TI
etc.
etc.
Cost (as
compared to Very Low Average Average Low
features provide)
High speed
Known for its operation
Other Feature Cheap Cheap, effective
Standard Vast

PIC18fXX8, LPC2148, ARM


Popular AT89C51, P89v51, Atmega8, 16, 32,
PIC16f88X, Cortex-M0 to ARM
Microcontrollers etc. Arduino Community
PIC32MXX Cortex-M7, etc.

Indra Hardian Mulyadi, ST., M.Eng Pengenalan Mikrokontroler


indra@polibatam.ac.id Page 16
Istilah
• Clock
• RAM dan ROM
• Program Counter
• Reset, Interrupt
• Register, General Function Register, dan Special
Function Register
• Stack

Indra Hardian Mulyadi, ST., M.Eng Pengenalan Mikrokontroler


indra@polibatam.ac.id Page 17
Clock
Clock merupakan jantungnya MCU.

Indra Hardian Mulyadi, ST., M.Eng Pengenalan Mikrokontroler


indra@polibatam.ac.id Page 18
Clock

• Sumber clock:
1. External Crystal/Ceramic
Resonator
2. External Low-frequency
Crystal
3. External RC Oscillator
4. Calibrated Internal RC
Oscillator
5. External Clock

Indra Hardian Mulyadi, ST., M.Eng Pengenalan Mikrokontroler


indra@polibatam.ac.id Page 19
Indra Hardian Mulyadi, ST., M.Eng Pengenalan Mikrokontroler
indra@polibatam.ac.id Page 20
RAM dan ROM
• RAM = Random Access Memory. Hilang ketika power
off.
• ROM = Random Access Memory. Data masih ada
walaupun power off.

Indra Hardian Mulyadi, ST., M.Eng Pengenalan Mikrokontroler


indra@polibatam.ac.id Page 21
Program Counter (PC)

Indra Hardian Mulyadi, ST., M.Eng Pengenalan Mikrokontroler


indra@polibatam.ac.id Page 22
Registe
Register merupakan alat penyimpanan kecil yang
mempunyai kecepatan akses cukup tinggi, yang digunakan
untuk menyimpan data dan instruksi yang sedang diproses.
a) General Function Register (GFR)
b) Special Function Register (SFR)
Their purpose is predefined by the manufacturer and cannot be
changed therefore. Since their bits are physically connected to
particular circuits within the microcontroller, such as A/D
converter, serial communication module etc., any change of
their state directly affects the operation of the microcontroller or
some of the circuits. For example, writing zero or one to the
SFR controlling an input/output port causes the appropriate
port pin to be configured as input or output. In other words,
each bit of this register controls the function of one single pin

Indra Hardian Mulyadi, ST., M.Eng Pengenalan Mikrokontroler


indra@polibatam.ac.id Page 23
Indra Hardian Mulyadi, ST., M.Eng Pengenalan Mikrokontroler
indra@polibatam.ac.id Page 24
Contoh Register PORTC

Indra Hardian Mulyadi, ST., M.Eng Pengenalan Mikrokontroler


indra@polibatam.ac.id Page 25
Indra Hardian Mulyadi, ST., M.Eng Pengenalan Mikrokontroler
indra@polibatam.ac.id Page 26
Indra Hardian Mulyadi, ST., M.Eng Pengenalan Mikrokontroler
indra@polibatam.ac.id Page 27
Stack
• Stack is used for storing the current state of the program
counter (address) when an interrupt occurs. In this way,
after a subroutine or an interrupt execution, the
microcontroller knows from where to continue regular
program execution. This address is cleared after
returning to the program because there is no need to
save it any longer, and one location of the stack is
automatically available for further use. In addition, the
stack can consist of several levels. This enables
subroutines’ nesting, i.e. calling one subroutine from
another.

Indra Hardian Mulyadi, ST., M.Eng Pengenalan Mikrokontroler


indra@polibatam.ac.id Page 28
Stack saat interrupt

Indra Hardian Mulyadi, ST., M.Eng Pengenalan Mikrokontroler


indra@polibatam.ac.id Page 29

Anda mungkin juga menyukai