Sie sind auf Seite 1von 26

Rangkaian Jam Digital Mikrokontroler

| | Label: mikro
Digital hours to make this not too difficult. This series is not my original project, I trace
the series of files and program from the internet, there is no chance the program listing.
After I download the file to its hex-hour direct way. This clock only displays hours and
minutes, to seconds However you can install the led associated with a series of I Hz
oscillator formed from IC 555 (which I do, because I do not know the program listing), 2
led in parallel and installed as a bookmark seconds. Led to two installed in the middle of
the hours and minutes. Although with the way that seconds and minutes if observed
(calculated) decline slightly but I'm not the problem, Moreover people will not know
about it. Digital hours following scheme:

Circuit digital watch


To me its PCB design itself, of course are still using my favorite software, PCB designer.
Next the PCB layout (look up) :

PCB layout of digital watch

PCB file can download it here.


Hex file. can be downloaded here.

0 komentar
Kirimkan Ini lewat Email BlogThis! Berbagi ke Twitter Berbagi ke Facebook Berbagi ke
Google Buzz

Rangkaian downlowder AT89C51


| | Label: mikro
Atmel is a product AT89S51/AT89S52 that quite a lot in the market with a price of less
than 20 thousand rupiah. To start learning mikrokontroler type 89S51 this we need a
programmer And Rangkaian Downloader. Programmer is a hardware device that is used
to enter the machine language program code compilation that we write to in
mikrokontroler.

Gambar Skema Rangkaian Downloader AT89S51/AT89S52


picture above shows the circuit diagram of the in-system programmer interface, the
power to the interface is provided by the target system. The 74HCT541 ic isolate and
buffer the parallel port signals. It is necessary to use the HCT type ic in order to make
sure the programmer should also work with 3V type parallel port.
Skema rangkaian downloader ini can be use to program the 89S series devices and the
AVR series devices which are pin compatible to 8051, like 90S8515. For other AVR
series devices the user can make an adapter board for 20, 28 and 40 pin devices. The pin
numbers
shown
in
brackets
correspond
to
PC
parallel
port
connector.

Software

ISP

The ISP-30a.zip file contains the main program and the i / o port driver. Place all files in
the same folder. The main screen view of the program is shown in the picture below.

Following are the main features of this software,


Read /write the Intel Hex file
Read the signature, lock and fuse bits
Clear/Fill memory buffer
Verify with memory buffer
Reload current Hex File
Display buffer checksum
Program selected lock bits & fuses
Auto detection of hardware
0 komentar
Kirimkan Ini lewat Email BlogThis! Berbagi ke Twitter Berbagi ke Facebook Berbagi ke
Google Buzz

Rangkaian Saklar Dan Keypad Metrix


mikrokontroler AT89S51/52
| | Label: mikro
Rangkaian

saklar

for

mikrokontroler

AT89S51/52

Port mikrokontroler AT89S51/52 The complete internal pull-up, a default condition so

that it is high. To make this port as input, we live to provide logic high or ignore in the
default condition. If we want a legible entries we should use the Low input signal.
In the picture below, when the button on the keypad and press the low signal will be sent
to port 3 on mikrokontroler, Thus, this port will have a logic in accordance with the key
emphasis

Skema Rangkaian
Mikrokontroler dengan masukan Saklar
;--------------------------------------------------------------------; Simulasi penekanan tombol pd P3.0 untuk menghidupkan
; dan P3.1 untuk mematikan LED pada Port 1
;---------------------------------------------------------------------ORG 0H
MULAI:
MOV A,P3 ; Baca port 3
CJNE A,#0FEH,TERUS ; Apakah isi akumulator = 11111110B
MOV P1,#000H ; Ya! Hidupkan lampu LED di port 1
SJMP MULAI ; Ulangi lagi dari awal
TERUS:
CJNE A,#0FDH,MULAI ; Apakah isi akumulator = 11111101B
MOV P1,#0FFH ; Ya! Matikan lampu LED di port 1
SJMP MULAI ; Ulangi lagi dari awal
END
program on the work which led to the connects to the port 1, while s1 in press led will be
flame
and
when
off
in
the
pressm
S2
program on the work, which led to the connects to the port 1, while s1 in press, and led a
flame,
and
when
out
in
the
press
and
S2
How

it

works,

the

program:

When the switch connected to P3.0 in the press, the data on the port 3 is 11111110 binary
or 0FE Hexa, the program will know the content of the port 3 if data is same (0FE H) Led
then switched to the port 1, if any emphasis P3.1 , the data on the port 3 11111101 binary
or 0FD Hexa, program will check the content of port 3 if data is found in the Led on the
port 1 will be turned off
Rangkaian Keypad Matrix
4 x 4 Keypad is a keypad measuring 4 columns x 4 rows. This module can be enabled as
an input in the applications such as digital security, datalogger, attendance, motor speed
controllers, robotik, and so forth.
Hardware Specifications
Has a 16 button (function button depending on the application).
Configuration has 4 lines (input scanning) and column 4 (output scanning).

Skema Rangkaian
Mikrokontroler dengan masukan Keypad
;=======================================
; PROGRAM KEYPAD 4X4 DIPASANG
; PADA PORT 0, OUTPUT PADA PORT 1
;=======================================
KOLOM1 BIT P0.0
KOLOM2 BIT P0.1
KOLOM3 BIT P0.2
KOLOM4 BIT P0.3
BARIS1 BIT P0.4
BARIS2 BIT P0.5
BARIS3 BIT P0.6
BARIS4 BIT P0.7
KEYPORT EQU P0 ; KEYPAD CONNECT KE PORT 0

KEYDATA EQU 50H ; MEMORY DATA UNTUK KEYPAD


KEYBOUNC EQU 51H ; MEMORY UNTUK ANTI BOUNCING
ORG 0H
ULANG:
CALL KEYPAD ; PANGGIL SUB RUTIN KEYPAD
MOV A,KEYDATA
CJNE A,#0FFH,DITEKAN
JMP ULANG
DITEKAN:
CPL A
MOV P1,A
DJNZ R0,$
JMP ULANG
KEYPAD:
MOV KEYBOUNC,#100 ; KONSTANTA ANTI BOUNCING
MOV KEYPORT,#0FFH ; PORT KEY PAD
CLR KOLOM1 ; SCAN KOLOM 1
UL1: JB BARIS1,KEY1 ; TOMBOL 1 DITEKAN?
CALL DELAY
DJNZ KEYBOUNC,UL1
MOV KEYDATA,#1 ; ISI REG. DATA DGN 1
RET
KEY1: JB BARIS2,KEY2 ; TOMBOL 2 DITEKAN?
CALL DELAY
DJNZ KEYBOUNC,KEY1
MOV KEYDATA,#4
RET
KEY2: JB BARIS3,KEY3
CALL DELAY
DJNZ KEYBOUNC,KEY2
MOV KEYDATA,#7
RET
KEY3: JB BARIS4,KEY4
CALL DELAY
DJNZ KEYBOUNC,KEY3
MOV KEYDATA,#0AH
RET
KEY4: SETB KOLOM1
CLR KOLOM2
JB BARIS1,KEY5
CALL DELAY
DJNZ KEYBOUNC,KEY4
MOV KEYDATA,#2
RET
KEY5: JB BARIS2,KEY6
CALL DELAY

DJNZ KEYBOUNC,KEY5
MOV KEYDATA,#5
RET
KEY6: JB BARIS3,KEY7
CALL DELAY
DJNZ KEYBOUNC,KEY6
MOV KEYDATA,#8
RET
KEY7: JB BARIS4,KEY8
CALL DELAY
DJNZ KEYBOUNC,KEY7
MOV KEYDATA,#0
RET
KEY8: SETB KOLOM2
CLR KOLOM3
JB BARIS1,KEY9
CALL DELAY
DJNZ KEYBOUNC,KEY8
MOV KEYDATA,#3
RET
KEY9: JB BARIS2,KEY10
CALL DELAY
DJNZ KEYBOUNC,KEY9
MOV KEYDATA,#6
RET
KEY10: JB BARIS3,KEY11
CALL DELAY
DJNZ KEYBOUNC,KEY10
MOV KEYDATA,#9
RET
KEY11: JB BARIS4,KEY12
CALL DELAY
DJNZ KEYBOUNC,KEY11
MOV KEYDATA,#0BH
RET
KEY12: SETB KOLOM3
CLR KOLOM4
JB BARIS1,KEY13
CALL DELAY
DJNZ KEYBOUNC,KEY12
MOV KEYDATA,#0CH
RET
KEY13: JB BARIS2,KEY14
CALL DELAY
DJNZ KEYBOUNC,KEY13
MOV KEYDATA,#0DH

RET
KEY14: JB BARIS3,KEY15
CALL DELAY
DJNZ KEYBOUNC,KEY14
MOV KEYDATA,#0EH
RET
KEY15: JB BARIS4,KEY16
CALL DELAY
DJNZ KEYBOUNC,KEY15
MOV KEYDATA,#0FH
RET
KEY16: MOV KEYDATA,#0FFH
RET
DELAY:
DJNZ R0,$
RET
END
0 komentar
Kirimkan Ini lewat Email BlogThis! Berbagi ke Twitter Berbagi ke Facebook Berbagi ke
Google Buzz

Gambar Rangkaian Sensor Pengukur Suhu


| Senin, 08 Maret 2010 | Label: sensor-sensor
This circuit measures the water temperature. this circuit use IC CA3161 and CA3162 for
control all, The Temperature Value cant be keep always while no power supply as It
hasnt EEPROM to save. This circiut will be display for you monitoring only that is make
sense
to
implement
in
water.
The IC CA3161 is a counter and 7segment LED driver to display amount of temperature
on 7segments. About a temperature sensor is a diode which number 1N4148. This is like
of the Car Radiator. Connect to the 5 Vdc power supply from Car Battery that you can
use a LM7805 for +5Vdc regulation with low cost voltage regulator.

Skema rangkaian pengukur


suhu air
For the method of temperature measurement: first after application of at least 2 currents
of a thermal sensor, including at least two output signals are generated calculating an
analog signal to the temperature of the reaction at least two signals, the analog signal
representative of temperature to the temperature sensors, a calibration, the calibration
factor is calculated by applying the order of leastthree thermal sensor, and calibration of a
gap in the temperature of the concept of analog signal, that the development gap-term is
at least a series of parasite resistance to the thermal temperature sensor and the signal
processing theanalog digital signal to a temperature reference value for the conversion of
the reference value for the transition is consistent with the calibration.

IC LM340A Sesor Suhu


The LM340A monolithic 3-terminal positive voltage regulators employ internal currentlimiting, thermal shutdown and safe-area compensation, making them essentially
indestructible. If adequate heat sinking is provided, they can deliver over 1.0A output
current.

Parameters IC LM340A
Output Current: 1000 mA
Output Voltage: 7.5, 12, 15, 8, 5 Volt
Input Min Voltage: 7.5, 14.8, 10.5, 17.9 Volt
Input Max Voltage: 35 Volt
Temperature Min: 0 deg C
Temperature Max: 70, 125 deg C
RegType: Linear Regulator

IC CA3161E Description
The CA3161E is a monolithic integrated circuit that performs the BCD to seven segment
decoding function and features constant current segment drivers. When used with the
CA3162E A/D Converter the CA3161E provides a complete digital readout system with a
minimum number of external parts.

Absolute Maximum Ratings IC CA3161E


DC VSUPPLY (Between Terminals 1 and 10) . . . . . . . . . . . . . .+7.0V
Input Voltage (Terminals 1, 2, 6, 7). . . . . . . . . . . . . . . . . . . . . .+5.5V
Output Voltage
Output Off. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . +7V
Output On (Note 1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . +10V

IC CA3162E Description
The CA3162E are I2L monolithic A/D converters that provide a 3 digit multiplexed BCD
output. They are used with the CA3161E BCD-to-Seven-Segment Decoder/Driver and a
minimum of external parts to implement a complete 3-digit display. The CA3162AE is
identical to the CA3162E except for an extended operating temperature range.

Absolute Maximum Ratings IC CA3162E


DC Supply Voltage (Between Pins 7 and 14) . . . . . . . . . . . . . +7V
Input Voltage (Pin 10 or 11 to Ground). . . . . . . . . . . . . . . . . . . 15V
Temperature Range CA3162E. . . . . . . . . . . . . . . . . . . . . . . . . . .0 to 75oC
Temperature Range CA3162AE . .. . . . . . . . . . . . . . . . . . . . . . -40oC to 85oC
Maximum Junction Temperature . . . . . . . . . . . . . . . . . . . . . . . 150oC
Maximum Storage Temperature Range . . . . . .. . . . . . . . . . . . .-65oC to 150oC
Maximum Lead Temperature (Soldering 10s) . . . . . . . . . . . . . 300oC.
0 komentar
Kirimkan Ini lewat Email BlogThis! Berbagi ke Twitter Berbagi ke Facebook Berbagi ke
Google Buzz

Gambar Rangkaian Sensor Pendeteksi Warna


| | Label: sensor-sensor
sorThis circuit can sense eight colours, i.e. blue, green and red (primary colours);
magenta, yellow and cyan (secondary colours); and black and white. The circuit is based
on the fundamentals of optics and digital electronics. The object whose colour is required
to be detected should be placed in front of the system.

Skema Rangkaian Sensor Pendeteksi Warna


Note:

Potmeters VR1, VR2 and VR3 may be used to adjust the sensitivity of the LDRs.
Common ends of the LDRs should be connected to positive supply.
Use good quality light filters.

The light rays reflected from the object will fall on the three convex lenses which are
fixed in front of the three LDRs. The convex lenses are used to converge light rays. This
helps to increase the sensitivity of LDRs. Blue, green and red glass plates (filters) are
fixed in front of LDR1, LDR2 and LDR3 respectively. When reflected light rays from the
object fall on the gadget, the coloured filter glass plates determine which of the LDRs
would get triggered. The circuit makes use of only AND gates and NOT gates.
When a primary coloured light ray falls on the system, the glass plate corresponding to
that primary colour will allow that specific light to pass through. But the other two glass
plates will not allow any light to pass through. Thus only one LDR will get triggered and
the gate output corresponding to that LDR will become logic 1 to indicate which colour it
is. Similarly, when a secondary coloured light ray falls on the system, the two primary
glass plates corres- ponding to the mixed colour will allow that light to pass through
while the remaining one will not allow any light ray to pass through it. As a result two of

the LDRs get triggered and the gate output corresponding to these will become logic 1
and indicate which colour it is.
When all the LDRs get triggered or remain untriggered, you will observe white and black
light indications respectively.
The LDR is mounded in a tube, behind a lens, and aimed at the object. The coloured glass
filter should be fixed in front of the LDR as shown in the figure. Make three of that kind
and fix them in a suitable case. Adjustments are critical and the gadget performance
would depend upon its proper fabrication and use of correct filters as well as light
conditions.
0 komentar
Kirimkan Ini lewat Email BlogThis! Berbagi ke Twitter Berbagi ke Facebook Berbagi ke
Google Buzz

Rangkain Pendeteksi Suhu


||
This is a circuit that serves to indicate various levels of hot water in a tank. SW1 is a
normally open press button switch which allows you to view the level of hot water in a
hot water tank. When pressed the voltage difference at the junction of the thermistor and
preset is compared to the fixed voltage on the op-amps non-inverting input. Depending
on the heat of the water in the tank, the thermistors resistance will toggle the op-amp
output to swing to almost full voltage supply and light the appropriate LED.

Skema rangkaian indikator


suhu air
Note:

Op-Amp: LM324 or any quad opamp can be used or even four single op-amps.
R2-R5: 330ohm resistors, but Lower values give brighter LED output.

NTC1-4: Cold resistance was around 300K, hot resistance 15k. Alternative
thermistors may be used with different resistance ranges, but the presets P1 to P4
must also be changed as well.
R7-10: only required if your thermistors resistance is several ohms at the hottest
temperature.
P1 - P4: Chosen to match the resistance of the thermistor when cold.
R1 & R6: 100k Resistor

Masking tape was used to stick the bead thermistors to the tank. Wires were soldered and
insulated at the thermistors ends. A plastic box was used to house the circuit. Battery life
will probably be 4 to 5 years depending on how often you use the push switch, SW1.
Thermistors NTC1-4 should be spread evenly over the height of the tank. I placed NTC1
roughly 4 inches from the top of my tank and the others were spaced evenly across the
height of the hot water tank. As hot water rises the lowest sensor indicates the fullest
height of hot water and should be about 8 to 10 inches from the bottom of the tank.
With a full tank of hot water adjust P1-4 so that all LED's are lit. As hot water rises, the
sensor at the bottom of the tank will be the maximum level of hot water. "Hot" can be
translated as 50C to 80C the presets P1-4 allow adjustment of this range.
0 komentar
Kirimkan Ini lewat Email BlogThis! Berbagi ke Twitter Berbagi ke Facebook Berbagi ke
Google Buzz

Interface & Program LCD 2 x 16 to Microcontroller


| | Label: mikro
The 2 X16 Parallel LCD is an 8 bit or 4 bit parallel interfaced LCD. This unit allows the
user to display text, numerical data and custom created characters. The LCD uses the
HD44780 series LCD driver from Hitachi, or equivalent controller. The LCD is
connected to a female 14-pin connector for easy interface with the BS2p24/40 Demo
Board (#45187) and the Professional Development Board (#28138). Though the device
has the ribbon cable and 14-pin connector it may also be hooked up manually using the
diagram on the next page.
The 2 X16 Parallel LCD is an 8 bit or 4 bit parallel interfaced LCD. This unit allows the
user to display text, numerical data and custom created characters. The LCD uses the
HD44780 series LCD driver from Hitachi, or equivalent controller. The LCD is
connected to a female 14-pin
connector for easy interface with the BS2p24/40 Demo Board (#45187) and the
Professional Development Board (#28138). Though the device has the ribbon cable and
14-pin connector it may also be hooked up manually using the diagram on the next page.
The following example 2x16 LCD connection (16characters, 2 line) to a dsPIC30F
microcontroller by using a 4-bit and 8-bit interface. The following code demonstrates the

usage of the LCD Custom Library routines. The example covers the initialization of the
LCD module and instructions for contolling and writing the module. The realization is
carried out by using the mikroBasic compiler for dsPIC30F Microcontrollers. The
interconnection of the LCD module and a dsPIC30F devices by using a 4-bit interface is
shown in Fig. 13-1.

Interface LCD 2 x 16 to Microcontroller


(dsPIC30F) using 4-bit

Interface LCD 2 x 16 to Microcontroller


(dsPIC30F) using 4-bit
example program LCD 4bit
dim txt as string[15]
main:
ADPCFG = $FFFF
Lcd_Init(PORTB, 3,2,1,0, PORTD, 0,2,1)
Lcd_Cmd(LCD_CURSOR_OFF)
Lcd_Cmd(LCD_CLEAR)
Lcd_Out(1, 1, "mikroElektronika")
Lcd_Out(2, 1, "2x16 LCD Testing")
end.
example program LCD 8bit
dim txt as string[10]
main:
ADPCFG = $FFFF ' PORTB to be digital
Lcd8_Init(PORTB, 7, 6, 5, 4, 3, 2, 1, 0, PORTD, 0, 1, 2)
Lcd8_Cmd(LCD_CURSOR_OFF)

Lcd8_Cmd(LCD_CLEAR)
Lcd8_Out(1, 1, "mikroElektronika")
Lcd8_Out(2, 1, "2x16 LCD Testing")
end.

0 komentar
Kirimkan Ini lewat Email BlogThis! Berbagi ke Twitter Berbagi ke Facebook Berbagi ke
Google Buzz

Pengkonversi Data ADC/DAC


| | Label: mikro
PCF8591
PCF8591 ialah AD/DA Converter 8 bit dengan 4 input analog menggunakan interface
I2C. Chip ini sudah ramai digunakan saat ini menggantikan ADC/DAC standar seperti
0808,0809, MC1408 dan 0804.
DT51 I2C ADDA merupakan Analog Input Output Add-on board untuk DT51
menggunakan teknologi I2C-bus dimana IC utama yang digunakan ialah PCF8591. I2C
ADDA digunakan untuk mengubah sinyal analog seperti tegangan atau arus ke data biner
dan sebaliknya. Aplikasinya antara lain kontrol kecepatan motor, pengaturan suhu ruang,
akuisisi data jarak jauh dan lainnya. Pin AIN0-AIN3 ialah pin input analog, sedangkan
AOUt ialah sinyal output analog.

Gambar 10.14 Susunan pin PCF8591


Gambar 10.15 merupakan rangkaian lengkap I2CADDA, dimana sebagai sumber
tegangan referensi digunakan LM336 sebagai dioda zener variabel menggunakan bantuan
potensiometer.

Gambar 10.15 Rangkaian I2CADDA

Untuk mencoba I2CADDA, dibutuhkan DT-51 MinSys ver.3 dan multitester, Langkah
langkah :
Hubungkan DT-51 dengan I2C ADDA
Hubungkan output analog dengan motor DC/multitester
Masukkan program contoh adda.asm, yang akan menerima input dari AIn0-Ain3 dan
mengeluarkan data digital pada PA-PC, atau
Masukkan program contoh pembangkit sinyal gigigergaji (adda2.asm) untuk
mengeluarkan sinyal gigigergaji. Kode program ini akan anda peroleh jika memiliki kit
I2CADDA.
Program Input I2CADDA (adda.asm)
;--------------------------------------------------------$mod51
$title (DT51 I2C ADDA)
;input : Analog input @ Ain0-Ain3
;output: Analog output from Ain0 @AOut
;
Digital output from AIn1 @PA
;
from AIn2 @PB
;
from AIn2 @PC
;--------------------------------------------------------CSEG

ORG
4000H
LJMP
Start
ORG
4100H
$NOLIST
$INCLUDE (ADDA.ASM)
$LIST
DELAY: PUSH 02H
PUSH 03H
MOV R2, #0FFH
DEL:
MOV
R3,#0FFH
DJNZ
R3, $
DJNZ R2,DEL
POP
03H
POP
02H
RET
Start:
MOV
P1,#0FFH
MOV
SP,#40H
MOV
Flag,#00H
MOV
Ch0,00H
MOV
MOV
Ch2,00H
MOV
Ch3,00H
ACALL DELAY
MOV
DPTR,#2003H
MOV A,#00H
MOV
Mode,#0
MOV
Channel,#2
SETB AutoInc
LCALL InitADDA
JB
InitDone, NxtStep
CLR
P1.0
;indikasi init gagal
AJMP $
NxtStep: MOV A,#00H
LCALL ReadADC
;Baca Ain0-Ain3
;Data ADC siap digunakan
;in Ch0-Ch3
MOV
A,#100H ;Slave Addr=0
MOV
B,Ch0
LCALL WriteDAC
;output@ AOut
MOV
A,Ch1 ;output Ain1 @PA
MOV
DPTR,#2000H
MOVX @PDTR,A
MOV
A,Ch2 ;output Ain2 @PB
MOV
DPTR,#2001H
MOVX @DPTR,A
MOV
A,Ch3 ;output Ain3 @PC

Ch1,#00h

MOV
DPTR,#2002H
MOVX @DPTR,A
AJMP $
END
Program sinyal gigigergaji(adda2.asm)
$MOD51
$TITLE(GENERATE SAWTOOTH SIGNAL AT Aout)
CSEG
ORG
LJMP

4000H
Start

ORG
4100H
$NOLIST
$INCLUDE(ADDA.ASM)
$LIST
Delay:
Del:

Start:

Sawtooth:
NxtData: MOV

PUSH
PUSH
MOV
MOV
DJNZ
DJNZ
POP
POP
RET

02H
03H
R3,#0FH
R2,#0FFH
R2,$
R3,Del
03H
02H

MOV
MOV
MOV
MOV
MOV
MOV
MOV

P1,#0FFH
SP,#40H
Flag,#00H
Ch0,#00H
Ch1,#00H
Ch2,#00H
Ch3,#00H

MOV A,#00H
;Slave Addr=0
MOV
Mode,#0
;Mode=0
MOV
Channel,#0
;Ch=0
LCALL InitADDA
;Init ADDA
JB
InitDone,Sawtooth
CLR
P1.0
;Indicate init fail
AJMP $
MOV
B,#00H
;Data=0
A,#00H
;Slave Addr=0

LCALL
INC
AJMP
AJMP

WriteDAC
B
NxtData
$

END
ADC MAX 154/158
MAXIM mengeluarkan ADC generasi baru, yaitu ADC MAX154 yang mempunyai 4
channel input dengan resolusi 8 bit, sedangkan MAX 158 mempunyai 8 channel dengan
resolusi 8 bit. Chip ini sangat ringkas karena sudah tersedia sumber detak internal,
bandingkan dengan ADC0808 yang membutuhkan sumber detak eksternal menggunakan
TTL/kristal.

Gambar 10.16 Susunan pin MAX154/158


Pada Gambar 10.17, terlihat bahwa MAX154/158 berkomunikasi menggunakan bus
alamat, data bus dan sinyal control RDY dan RD, sedangkan CS diaktifkan melalui
address decoder. Untuk memilih salah satu nput dari 8 input digunakan sinyal input ke A0
hingga A2.

Gambar 10.17 Contoh rangkaian berbasis MAX154/158


ADC berbasis 0808
Contoh IC ADC 8 bit yang mampu menerima 8 input dan
banyak digunakan ialah ADC 0808 meskipun lebih mahal
dibandingkan ADC 0804 . ADC ini selain mampu diprogram
untuk mulai konversi melalui pin SC (Start Conversion ), mampu
juga berjalan dalam mode free running, artinya ia akan konversi
terus menerus sinyal input yang masuk dengan cara
menghubungkan pin EOC (End of Conversion) ke SC.

Gambar 10.18 ADC 0808


ADC 0804
ADC 0804 merupakan adc yang paling murah, karena hanya mempunyai 1 buah input
analog. Rangkaian ADC melalui port paralel ini tampak pada Gambar 10.19.
Hubungan ke data komputer melalui pin data yaitu D0-D7. Sinyal status yang digunakan
ialah ERROR yang digunakan dengan pin 5 ADC yaitu INTR. Dua sinyal control yaitu
STROBE dan INIT digunakan untuk mengaktifkan ADC. Pin 9 sebagai Vref tidak
dihubungkan. Kombinasi resistor dan kapasitor sebagai sumber detak dengan frekwensi
tertentu.

Gambar 10.19 rangkaian ADC ke port parallel


Berikut program pengontrol untuk ADC tersebut menggunakan bahasa PASCAL yang
dapat dengan mudah dirubah menggunakan bahasa C:
Program ADC melalui port parallel (Adcparalel.pas)
const c0=1;c1=2;c2=4;c3=8;s0=1,s1=2;s2=4;s3=8;
base=$378; (menggunakan LPT1)
var
data,stat,ctr1,eppdata :integer;
sample, lc
:integer;
begin
data:=base;stat:=base+1;ctr1=base+2;
for sample:=0 to 3000 do begin
port[ctr1]:=32; (inisialisasi)
lc:=0;
while (((port[stat] abd s3)=0) or lc<256)) do
inc (lc);
if lc>256 then write (time out, error pada hardware)
else begin
port(ctrl):=37; (enable adc output)
eppdata:=port[data];
port[ctrl]:=36; (disable adc output)
write (Hasil konversi ialah :,eppdata);
end;
end;
end.
Pada program diatas, digunakan alamat standar port paralel atau yang lebih dikenal
sebagai port printer yaitu 378H (dalam pascal ditulis sebagai $378). Program lalu
menginisialisasi variabel untuk data, stat dan ctrl dengan nilai alamat masing masing.
Program kemudian looping untuk mengambil data lalu ditampilkkan hasilnya.

PPI 8255 untuk DAC


Gambar berikut merupakan format DAC yang umum, dimana input berupa 8 bit atau
lebih, dan outputnya berupa sinyal analog, yang biasanya diperoleh dari suatu rangkaian
op-amp

Gambar 10.20 Blok diagram DAC standar


Ada 3 modus operasi pada PIO 8255 yang dapat dipilih melalui software yaitu :
Mode 0 : basic input/output
Mode 1 : strobed input/output
Mode 2: bidirectional bus
Jika reset input mendapat input high, semua port akan diset ke mode input dimana semua
24 jalur ditahan pada logika 1 oleh bus internal. PPI 8255 dapat dibuat sebagai
antarmuka DAC atau ADC. Untuk mencoba DAC yang terprogram paling mudah
menggunakan PPI 8255 dalam mode 0. Langkah-langkah:
Pasang Card PPI 8255 ISA, anda juga dapat menggunakan
Card PPI 8255 berbasiskan PCI
Hubungkan DAC ke port A
Hubungkan keluaran DAC ke Osiloskop
Buat program berikut :
//Program Pembangkit sinyal Sinus berbasis 8255
#include
#include
#include
main()
{
printf (======================);
printf ( Pembangkit sinyal sinus\n);
outp (0x303, 0x80); //konfigurasi 8255

printf (======================);
unsigned char v1;
float Vout, magnitude; int a;
printf (\n Tekan sembarang tombol untuk keluar\n)
do
{
for (a=0;a<360;a++)
{
Vout =5.0 +5.0* sin ((3.14*a)/180));
magnitude=Vout*25.6;
v1=(char)magnitude;
delay(1);
outp(0x300,v1)
}
}
while (!kbhit());
return (0);
}
Program diats akan membangkitkan sinyal sinus karena terdapat pembangkitan nilai sinus
pada rumus Vout =5.0 +5.0* sin ((3.14*a)/180)). Alamat yang digunakan ialah 300H,
yang merupakan alamat standar port ISA untuk eksperimen.

Das könnte Ihnen auch gefallen