Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 7

Mikrokontroller

MIKROKONTROLLER AT89S8252
Expanded Mode
Set Instruksi :
Transfer Data Data Bus
Operasi bit Address Bus
Aritmatika Control Bus
Logika
Percabangan

SISTEM
AT89S8252

Single On Chip
Mode
Feature :
Port I/O = 4 bh
Ram 256 Byte
Software Pendukung :
Flash memory 8KB
Assembler
EEPROM = 2KB
Downloader
Timer/Counter = 3 bh
Interrupt
Serial komunikasi

1
Mikrokontroller

OPERASI BIT

DAFTAR INSTRUKSI

Siklus
No Mnemonik Penjelasan Byte
Mesin
1. CLR C C0 1 1
2. CLR bit bit  0 2 1
3. SETB C C1 1 1
4. SETB bit bit  1 2 1
5. CPL C C  komplemen C 1 1
6. CPL bit bit  komplemen bit 2 1
7. ANL C,bit C  C AND bit 2 2
8. ANL C,/bit C  C AND komplemen bit 2 2
9. ORL C,bit C  C OR bit 2 2
10. ORL C,/bit C  C OR komplemen bit 2 2
11. MOV C,bit C  bit 2 1
12. MOV bit.C bit  C 2 2

Keterangan : C = Carry

LATIHAN

1. AND Logic

a. Tabel Kebenaran b. Fungsi

B A Q Q  A.B
0 0 0
0 1 0
1 0 0
1 1 1

2
Mikrokontroller

c. Diagram Blok d. Program


uC
ORG 0
C START: MOVC,P0.0
P0.0 C ANL C,P0.1
AND P1.0
MOV P1.0,C
P0.1
SJMP START

2. OR Logic

a. Tabel Kebenaran b. Fungsi

B A Q QAB
0 0 0
0 1 1
1 0 1
1 1 1

c. Diagram Blok d. Program


uC
ORG 0
C START: MOVC,P0.0
P0.0 OR
C ORL C,P0.1
P1.0
P0.1 MOV P1.0,C
SJMP

3. NAND Logic

a. Tabel Kebenaran b. Fungsi

B A Q Q  AB

0 0 1 Q  AB

0 1 1
1 0 1 Q  AB

1 1 0 Q  AB

c. Diagram Blok d. Program


uC
ORG 0
C START: MOV C,P0.0
P0.0 OR
C CPL C
P1.0
P0.1 ORL C,/P0.1
MOV P1.0,C
SJMP
3
Mikrokontroller

4. NAND Logic

a. Diagram Blok b. Program


uC
ORG 0
C START: MOV C,P0.0
P0.0 C ANL C,P0.1
AND P1.0 CPL C
P0.1 MOV P1.0,C
SJMP

5. AND Logic (3 INPUT)

a. Tabel Kebenaran b. Fungsi

C B A Q
Q  ABC
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 0
1 0 0 0
1 0 1 0
1 1 0 0
1 1 1 1

c. Diagram Blok uC d. Program

C ORG 0
P0.0 C START: MOV C,P0.0
AND
C ANL C,P0.1
P0.1 AND P1.0
ANL C,P0.2
P0.2 MOV P1.0,C
SJMP START

4
Mikrokontroller

6. AND-OR Combination

a. Tabel Kebenaran b. Fungsi

D C B A Q Q  ABCD  ABCD  ABCD


 AB
0 0 0 0 0 Q
Q  AB( C  CD )
Q  AB
0 0 0 1 0 Q  AB.( C  D )
0 0 1 0 0
0 0 1 1 0
0 1 0 0 0
0 1 0 1 0
0 1 1 0 0
0 1 1 1 1
1 0 0 0 0
1 0 0 1 0
1 0 1 0 0
1 0 1 1 1
1 1 0 0 0
1 1 0 1 0
1 1 1 0 0
1 1 1 1 1

c. Diagram Blok d. Program


uC
ORG 0
(A) C
P0.0 C00H START: MOV C,P0.0
AND
(B)
ANL C,P0.1
P0.1 MOV 00H,C
AND C
P1.0 MOV C,P0.2
C (Q)
(C) P0.2 C ORL C,P0.3
OR
ANL C,00H
(D) P0.3 MOV P1.0,C
SJMP START
7. AND-OR-NAND Combination

a. Diagram Blok b. Program


uC

C ORG 0
P0.0 C00 START: MOVC,P0.0
AND
H ANL C,P0.1
P0.1
C MOV
AND P1.0
C 00H,C
P0.2 OR C MOV
C,P0.2
P0.3
ORL C,P0.3
ANL C,00H

5
Mikrokontroller

8. EQUIVALEN Function atau XNOR

a. Tabel Kebenaran b. Fungsi

B A Q Q  A.B  A.B

0 0 1
0 1 0
1 0 0
1 1 1

c. Diagram Blok d. Program


uC
ORG 00H
START: MOV C,P0.0
P0.0 C CPL C
EQV P1.0
P0.1 ANL C,/P0.1
MOV 00H,C
MOV C,P0.0
ANL C,P0.1
ORL C,00H
MOV P1.0,C
SJMP START

9. XOR (EXCLUSIVE OR)

a. Tabel Kebenaran b. Fungsi

B A Q Q  A.B  A.B

0 0 0
0 1 1
1 0 1
1 1 0

c. Diagram Blok d. Program

uC ORG 00H
START: MOV C,P0.1
ANL C,/P0.0
P0.0 XOR C MOV 00H,C
P1.0
MOV C,P0.0
P0.1
ANL C,/P0.1
ORL C,00H
MOV P1.0,C
SJMP START

6
Mikrokontroller

10. R-S FLIP FLOP (Menggunakan Push Button)

a. Tabel Kebenaran c. Fungsi


Z  (/ P 0.1)  ( P1.0)
R S Qn+1 Z SQ
P1.0  ( P 0.0).( Z )
0 0 0 Q  R .Z

0 1 0 P1.0  ( P 0.0).[/ P 0.1  P1.0]

1 0 1
1 1 Qn

b. Diagram Blok d. Program


uC
ORG 00H
(R) MOV P1,#0
P0.0
P1.0 START: MOV C,P1.0
AND
(S) Z (Q) ORL C,/P0.1
P0.1 ANL C,P0.0
OR
MOV P1.0,C
SJMP START

You might also like