|
Guru.Technosains.Com |
|||||||
| Home | Kuliah Elektro | Elektronik Project | Tutorial | Download | Donasi | ||
|
|
|||||||
|
|
more search type here |
|
|||||
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
||
|
|
ANALOG TO DIGITAL CONVERTER VIA PARALLEL PORT Oleh: I Made Wiryana
PENGANTAR An analog-to-digital converter (abbreviated ADC, A/D or A to D) is a device that converts a continuous quantity to a discrete digital number. The reverse operation is performed by a digital-to-analog converter (DAC). Typically, an ADC is an electronic device that converts an input analog voltage (or current) to a digital number proportional to the magnitude of the voltage or current. However, some non-electronic or only partially electronic devices, such as rotary encoders, can also be considered ADCs. The digital output may use different coding schemes. Typically the digital output will be a two's complement binary number that is proportional to the input, but there are other possibilities. An encoder, for example, might output a Gray code. An ADC might be used to make an isolated measurement. ADC's are also used to quantize time-varying signals by turning them into a sequence of digital samples. The result is quantized in both time and value.
Sampling rateThe analog signal is continuous in time and it is necessary to convert this to a flow of digital values. It is therefore required to define the rate at which new digital values are sampled from the analog signal. The rate of new values is called the sampling rate or sampling frequency of the converter. A continuously varying bandlimited signal can be sampled (that is, the signal values at intervals of time T, the sampling time, are measured and stored) and then the original signal can be exactly reproduced from the discrete-time values by an interpolation formula. The accuracy is limited by quantization error. However, this faithful reproduction is only possible if the sampling rate is higher than twice the highest frequency of the signal. This is essentially what is embodied in the Shannon-Nyquist sampling theorem. Since a practical ADC cannot make an instantaneous conversion, the input value must necessarily be held constant during the time that the converter performs a conversion (called the conversion time). An input circuit called a sample and hold performs this task—in most cases by using a capacitor to store the analog voltage at the input, and using an electronic switch or gate to disconnect the capacitor from the input. Many ADC integrated circuits include the sample and hold subsystem internally
AliasingAll ADCs work by sampling their input at discrete intervals of time. Their output is therefore an incomplete picture of the behaviour of the input. There is no way of knowing, by looking at the output, what the input was doing between one sampling instant and the next. If the input is known to be changing slowly compared to the sampling rate, then it can be assumed that the value of the signal between two sample instants was somewhere between the two sampled values. If, however, the input signal is changing rapidly compared to the sample rate, then this assumption is not valid. If the digital values produced by the ADC are, at some later stage in the system, converted back to analog values by a digital to analog converter or DAC, it is desirable that the output of the DAC be a faithful representation of the original signal. If the input signal is changing much faster than the sample rate, then this will not be the case, and spurious signals called aliases will be produced at the output of the DAC. The frequency of the aliased signal is the difference between the signal frequency and the sampling rate. For example, a 2 kHz sine wave being sampled at 1.5 kHz would be reconstructed as a 500 Hz sine wave. This problem is called aliasing. To avoid aliasing, the input to an ADC must be low-pass filtered to remove frequencies above half the sampling rate. This filter is called an anti-aliasing filter, and is essential for a practical ADC system that is applied to analog signals with higher frequency content. Although aliasing in most systems is unwanted, it should also be noted that it can be exploited to provide simultaneous down-mixing of a band-limited high frequency signal (see undersampling and frequency mixer).
INTI ARTIKEL Sinyal analog contohnya tegangan dari sensor suhu merupakan data yang cukup penting bagi beberapa aplikasi (misal post pencatat suhu dll). Untuk tujuan ini telah tersedia berbagai peralatan untuk mengkonversi dari data analog ke digital yang dikenal dengan Analog to Digital Converter (ADC). Tetapi di sini penulis mencoba menampilkan rangkaian ADC yang sederhana yang memanfaatkan peralatan I/O yang sudah ada di komputer yaitu port printer. Contoh program dengan bahasa BASIC diberikan di bagian bawah tulisan. Sebagai chip ADC, rangkaian ini memanfaatkan TLC549 buatan Texas Instrument dengan resolusi 8 bit. IC1 merupakan rangkaian regulator akan memberikan keluarang tegangan stabil 5 Volt dari masukan 8-30 V. Digunakan selain sebagi catudaya stabil juga sebagai tegangan referensi untuk proses ADC. Masukan analog diberikan kepada pin 2 dari IC2 (A-IN), dan harus berkisar antar 0-5 Volt.
Negative edge (berubah dari H-L) di pin 5 (CS) akan memulai chip bekerja miminimal 1,7 mikrodetik. TCL549 akan mulai menkonversi sesuai pulsa klok di pin I/O-CLK (pin 7), akan dimulai dari MSB dan selanjutnya ke LSB. Setelah pulsa ke 8, maka output digital dari pin 6(D-OUT) selesai keluar semuanya. Dengan kata lain keluaran adalah serial.
Setelah pulsa ke 8 ini (satu siklus konversi), maka konversi berikutnya dapat dimulai lagi dengan membuat pin 5 LOW lagi. Waktu siklus ini diatur melalui program BAIC dengan konstanta DELAY pada baris 30. Tundaan ini dilakukan pada baris 90. Pada baris 240 merupakan trik untuk mengambil nilai rata-rata. Arus yang dibutuhkan untuk beroperasi sekitar 5 mA. 10 Base = 888: REM Base LPT1 (LPT2 = 632) 20 Delay = 1: REM delay konversi 30 Average = 10: REM loop untuk rata-rata 40 CLS 50 Value = 0 60 FOR t =1 TO Average 70 OUT (Base), 0: REM CS, I/O CLK low 80 OUT (Base), 1: REM CS high, konversi start 90 FOR q=1 TO Delay 100 NEXT q : REM tunggu konversi 120 OUT (Base), 0: REM CS+CLK low 130 OUT (Base), 2: REM CLK High 140 OUT (Base), 0: REM Clk low 150 FOR i = 1 TO 7: REM tulis bit 7 - 0 160 x = INP (Base + 1) AND 128: REM baca bit masuk 170 IF X = 128 THEN a = 0 180 IF X = 0 THEN a=1 190 Value = Value + a * 2 ^ ( 7 - i): REM masukan nilai 200 OUT (Base), 2: REM CLK high 210 OUT (Base), 0: REM CLK Low 220 NEXT i 230 NEXT t 240 Value = Value * 5 / (255 * Average): REM nilai rata rata konversi 250 LOCATE 10,10: : REM untuk kisaran 0-5 V 260 PRINT USING "#.### Volt"; Value 270 GOTO 50
|
||||||
|
|
|
|
|
||||
Copyright (C) guru.technosains.com
For problems or questions regarding this web contact [admin]