MASIGNALPHAS2101
6680671983845063762

Pemrograman Assembly - Program Thermometer Digital

Pemrograman Assembly - Program Thermometer Digital
Add Comments
8/06/2016
ari


; =========================================
; Judul: Program Thermometer Digital
; Port : Port0 => DISPLAY 7-segmen
; Port1 => -
; Port2 => P2.0 = digit 1
; P2.1 = digit 2
; P2.2 = digit 3
; Port3 => Input ADC
; Ket  : 7segment menampilkan data suhu
; -----------------------------------------
; By   : ARC. Robotika Club
;       =========================================

$MOD51
org 00h
jmp start

org 100h

;inisialisasi
;------------

digit1_1 equ 30h
digit1_2 equ 31h
digit2_1 equ 32h
digit2_2 equ 33h
digit3_1 equ 34h
digit3_2 equ 35h
digit4_1 equ 36h
digit4_2 equ 37h
buffer1 equ 38h
buffer2 equ 39h
buffer3 equ 3ah
buffer4 equ 3bh
buffer5 equ 3ch
buffer6 equ 3dh
buffer7 equ 3eh
buffer8 equ 3fh
data1 equ 40h
data2 equ 41h
data3 equ 42h
data4 equ 43h

mov data1,#0
mov data2,#0
mov data3,#0
mov data4,#0

start:

; bit0-bit1 = lampu/led m-k-h
; bit2-bit3 = pemilih digit display 7-segment
; bit4-bit7 = data digit display 7-segment

mov p0,#00001011b
call delay
mov p0,#00010111b
call delay

mov p1,#00101011b
call delay
mov p1,#00110111b
call delay

mov p2,#01001010b
call delay
mov p2,#01010110b
call delay

mov p3,#01101001b
call delay
mov p3,#01110101b
call delay
jmp start

delay:
mov r0,#10
del1: mov r1,#10
del2: djnz r1,del2
djnz r0,del1
ret

end
Hestech Indonesia

Innovasi di bidang Teknologi, Listrik, Teknik Komputer dan gaya Hidup. Info lainnya tentang praktik konservasi berbasis Sains, inovasi, dan kearifan lokal