hei sobat. hehehe. maaf lanjutannya lama. tapi kan admin masih menunaikan janjinya. ok. nih sob lanjutannya
Penguat Tegangan dan Penguat arus
1. DAC
DAC (Digital to Analog Converter) merupakan rangkaian pengubah data-data digital menjadi besaran tegangan analog. Sama dengan ADC, DAC juga mempunyai resolusi untuk setiap bitnya. Dengan DAC 8 bit, maka resolusi yang didapat adalah sebesar 5/2n atau sebesar 5/256 = 0,02 Volt.
DAC pabrikan sudah banyak yang beredar misalnya DAC0808 yang merupakan 8 bit DAC. Namun dengan perkembangan teknologi digital, terutama mikrokontroller berjenis AVR yang sudah menyediakan fasilitas PWM (Pulse Width Modulation) sebagai pengganti DAC-nya.
Dalam pembuatan Power Suply ini DAC yang digunakan bukanlah jenis IC seperti DAC0808 ataupun jenis PWM namun masih menggunakan DAC R-2R yang merupakan DAC yang sangat sederhana dan murah.
I. RANGKAIAN POWER SUPPLY
Rumus Penguatan Non-Inverting
Av
Vout = Av . Vin
Keterangan: Av = Penguatan
ü DAC (Digital To Analog Converter)
ü Minimum System Microcontroller AT 89s51
ü Display 7 Segment dengan IC 7447 (Serial In Paralel Out)
ü Display 7 Segment dengan sistem Scanning adalah cara menyalakan seven segmen secara bergantian dengan cepat sehingga tidak nampak perubahanya.
ü IC SIPO digunakan untuk menghemat port pada mikrokontroller, hanya menggunakan 2 jalur untuk mengirimkan data secara serial yaitu jalur data dan jalur clock.
dan ini dia sobat kode programnya
KODE PROGRAM
$mod51
;+++++++++++++++++++++++++++++++++++
; PROGRAM PSU DIGITAL
;+++++++++++++++++++++++++++++++++++
;================
;konfigurasi port
;================
dt_adc equ p1
out_dac equ p3
keyport equ p2
;================
;flag
;================
f_stop bit 20h.0
f_dac bit 20h.1
rst bit 20h.2
f_start bit 20h.3
f_key bit 20h.4
;================
;keypad
;================
row1 bit p2.0
row2 bit p2.1
row3 bit p2.2
row4 bit p2.3
col1 bit p2.4
col2 bit p2.5
col3 bit p2.6
col4 bit p2.7
;================
;bit sipo
;================
clk bit p0.0
data7 bit p0.1
;================
;bit scaning
;================
s0 bit p0.2
s1 bit p0.3
s2 bit p0.4
s3 bit p0.5
s4 bit p0.6
s5 bit p0.7
dseg
org 30h
d_sat: ds 1
d_pul: ds 1
d_rat: ds 1
a_sat: ds 1
a_pul: ds 1
a_rat: ds 1
atulis: ds 1
keydata:ds 1
sv: ds 1
dac: ds 1
adc: ds 1
bounce: ds 1
putar: ds 1
cseg
org 00h
jmp mulai
;========================
;Main Program
;========================
mulai: mov out_dac,#00h
mov d_sat,#0
mov d_pul,#0
mov d_rat,#0
mov a_sat,#0
mov a_pul,#0
mov a_rat,#0
mov putar,#0
star: call display
call adc_in
call display
call action
;-------------------
;input data
clr row4
jb col1,start
call sett
sjmp start
;========================
;setting & display
;========================
sett: call nool
setting:call keypad4x4
call dsp_set
;-------------------
;start konversi
clr col3
jb row4,setting
call convert_sv
ret
dsp_set:mov dptr,#tabel
mov a,d_sat
movc a,@ a+dptr
mov atulis,a
call send
clr s2
call delay
setb s2
mov a,d_pul
movc a, @ a+dptr
mov b,#01111111b
anl a,b
mov atulis,a
call send
clr s1
call delay
setb s1
mov a,d_rat
movc a,@ a+dptr
mov atulis,a
call send
clr s0
call delay
setb s0
ret
;========================
;program action
;========================
action: mov a,adc
mov b,sv
clr cy
subb a,b
jb cy,tam_dt ;milih
;========================
;kurangi dac
;------------------------
DEC dac ;jika cy>0const(positif)
mov r7,dac
cjne r7,#255,ex_act
mov dac,#0
jmp ex_act
;========================
;tambah dac
;------------------------
tam_dt: INC dac ;jika cy<0const(negatif)
mov r7,dac
cjne r7,#0,ex_act
mov dac,#255
ex_act: mov dptr,#keliru
mov a,dac
movc a,@ a+dptr
mov out_dac,a
ret
;-----------------------
;========================
;Geser Seven segmen
;========================
geser: mov d_rat,d_pul
mov d_pul,d_sat
mov d_sat,keydata
call tw
ret
;==========================
;setting point
;==========================
convert_sv:
mov a,d_rat
mov b,#100
mul ab
mov sv,a
mov a,d_pul
mov b,#10
mul ab
mov b,sv
add a,b
mov sv,a
;clr cy
mov a,sv
mov b,d_sat
add a,b
;jb cy,nool
mov sv,a
ret
nool: mov sv,#0
mov p3,#0
mov d_sat,#0
mov d_pul,#0
mov d_rat,#0
ret
;==========================
;Scaning data keypad matrix
;==========================
keypad4x4:
mov bounce,#50
mov keyport,#0ffh
setb col4
clr col1 ;(colom satu logika low)
detec: jb row1,key1
djnz bounce,detec
mov keydata,#01h ;angka 1
call geser
ret
key1: jb row2,key2
djnz bounce,key1
mov keydata,#04h ;angka 4
call geser
ret
key2: jb row3,key3
djnz bounce,key2
mov keydata,#07h ;angka 7
call geser
ret
key3: jb row4,key4
djnz bounce,key3
mov keydata,#0 ;angka *
call geser
ret
;===========================
key4: setb col1
clr col2
jb row1,key5
djnz bounce,key4
mov keydata,#02h ;angka 2
call geser
ret
key5: jb row2,key6
djnz bounce,key5
mov keydata,#05h ;angka 5
call geser
ret
key6: jb row3,key7
djnz bounce,key6
mov keydata,#08h ;angka 8
call geser
ret
key7: jb row4,key8
djnz bounce,key7
mov keydata,#00h ;angka 0
call geser
ret
;==========================
key8: setb col2
clr col3
jb row1,key9
djnz bounce,key8
mov keydata,#03h ;angka 3
call geser
ret
key9: jb row2,keyA
djnz bounce,key9
mov keydata,#06h ;angka 6
call geser
ret
keyA: jb row3,keyB
djnz bounce,keyA
mov keydata,#09h ;angka 9
call geser
ret
keyB: jb row4,keyC
djnz bounce,keyB
mov keydata,#0 ;angka #
call geser
ret
;=========================
keyC: setb col3
clr col4
jb row1,keyD
djnz bounce,keyC
mov sv,#50
call conv_cpt
ljmp start
;mov keydata,#07h ;huruf a
;call geser
ret
keyD: jb row2,keyE
djnz bounce,keyD
mov sv,#60
call conv_cpt
ljmp start
;mov keydata,#07h ;huruf b
;call geser
ret
KeyE: jb row3,keyF
djnz bounce,keyE
mov sv,#90
call conv_cpt
ljmp start
;mov keydata,#07h ;huruf c
;call geser
ret
keyF: jb row4,nokey
djnz bounce,keyF
mov sv,#120
call conv_cpt
ljmp start
;mov keydata,#07h ;huruf d
;call geser
nokey: setb col4
ret
;========================
;scaning seven segment
;========================
display:
inc putar
mov a,putar
cjne a,#100,nxdsp
call convert
mov putar,#0
nxdsp:
mov dptr,#tabel
mov a,d_sat
movc a,@ a+dptr
mov atulis,a
call send
clr s2
call delay
setb s2
mov a,d_pul
movc a, @ a+dptr
mov b,#01111111b
anl a,b
mov atulis,a
call send
clr s1
call delay
setb s1
mov a,d_rat
movc a,@ a+dptr
mov atulis,a
call send
clr s0
call delay
setb s0
;=========================
mov a,a_sat
movc a,@ a+dptr
mov atulis,a
call send
clr s5
call delay
setb s5
mov a,a_pul
movc a, @ a+dptr
mov b,#01111111b
anl a,b
mov atulis,a
call send
clr s4
call delay
setb s4
mov a,a_rat
movc a, @ a+dptr
mov atulis,a
call send
clr s3
call delay
setb s3
ret
;========================
;kirim data serial
;========================
send:
mov a,atulis
mov r5,#8
lagi: rrc a
MOV data7,c
call clock
djnz r5,lagi
ret
;========================
;Clock SIPO
; --------
clock:
clr clk
nop
nop
nop
nop
nop
setb clk
nop
nop
nop
nop
nop
ret
;=========================
;adc input
;=========================
adc_in: clr col4
nop
nop
nop
nop
setb col4
nop
nop
nop
nop
ret
;==========================
convert:
mov a,dt_adc
mov adc,a
mov b,#10
div ab
mov a_sat,b
mov b,#10
div ab
mov a_pul,b
mov a_rat,a
ex_adc: ret
conv_cpt:
mov a,sv
mov adc,a
mov b,#10
div ab
mov d_sat,b
mov b,#10
div ab
mov d_pul,b
mov d_rat,a
ret
;==========================
;Tunda Waktu
;==========================
delay: mov r6,#250
djnz r6,$
ret
TW: MOV R1,#100
TW1: MOV R2,#250
TW2: MOV R3,#10
DJNZ R3,$
DJNZ R2,TW2
DJNZ R1,TW1
RET
tabel: db 0c0h
db 0f9h
db 0a4h
db 0b0h
db 99h
db 92h
db 82h
db 0f8h
db 80h
db 90h
keliru: db 0,128,64,192,32,160,96,224,16,144,80,208,48,176,112,240,8,136,72,200,40,168
db 104,232,24,152,88,216,56,184,120,248,4,132,68,196,36,164,100,228,20,148,84
db 212,52,180,116,244,12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252
db 2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170
db 106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214
db 54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129
db 65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233
db 25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181
db 117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,3,131,67,195
db 35,163,99,227,19,147,83,211,51,179,115,243,11,139,75,203,43,171,107,235,27,155
db 91,219,59,187,123,251,7,135,71,199,39,167,103,231,23,151,87,215,55,183,119,247
db 15,143,79,207,47,175,111,239,31,159,95,223,63,191,127,255
6 comments on Power Supply Digital dengan AT89S51 [3] :
ane blum paham ama yang gni" sob,..hehehe
nice share,.....:)
nice post gan
link udah aku pasang
http://www.azislah.com/2012/04/link-exchange.html
Misbahudin@ hehehe. gpp sobat
Aziz@ ok sob
wah. ini yg saya cari. makasih
Minggu depan ada materi bagaimana membuat jam digital dari JK Flip-Flop.----
Untuk jenis power suply yang pake PWM juga menyusul...
Coba bikin ah...
Post a Comment
.:berkomentarlah dengan sopan
.:jangan berbicara kotor
.:jangan berkomentar SARA
.:Jangan sampai Spam
.:Jangan Asal COPAS. kalau mau COPAS. silahkan sertakan link sumber
.:jangan sertakan link hidup
.:dan. berkomentar adalah salah satu karakteristik sobat Blogger yang Setia dan Baik :)