Professional Documents
Culture Documents
ELEKTRONIK
NAMA KOD : DEB 2323
KURSUS : ASAS MIKROPENGAWAL
(BASIC MICROCONTROLLER)
KOMPETENSI 1 :
MENGENALPASTI ASAS PENGAWAL-MIKRO
(CLASSIFY BASIC MICRO-CONTROLLER)
PENGENALAN
KEPADA
DUNIA
MIKROPENGAWAL
Fungsi gambar di
atas?
s
ad tablet
i-p m
a
r
t
La to p
p- p
l m-
top h pa
o
n
e
Micro-processor
@
Mikro-pemprosess
Mikropengawal biasanya lebih
murah dan ringkas berbanding
mikropemproses
CPU, RAM dan memori
dalam mikropengawal
(µC) berada dalam satu
cip. Ini tidak untuk
computer (uP), komponen
tersebut berada dalam cip
yang berasingan dalam
komputer
Definisi mikro-pemproses :
- Mikro-pemproses (biasa disingkatkan µP atau uP) atau
CPU ialah sebuah cip berbentuk segiempat bujur yang
dipasang pada bahagian atas sebelah kanan papan
induk(mother-board) digunakan di dalam komputer
persendirian anda.
Definisi mikro-pemproses……..
- Fungsi utama uP di dalam sebuah peranti komputer
ialah memproses data dan maklumat yang diterima
daripada peranti input.
Definisi mikro-pemproses……
- Ciri-ciri uP boleh dikenalpasti melalui data yang tertulis
pada cip berkenaan yang menunjukkan kelajuan dan jenis
litar bersepadu yang digunakan.
Rajah blok mikro-pemproses
Rajah blok mikro-pemproses….
Fungsi ?????
Kereta kawalan
Penghawa
dingin ? Peti sejuk
Pemain
DVD
Micro-controllers
@
Mikro-pengawal
Pengenalan
Apakah itu mikro-pengawal?
Mikro-pengawal (sinonim µC, uC or MCU) ialah
komputer mini pada satu litar bersepadu yang
mengandungi :
* teras pemproses (processor core)
* perisian pengaturcaraan
masukan/keluaran
(programmable input/output peripherals)
Pengenalan
µC adalah seperti komputer kecil yang
menjalankan program kecil dan sering
digunakan untuk automasi dan robotic
•Rekabentuk (Architecture):
•Harvard
•Von Neumann (or Princeton)
Pengkelasan (Classification) µc
Ingatan (Memory) :
•FLASH
•EEPROM
•SRAM
•Embedded memory
•External memory
•Keluarga (Families) :
•ATMEL AVR - atmega, Xmega, Attiny…
•PIC - PIC16F, PIC18F
•ARM - ARM7, ARM9, ARM11
•8051 - AT89s52, p89v51rd2
•Motorola - 68HC11
Kemajuan/Pembangunan µC
Jenis-jenis µC
9
Parallax Propeller
Freescale 68HC11 (8-bit)
Intel 8051
Silicon Laboratories Pipelined 8051
Microcontrollers
ARM processors (from many vendors) using
ARM7 or Cortex-M3 cores are generally
microcontrollers
STMicroelectronics STM8 (8-bit), ST10 (16-bit)
and STM32 (32-bit)
Atmel AVR (8-bit), AVR32 (32-bit), and
AT91SAM (32-bit)
Jenis-jenis µC
ROM
(Read Only Memory)
RAM
(Read Acsses Memory)
(ROM) µC ?
Contoh aplikasi ingatan (ROM)
dan (RAM) pada ingatan µC
Mikropengawal
8051(Intel)
8 bit dan 16 bit.
Mikropengawal 8051- 16 bit
Spesifikasi pin (Pin Description)
µC 8051 - 16 bit
Rekabentuk (Architectures) µC 8051 16 bit
Rekabentuk (Architectures) µC 8065 – 16 bit
Contoh projek aplikasi µC 8051-16 bit
Mikropengawal 8051- 8 bit
Spesifikasi pin (Pin Description)
µC 8051 - 8 bit
P1.0 1 40 Vcc
P1.1 2 39 P0.0(AD0
P1.2 3 38 )P0.1(AD1)
P1.3
P1.4
4
5
8051 37
36 P
P0.2(AD2
) 0.3(AD3)
P1.5 6 (8031) 35 P0.4(AD4)
P1.6 7 34 P0.5(AD5)
P1.7 8 33 P0.6(AD6)
RST 9 32 P0.7(AD7)
(RXD)P3.0 10 31 EA/VPP
(TXD)P3.1 11 30 ALE/PROG
(INT0)P3.2 12 29 PSEN
(INT1)P3.3 13 28 P2.7(A15)
(T0)P3.4 14 27 P2.6(A14
(T1)P3.5 15 26 )P2.5(A13
(WR)P3.6 16 25 )P2.4(A12
(RD)P3.7 17 24 )P2.3(A11)
XTAL2 18 23 P2.2(A10)
XTAL1 19 22 P2.1(A9)
GND 20 21 P2.0(A8)
Contoh blok dalaman µC 8 bit jenis AVR
Microchip PIC
11
PIC is a family of Harvard architecture
microcontroller made by Microchip Technology.
The name PIC initially referred to "Peripheral
Interface Controller“ . PIC microcontrollers were
the first RISC microcontroller.
PICs are popular with both industrial developers and
hobbyists alike due to their low cost, wide
availability, large user base, extensive collection of
application notes, availability of low cost or free
development tools, and serial programming (and re-
programming with flash memory) capability.
PIC Microcontroller product family
13
8-bit microcontrollers
32-bit microcontrollers
PIC32
PIC10
PIC12
16-bit digital signal controllers
PIC14
dsPIC30
PIC16
dsPIC33F
PIC17
PIC18
16-bit microcontrollers
PIC24F
PIC24H
PIC Microcontroller product family
14
The F in a name generally indicates the PICmicro uses flash
memory and can be erased electronically.
The C generally means it can only be erased by exposing the
die to ultraviolet light (which is only possible if a windowed
package style is used). An exception to this rule is the
PIC16C84 which uses EEPROM and is therefore electrically
erasable. 1 :
Why use PIC16F877?
15
Why PIC16F877A is very popular?
This is because PIC16F877A is very cheap. Apart from that
it is also very easy to be assembled. Additional components
that you need to make this IC work is just a 5V power
supply adapter, a 20MHz crystal oscillator and 2 units of
22pF capacitors.
What is the advantages of PIC16F877A?
This IC can be reprogrammed and erased up to 10,000
times. Therefore it is very good for new product
development phase.
What is the disadvantages of PIC16F877A?
This IC has no internal oscillator so you will need an
external crystal of other clock source.
Features of Key Features PIC16F877
Timers 3
CCP 2
PIC16F877
Architecture
20
PIC16F877
Internal Block Diagram
21
The basic architecture of PIC16F877 consists of
Program memory, file registers and RAM, ALU
and CPU registers.
W, working register
Program Counter
29
Program Counter (PC) is 13 bit and capable of addressing an 8K
word x 14 bit program memory space.
PC keeps track of the program execution by holding the address
of the current instruction. It is automatically incremented to the
next instruction during the current instruction execution.
INDF Register
(INDirect through FSR, address = 00H, 80H)
INDF is not a physical register. Accessing INDF is actually
access the location pointed to by FSR in indirect addressing
mode.
PCL Register
(Program Counter Low Byte, address =02H, 82H)
PCL is actually the lower 8-bits of the 13-bit Program Counter. This is a
31 both readable and writable register.
PCLATH Register
(Program Counter LATcH, address = 0AH, 8AH)
PCLATH is a 8-bit register which can be used to decide the upper 5-bits of
the PC. PCLATH is not the upper 5bits of the PC. PCLATH can be read
from or written to without affecting the PC. The upper 3 bits of PCLATH
remain zero and they serve no purpose. When PCL is written to, the lower
5bits of PCLATH are automatically loaded to the upper 5bits of the PC, as
shown below:
32
In order to start programming and build automated
system, there is no need to study all the registers of
the memory map, but only a few most important ones:
STATUS register – changes/moves from/between the
banks.
PORT registers – assigns logic values (“0”/”1”) to the
ports
TRIS registers – data direction register (input/output)
STATUS Register
33
Is an 8-bit register that stores the status of the processor.
In most cases, this register is used to switch between the banks
(Register Bank Select), but also has other capabilities.