TUGAS AKHIR
Diajukan untuk memenuhi salah satu syarat memperoleh gelar Sarjana Teknik
Program Studi Teknik Elektro
Disusun Oleh :
TUGAS AKHIR
Diajukan untuk memenuhi salah satu syarat
memperoleh gelar Sarjana Teknik
Program Studi Teknik Elektro
disusun oleh :
BRIATMA KURNIA PUTRA PRISTIWADI
NIM : 025114006
i
WATER LEVEL TELEMETRY AS A WATER
GATE MODEL REGULATOR BASED ON
PC AND AT89S51 MICROCONTROLLER
FINAL PROJECT
Presented as Partial Fulfillment of the Requirements
to Obtain the SARJANA TEKNIK Degree
in Electrical Engineering
by :
BRIATMA KURNIA PUTRA PRISTIWADI
STUDENT NUMBER : 025114006
ii
(WATER LEVEL TELEMETRY AS A WATER GATE MODEL
REGULATOR BASED ON PC AND AT89S51 MICROCONTROLLER)
G
28 Juli
LEMBAR PERNYATAAN KEASLIAN KARYA
“Saya menyatakan dengan sesungguhnya bahwa tugas akhir yang saya tulis ini
v
MOTO DAN PERSEMBAHAN
keikutsertaan ...
vi
INTISARI
vii
ABSTRACT
viii
KATA PENGANTAR
Puji syukur penulis panjatkan kepada Allah Bapa disurga, yang telah
mendapatkan banyak bantuan dan dorongan dari berbagai pihak. Oleh karena itu,
pada kesempatan ini perkenankanlah dengan segala kerendahan hati dan penuh
satu persatu, yang telah mendidik penulis untuk mengetahui lebih dalam
6. Kedua orang tua penulis yang telah memberikan doa, dorongan moril
maupun material, kasih dan kesabaran yang tak pernah putus sehingga
ix
7. Mbak Putri, Dik Christa yang telah memberikan doa dan kesabaran karena
membuat maket pintu airnya, Kuemprut yang membantu beli akrilik ampe
tangan pegel. Mas Bambang makasih atas grendonya, Mas Nata makasih
atas cara pengeleman akliriknya dan Pak Ketua Bp Supangat makasih atas
11. Teman senasib dan sepenanggungan : Mas Teguh tea kapan selesai skripsi,
Heriyanto S.E buat hari-hari yang indah dulu, Yanto ,Aan ,Ali makasih
karna telah mengajari kerasnya hidup. Mbak Getik, Mas Supri dan Mbak
Conie, Putri Imut makasih atas tumpangan tempat buat tidur selama belum
dapat kos. Sandi Man. My Best Friend Bayu S.H makasih telah menjadi
12. Teman-teman kost T-KIP : Ari (Gendut) email mu saru, Dedik kapan
bimbingan Rohani lagi, Agung Bawono, S.T fleksibel aja Mo, Dody
x
Prasetyo P, S.T makasih ya atas segala bantuan pembuatan progam VB
dan Mikronya
14. Laboran teknik elektro : mas Suryono makasih udah ngajari ngetrim
pemancar , mas Mardi buat ijin titip barang-barang, mas Broto yang udah
mau nungguin serta jadi teman sewaktu memperbaiki alat dan mengambil
data, dan mas Yusuf yang udah mau membuka pintu dan menunggu
15. Anak-anak seni UNY : Sintha, Pi2T, Vanti, Rika yang selalu memberikan
16. Anak-anak Tuhan di GKJ Sabda Winedhar Surakarta yang dah jadi teman
17. Regenerasi Motorku : Grand 94, Supra 00, dan Vega R 05 yang selalu
rongsokan ya ….????????.
19. Teman-teman mahasiswa jurusan Teknik Elekro dan semua pihak yang
xi
Penulis menyadari bahwa masih banyak kelemahan dan kekurangan dari
penulisan tugas akhir ini. Oleh karena itu segala kritik dan saran yang bersifat
Akhir kata penulis berharap agar skripsi ini dapat bermanfaat bagi
Penulis
xii
DAFTAR ISI
INTISARI...................................................................................................... vii
BAB I. PENDAHULUAN........................................................................ 1
1.1 Judul…………………………………………………………………… 1
xiii
BAB II. DASAR TEORI........................................................................... 5
2.7.2 Reset......................................................................................... 17
xiv
3.5 Konfigurasi Mikrokontroler AT89S51 Sebagai Pengubah Data Pararel
xv
4.4 Pengamatan Keluaran Modulator FSK XR-2206 ................................ 68
Pemancar………......................................................................... 74
Penerima..................................................................................... 75
xvi
5.2 Saran ...................................................................................... 95
DAFTAR PUSTAKA
LAMPIRAN
xvii
DAFTAR TABEL
6. Tabel 4.2 Tabel perbandingan data praktek dan teori ADC0804 ..... 67
bagian penerima................................................................................... 76
11. Tabel 4.7 Tabel pengamatan ketinggian air sungai yang .................
12. Tabel 4.8 Tabel perbandingan ketinggian air sungai sebenarnya ....
13. Tabel 4.9 Tabel pengamtan ketinggian air sungai yang tertampil....
xviii
DAFTAR GAMBAR
1. Gambar 2.1 Konfigurasi penguat inverting ...................................... 7
11. Gambar 2.11 Level tegangan TTL dan RS232 pada pengiriman
xix
38. Gambar 3.11 Pengubah data pararel menjadi serial menggunakan
AT89S51 ...................................................................................... 32
xx
60. Gambar 3.34 Rangkaian warning system............................................ 57
61. Gambar 4.1a Gambar Vsensor potensio multi turn saat air naik........ 58
62 Gambar 4.1b Gambar Vsensor potensio multi turn saat air turun ...... 58
65. Gambar 4.4a Vo sensor ketinggian potensio linear sistem lengan .....
66. Gambar 4.4b Vo sensor ketinggian potensio linear sistem lengan .....
68. Gambar 4.6 Bentuk keluaran gelombang XR-2206 dengan input ...
70. Gambar 4.8 Pengubahan level tegangan TTL menjadi level tegangan
RS232.………........................................................................................ 74
74. Gambar 4.10 Instruksi untuk mengisi ketinggian air yang akan di atur 78
75. Gambar 4.11a Menu pemberitahu nilai yang dimasukkan melebihi ba-
76. Gambar 4.11b Menu Pemberitahu bila ketinggian air yang akan di
xxi
79. Gambar 4.14 Menu Bantuan Menggunakan program ........................ 81
87. Gambar 4.23 Pesan pemberitahu pintu tidak dapat di buka lagi ........ 94
88. Gambar 4.24 Pesan pemberitahu pintu tidak dapat di tutup lagi ........ 94
xxii
DAFTAR LAMPIRAN
A. Gambar Rangkaian...................................................................................... L1
xxiii
BAB I
PENDAHULUAN
1.1. Judul
sesuatunya bergerak cepat, praktis, dan serba instan, tidak hanya di perkotaan saja,
tetapi juga hingga ke pelosok desa. Masyarakat di kota maupun di desa saat ini sudah
dapat menikmati berbagai kemudahan dan kenyamanan dari beraneka ragam peralatan
elektronis yang ada, misalnya kipas angin yang diberi timer untuk mengatur kapan
harus berhenti berputar, pompa air yang diberi sensor sehingga pompa akan berhenti
ketika air di bak penampungan sudah penuh, lampu taman yang akan menyala sendiri
ketika hari sudah mulai gelap, dan masih banyak lagi. Semakin banyaknya sensor–
airnya masih banyak dilakukan secara manual. Ada berapa orang yang bertugas untuk
2
mengawasi dan mengatur pintu air supaya air sungai tidak sampai meluap atau supaya
Dari hal di atas akan timbul suatu permasalahan bila harus bekerja pada waktu
malam hari, karena air yang dikontrol tidak sepenuhnya kelihatan, atau harus
mengatur pintu air di waktu kondisi hujan, di mana air sungai yang akan dikontrol
suatu alat yang dapat untuk mengatur pintu air sesuai dengan ketinggian air sungai
yang diinginkan dengan perawatan dan penggunaan yang mudah, serta hasil
1.3. Tujuan
Dalam penelitian ini, peneliti mempunyai beberapa tujuan yang hendak di capai,
yaitu :
1. Membuat perangkat keras yang dapat mengukur ketinggian air sungai dan
Visual Basic.
1.4. Manfaat
Mengacu dari beberapa tujuan yang akan dicapai, diharapkan penalitian ini
1. Ketinggian air maksimum yang dapat terukur oleh sensor adalah 20 cm.
6. Memberikan kesimpulan.
Mikrokontroler AT89S51, Op-Amp, ADC 0804, RS232, modem FSK, Pemancar dan
penerima FM.
ketinggian air, pengondisi sinyal, pengubah data dari analog ke digital (ADC),
DASAR TEORI
Pengatur pintu air dibuat untuk mengendalikan debit air yang akan dialirkan
ke sungai, dengan cara membandingkan ketinggian air sungai yang dipantau dengan
ketinggian air yang diinginkan. Pemantauan ketinggian air dilakukan secara telemetri,
yakni dengan meletakkan sensor ketinggian air pada suatu tempat yang hendak kita
Software pengatur model pintu air di buat dengan program Visual basic. Adapun cara
model pintu air, dengan cara membandingkan antara data yang di isi user
dengan data yang di hasilkan sensor air, sehingga didapat ketinggian air sesuai
4. Pada pengaturan manual user dapat mengatur model pintu air untuk membuka
atau menutup secara manual, yakni dengan cara menekan tombol buka atau
tutup sehingga pintu air akan membuka atau menutup sampai tombol stop
ditekan.
5. Bila ketinggian air melebihi 18 cm, maka akan diberi peringatan berupa bunyi
Buzzer.
6
ketinggian air yang disusun oleh rangkaian Op-Amp yang berupa rangkaian
pengondisi sinyal. Data yang telah dikondisikan akan diubah menjadi data digital oleh
rangkaian ADC. Data digital dari ADC dibah menjadi data serial oleh
mengatur pintu air. Komponen telemetri ketinggian air sebagai pengatur model pintu
RA seperti pada gambar 2.1. Ini akan menghasilkan tegangan masukan pembalik
V1. Tegangan masukan diperkuat oleh perolehan tegangan kalang terbuka untuk
diumpan balikkan ke masukan melalui resisitor umpan balik RB. Ini menghasilkan
umpan balik negatif karena keluarannya berbeda 1800 dengan masukan. Dengan
kata lain, setiap perubahan pada V1 dihasilkan oleh tegangan masukan yang
RB
VO = − × Vin …………………….…………………………… (2.1)
RA
7
RB
Vee
4
8
1
RA
2 -
V1 6
3 +
Vin Vo
CA3130
U1
7
5
Vcc
atau lebih menjadi satu keluaran. Konfigurasi penjumlah tegangan seperti pada
gambar 2.2.
RF
R1
Vee
V1
R2
4
8
1
2 -
V2 R3 6
Vo
3 +
V3 Rn U1
7
5
Vn
Vcc
⎛R ⎞ ⎛R ⎞ ⎛R ⎞ ⎛R ⎞
VO = − ⎜⎜ F × V1 ⎟⎟ − ⎜⎜ F × V2 ⎟⎟ − ⎜⎜ F × V3 ⎟⎟ − ... − ⎜⎜ F × Vn ⎟⎟ ……… (2.2)
⎝ R1 ⎠ ⎝ R2 ⎠ ⎝ R3 ⎠ ⎝ Rn ⎠
terbebani oleh beban. Tegangan keluaran yang dihasilkan rangkaian buffer tegangan
persis sama dengan tegangan masukan. Konfigurasi buffer tegangan seperti pada
gambar 2.3.
Vee
4
8
1
2 -
6
3 +
Vo
CA3130
Vin
U1
7
5
Vcc
Gambar 2.3 Konfigurasi buffer tegangan
resistor yang dikonfigurasikan seperti pada gambar 2.4. Vout ditentukan dengan
persamaan 2.5
R2
Vout = xVCC …………………………………………….….. (2.5)
R 1 + R2
VCC
R1
Vout
R2
analog menjadi data digital. Data digital yang dihasilkan dinyatakan dalam kode biner
dengan menggunakan dua nilai tegangan yaitu 5 volt, yang dinyatakan dengan
lambang ‘1’ dan 0 volt dengan lambang ‘0’. Bilangan biner merupakan kombinasi
2.5 adalah
1
f clock = …………………………………………………... (2.6)
1,1 x R x C
Vref( + ) - Vref(-)
Resolusi = …………………………………………... (2.7)
255
Vreff
Sesuai dengan penggunaan typical ADC 0804 dengan =2,5 volt, maka
2
5-0
Resolusi =
255
Resolusi = 19,6 mv
Tegangan konversi
Level = …………………………………………. (2.8)
Resolusi ADC
VCC = 5 v olt
U5
20
Data Digital
6 18
VC C /VR EF
Input +IN DB0
9 17
Rev erensi VREF/2 DB1 16
C R DB2 15
150pF 10K DB3 14
19 DB4 13
CLKR DB5 12
4 DB6 11
0 CLKIN DB7
1
Mengaktif kan ADC CS
2
SOC RD
3
Baca ADC WR
5
GN D
GN D
EOC INTR
-IN
ADC0804/SO
10
8
7
0
radio, sehingga dapat ditransmisikan melalui gelombang radio untuk jarak jauh. Pada
penelitian ini menggunakan modem FSK (Frequency Shift Keying), yakni modem
yang menggunakan frekuensi tertentu untuk menyandikan nilai bit-bit digital. Bit 1
yang disebut frekunsi mark dan bit 0 yang disebut dengan frekuensi space.. Seperti
terlihat pada gambar 2.6. FSK sendiri hanya efektif bila di pakai pada frekuensi audio.
11
rangkaian demodulator FSK. Pada rangkaian modulator FSK XR-2206, seprti yang
ditunjukan pada gambar 2.7 untuk menghitung f1 yang disebut dengan frekuensi mark
1
f1 = ………………………………………………...... (2,10)
R1 × C
1
f2 = ………………………………………………….. (2,11)
R2 × C
Untuk mendapatkan data yang telah di modulasi oleh modulator FSK menjadi
data kembali seperti semula, maka dibutuhkan rangkaian demodulator FSK. Untuk
fo = f 1 × f 2 ……………………………………………… (2.12)
f2 = frekuensi space
2. tentukan nilai timing resistor RO, nilainya harus berada diantara 10 KΩ sampai
100 KΩ. Disarankan nilai RO = 20 KΩ. Nilai akhir RO biasanya hasil seri
RX
RO = RO + ……………………………..………………. (2.13)
2
1
CO = ………………………………………………... (2.14)
RO × f o
RO × f O
R1 = × 2 …………………………………………... (2.15)
( f1 − f 2 )
1250 × C O
C1 = ……………………………………………..… (2.16)
R1 × ς 2
RF = 5 x R1 ……………………………………………..……. (2.17)
RB = 5 x RF ………………………………………………….. (2.18)
(R F + R 1 ) × R B
RSUM = ……………………………………… (2.19)
(R 1 + R F + R B )
0,25
CF = ……………………………………. (2.20)
(R SUM × Baud Rate )
diperkenankan supaya frekuensi dapat di demodulasi ulang) seperti pada gambar 2.9,
mempunyai rumusan ;
Δf
Bandwidth, ± = . ………………………………………... (2.21)
f0
Δf R
= 0 …………………………………………………… . (2.22)
f0 R1
14
Untuk menetapkan frekuensi mark dan space berdasar baud rate yang
digunakan, standar pada tabel 2.1 dapat digunakan sebagai acuan, dimana pada
5 bps 387 Hz 0 Hz
Ada dua macam cara pengiriman (transmisi) secara serial yaitu komunikasi
sinkron dan komunikasi asinkron. Pada komunikasi sinkron sinyal detak dikirim
bersama-sama dengan data serial. Selanjutnya dalam transmisi data serial secara
Port serial pada AT89S51 bersifat duplex penuh atau full-duplex, artinya
port serial bisa menerima dan mengirim data pada waktu bersamaan. Port serial
memiliki penyangga penerima yaitu serial buffer (SBUF). Port serial dapat
menerima byte yang kedua sebelum byte yang pertama dibaca oleh register
Port serial pada AT89S51 bisa digunakan dalam empat mode kerja. Dari ke-
empat mode tersebut, 1 mode diantaranya bekerja secara sinkron dan tiga mode
lainnya bekerja secara asinkron. Semua mode dapat diatur melalui register kontrol
Mode 0 Mode ini bekerja secara sinkron, data serial dikirim dan diterima melalui
kaki P3.0 (RxD), sedangkan kaki P3.1 (TxD) dipakai untuk menyalurkan
kecil atau LSB (bit 0), diakhiri dengan bit yang bobotnya paling besar
atau MSB (bit 7). Kecepatan pengiriman data (baudrate) adalah 1/12
Mode 1 Pada mode ini, data dikirim melalui kaki P3.1 (TxD) dan diterima
melalui kaki P3.0 (RxD) secara sinkron (begitu juga mode 2 dan 3).
bit start, disusul 8 bit data yang dimulai dari bit yang bobotnya paling
kecil (bit 0), diakhiri dengan 1 bit stop. Pada AT89S51 yang berfungsi
sebagai penerima bit stop adalah RB8 dalam register Serial Control
dengan keperluan. Mode inilah (mode 2 dan juga mode 3) yang umum
Receiver/Trasmitter.
Mode 2 Data dikirim 11 bit, diawali dengan 1 bit start, kemudian 8 bit data. Bit
ke-9 yang dapat diatur lebih lanjut dan diakhiri dengan 1 bit stop. Pada
AT89S51 yang berfungsi sebagai pengirim bit 9 tersebut berasal dari bit
pengiriman data (baudrate) bisa dipilih antara 1/32 atau 1/64 frekuensi
Mode 3 Mode ini sama dengan mode 2, hanya saja kecepatan pengiriman data
2SMOD
baudrate = × Laju Limpahan timer 1 ………………….… (2.23)
32
17
2.7.2 Reset
Gambar 2.10 menunjukkan konfigurasi tombol reset. Reset akan aktif bila pin
VCC
RST
R C
0
1 2
SW1
Bila tombol reset tidak ditekan, maka pin RST akan mendapat input logika
low, sehingga mikrokontroler akan bekerja normal. Resistor dan kapasitor digunakan
T = R × C ……………………………………………….…………...… (2.24)
dipublikasikan pada tahun 1962. Ini terjadi jauh sebelum IC TTL populer sehingga
sinyal ini tidak ada hubungan sama sekali dengan level tegangan IC TTL. Standar
ini hanya menyangkut komunikasi data antara komputer DTE dengan alat-alat
pelengkap komputer DCE. Standar RS232 inilah yang biasa digunakan pada port
berikut:
1. Logika ‘1’ disebut ‘mark’ terletak antara -3 Volt hingga -25 Volt.
1. Logika ‘0’ disebut ‘space’ terletak antara +3 Volt hingga +25 Volt
2. Daerah tegangan antara -3 Volt hingga +3 Volt adalah invalid level, yaitu
daerah tegangan yang tidak memiliki level logika pasti sehingga harus
dihindari. Demikian juga, level tegangan lebih negatif dari -25 Volt atau
lebih positif dari +25 Volt juga harus dihindari karena tegangan tersebut
Gambar 2.11 adalah contoh level tegangan RS232 pada pengiriman huruf
‘A’ dalam format ASCII tanpa bit paritas pada level TTL dan level RS232.
Level TTL
Level RS232
belakang CPU. Pada komputer IBM PC kompatibel terdapat konektor serial DB-9
yang dinamai COM1 dan atau COM2. Standar RS232 menyangkut komunikasi data
19
serial DB-9. Keterangan mengenai fungsi saluran RS 232 pada konektor DB-9
siap.
• Request To Send. Dengan saluran ini DCE diminta mengirim data oleh
DTE.
• DCE Ready. Sinyal aktif pada saluran ini menunjukkan bahwa DCE sudah
siap.
dua port serial pada CPU, yaitu COM1 dan COM2. Base address COM1 adalah
1016 (3F8H0) dan COM2 adalah 760 (2F8h). Alamat tersebut adalah alamat yang
biasa digunakan. Tepatnya pada peta memori tempat menyimpan alamat tersebut,
yaitu memori 0000 0400H untuk base address COM1 dan memori 0000 0402H
5 GND - Ground
9 RI In Ring Indikator
2.10 Motor DC
Motor DC adalah motor yang memiliki dua bagian dasar, bagian yang berputar
di sebut rotor dan bagian yang tidak berputar di sebut stator. Motor DC bekerja
berdasarkan medan magnet yang dihasilkan oleh kumparan yang terdapat pada rotor.
Semakin besar arus yang melalui kumparan motor, maka semakin besar cepat putaran
21
motor. Arah putaran dapat dikendalikan dengan mengatur arah putaran arus yang
melalui kumparan.
BAB III
PERANCANGAN
Telemetri ketinggian air sebagai pengatur model pintu air terdiri dari dua
dibutuhkan hal-hal sebagai berikut, di bagian pengirim terdiri dari sensor ketinggian
pengubah data pararel menjadi data digital, modulator FSK, dan pemancar FM seperti
yang ditunjukkan pada gambar 3.1. sedangkan pada bagian penerima terdiri dari
penerima FM, RS 232, PC, mikrokontroler sebagai pengatur arah putaran motor DC,
dan motor DC seperti yang ditunjukkan pada gambar 3.2. Peletakan sensor seperti
Pintu
Motor DC
Air
Demodulator
Penerima FM RS 232 PC Mikrokontroler
FSK
Buzer
Antena Pemancar
Pintu air
Sensor
Ketinggian air
DAM AIR Aliran air
Model Sungai
Gambar 3.3 Skema telemetri ketinggian air sebagai pengatur model pintu air
23
dengan diberi roda gigi. Potensio multi turn dirangkai sebagai rangkaian pembagi
tegangan, seperti pada gambar 3.4. Didalam sungai terdapat sebuah pelampung yang
dihubungkan dengan batang bergerigi yang berfungsi untuk memutar roda gigi pada
potensio mulit turn. Sehingga potensio akan berputar mengikuti perubahan ketinggian
air sungai yang akan di ukur. Seperti terlihat pada gambar 3.5
VCC
Vout
POT
pelampung
model sungai
Karena yang dikontrol merupakan model pintu air, maka dalam perancangan
ini dirancang dengan skala 1 : 10, dan sensor dirancang untuk kedalaman sungai 20
cm.
24
815,79 Ω untuk satu putaran. Gigi roda yang akan dipakai untuk memutar potensio
memiliki keliling 3,1 cm dan jumlah gigi 10 gigi. Karena kedalaman maksimum air
sungai yang akan diukur 20 cm maka banyak putaran yang diperlukan potensiometer
sebesar :
20 cm
Banyak putaran =
3,1 cm
= 6,45
≈ 6,5 putaran
= 5302,63 Ω
hambatan 5 KΩ, maka sensor diset pada hambatan awal bukan 0 Ω tetapi pada 5
KΩ. sehingga resistansi yang dipakai pada potensiometer adalah antara 5 KΩ sampai
10302,63 Ω. Bila potensio diberi masukan tegangan sebesar 5 Volt maka dapat
5000 10302,63
Vo min = ×5 Vo max = ×5
31000 31000
Bila ketinggian air yang akan ditampilkan mempunyai interval perubahan tiap 1 cm,
maka setiap intervalnya potensio multi turn akan menghasilkan perubahan tegangan
sebesar
( 1,662 V - 0,806 V)
V interval = × 1 cm
20 cm
25
= 0,0428 V
perubahan ketinggian air sungai setiap 1 cm atau setiap 42,8 mV. Pengubah ADC
0804 mempunyai resolusi 19,6 mV pada tegangan catuan 5 V seperti yang dijelaskan
pada BAB II, atau dengan kata lain output ADC 0804 akan berubah nilainya bila ada
perubahan tegangan sebesar 19,6 mV pada kaki inputnya. Berdasar pada karakter
yang dapat diterima program Visual Basic yakni karakter yang mewakili bilangan
biner 32 sampai 127, maka pada pengkondisi sinyal dirancang setiap kenaikan /
penurunan air sungai 1 cm maka bilangan biner output ADC akan naik / turun 4.
Karena ketinggian maksimum air sungai adalah 20 cm dan sensor dirancang untuk
perubahan ketinggian air sungai tiap 1 cm maka total interval ketinggian air sungai
Bila ketinggian air 0 cm diwakili bilangan biner 33, maka untuk ketinggian
maksimum air sungai sebesar 20 cm diwakili bilangn biner 113. Bila ADC
mempunyai resolusi 19,6 mV maka besarnya tegangan yang dibutuhkan ADC untuk
menghasilkan nilai biner tersebut menurut persamaan 2.9 adalah sebagai berikut :
Interval ADC =
(2.215 V - 0.647 V ) × 4
80
= 0,0784 V
Hubungan tegangan antara output sensor yang harus disesuaikan dengan ADC adalah
Dimana interval ADC 0804 = 78 mV dan interval sensor ketinggian air = 42,8
Interval ADC
b= ………………………… (3.2)
Interval sensor air
78,4 mV
b=
42,8 mV
b = 1,832
Untuk mencari nilai a maka di ambil salah satu data yakni Vi = 0,647 Volt
a = - 0,829
Pada perancangan pengkondisi sinyal op-amp yang dipakai adalah tipe CA3140
pakai rangkaian pembagi tegangan, sehingga nilai resistor dapat di hitung dengan
Untuk mendapatkan Vref sebesar 0,829 Volt pada tegangan catuan 5 Volt maka nilai
R1 dan R2 :
R2
Vreff = × Vcc
R1 + R 2
R2
0,829 Volt = × (5 Volt)
R1 + R 2
R2
0,1658 =
R1 + R 2
Bila nilai R2 ditentukan 1 KΩ, maka nilai R1 adalah 5,031 KΩ. Karena nilai R1 tidak
VCC = 5 V
R1
5.031K
Vref = 0.829 V
R2
1K
Supaya tidak terbebani maka tegangan Vref sebesar 0,829 V perlu di buffer.
Konfigurasi buffer tegangan seperti pada gambar 3.7, dimana nilai V1 = Vref
Vcc = 5 V
Vee = -5V
5.031 k
R1
4
8
1
2 -
6
3 +
V1
CA3130
U1
7
5
R2
1K Vcc = 5V
persamaan 2.1 dan gambar 3.8 maka nilai R3 dan R4 dapat dicari yakni :
V2 = - 1,832 x Vsensor
29
R4
= 1,832
R3
18.32 k
Vee = -5V
4
8
1
R3
2 -
6
V2
10K 3 +
Vsensor
U1
7
5
Vcc = 5V
R7 R
V3 = - ( V1 + 7 V2 )
R5 R6
10 KΩ
R7
10k
Vee = -5V
R5
4
8
1
10k
V1
2 -
6
R6 V3
3 +
CA3130
10k U1
7
5
V2
Vcc = 5V
analog keluaran pengkondisi sinyal menjadi data digital 8 bit. Gambar 3.10
yakni dengan menghubungkan pin CS ke ground dan pin kontrol yang lain ke
yang digunakan dalam data sheet, maka sesuai persamaan 2.6 fclock dapat dihitung
besarnya :
1
f clock =
1,1 × R 10 × C1
1
fclock =
1,1 × 10 KΩ × 150 pF
VCC = 5V
2.2K 2.2K
U3
20
P1 mikronkontroler
9 18
VC C /VR EF
VREF/2 DB0 17
1 DB1 16
CS DB2 15
DB3
8 bit data
14 digital
6 DB4 13
Vout pengkondisi sinyal +IN DB5 12
19 DB6 11
CLKR DB7
C1 R10 4
CLKIN
150 pf 10K 2
GN D
GN D
3 RD 5
-IN
WR INTR EOC
SOC
10
ADC0804
7
8
Baca ADC
dimana nilainya berkisar antara 0,647 Volt sampai dengan 2,215 Volt. Kontrol-
kontrol ADC yang meliputi RD, WR dan INT akan aktif bila diberikan logika
kaki P2.2, P2.1 dan P2.0, seperti terlihat pada Gambar 3.12. Output ADC yang
berupa data digital dihubungkan dengan mikrokontroler pada port 1. Kaki DB7
pada ADC 0804 dihubungkan pada kaki P1.7 sebagai MSB (Most Significant Bit)
dan pada kaki DB0 sebagai LSB (Least Significant Bit) di hubungkan dengan kaki
P1.0 pada mikrokontroler. Vreff didapat dari dua buah resistor bernilai 2,2 kΩ
Untuk mengubah data hasil ADC 0804 yang berupa data pararel 8 bit
Gambar 3.10. Pin reset dihubungkan dengan saklar tekan, sebuah hambatan dan
kapasitor.
VCC
U1
40
31
39 21
EA/VPP
VCC
C4
30 pF
20
AT89C51
C2 VCC
R11 10uF
10 K
SW PUSHBUTTON
SW1
waktu reset telah lebih dari 2 µs, sesuai dengan persamaan 2.22. Bila nilai R11
0,1 = 10.000 × C 2
C2 = 10 uF
Kristal sebagai sumber detak (clock) dipilih sebesar 11,0592 MHz agar dalam
perhitungan baud rate dapat mudah dihitung yang sesuai dengan persamaan 2.21. Bila
11,0592 MHz
menggunakan kristal 11,0592 MHz, maka timer 1 didetak dengan laju
12
yaitu sebesar 921,6 kHz. Pada persamaan 2.21 timer melimpah dengan laju limpahan
sebesar 32 x Baud rate. Bila menggunakan kristal 11,0592 Mhz didapatkan hasil
limpahan timer secara bulat. Jika menggunakan baud rate 1200 bps, maka laju
Waktu Instruksi
detak =
Laju Limpahan timer1
921600
detak =
38400
detak = 24 kali
mengakses program internal dari PEROM. Jika dihubungkan dengan ground, maka
tidak digunakan.
33
Port 3, yakni P3.1 sebagai kaki TxD akan dikonfigurasikan sebagai penghasil
output data serial secara asinkron yang akan di modulasi oleh XR-2206. Pin kontrol
Data Serial
dari ADC berupa data paralel yang kemudian diolah menjadi data serial dan
data pararel menjadi data serial terdiri dari beberapa langkah yakni : pembacaan
ADC, dan pengiriman data serial, seperti yang ditunjukan gambar 3.12.
MULAI
INISIALISASI
PORT DAN
AKTIFKAN
KONTROL
ADC
BACA ADC
KIRIM DATA
SELESAI
1. Melakukan set pin yang digunakan sebagai kontrol ADC, yaitu pin P2.2, P2.1 dan
P2.0.
membutuhkan beberapa kontrol. Adapun kontrol ADC yang diperlukan antara lain:
1. Start of Convertion (SOC), ADC mulai konversi, bila pin SOC di berikan logika
rendah.
2. End of Convertion (EOC), pemberitahuan keluar ADC, bahwa ADC telah selesai
Pertama rutin baca ADC dimulai dengan mengirimkan sinyal SOC, dengan
memberikan logika rendah pada pin SOC agar ADC mulai mengkonversi. Proses
kedua yaitu menunggu sinyal balasan dari ADC yang berupa logika rendah pada pin
EOC, yang berarti ADC selesai konversi. Proses ketiga yaitu dikirimkan sinyal RD,
agar data digital dapat keluar melalui output ADC menuju port 1.
akumulator yang nantinya akan di rubah menjadi data serial. Pengambilan data akan
dilakukan sebanyak dua kali tiap detiknya dengan cara memberikan tunda waktu
selama 0,5 detik setiap akan mengirim sinyal SOC. Gambar 3.13 merupakan gambar
MULAI
KIRIM SINYAL
SOC
YA
KIRIM SINYAL
BACA (RD)
SELESAI
akumulator. Dimana data pada akumulator akan disalin ke serial buffer (Sbuf).
Pengiriman data serial dimulai dengan mengirim bit start, satu bit kemudian data pada
akumualor akan di kirim dengan cara mengeser kedelapan bit data di mulai dari LSB
sampai MSB, setelah bit kedelapan (MSB) dikirimkan bit stop akan dikirim sebagai
digital yang dapat mengkonversi bit-bit tersebut ke dalam bentuk sinyal analog.
Modulasi digital yang dipakai ialah sistem FSK dengan menggunakan rangkaian
36
terintegrasi tipe XR-2206, yang disarankan pada data sheet seperti pada gambar
3.14.
Bila menggunakan baud rate 1200 bps, maka frekuensi space yang dipakai
adalah 2200 Hz dan frekuensi mark adalah 1200 Hz. Dari nilai tersebut maka
berdasarkan persamaan 2.10 dan persaman 2.11 dapat dicari nilai R12 dan R13,
VCC=12V
C6
1uF
4
U1 XR 2206
1 16
Vcc
5 AMSI SY MA2 15
C5 TC1 SY MA1 14
0.022uF WAVEA2
6 13
TC2 WAVEA1
9 R16
FSK IN FSK I
7 200
TR1 2
STO FSK OUT
R13
38 K 11
8 SY NCO
BIAS
GND
TR2
MO
R12
22 K
10
12
3
1
C7
1uF 50K
2
C8
10uF
3
VCC=12V
R14 R15
5.1K 5.1K
Bila C5 ditentukan sebesar 0,022 uF, dengan asumsi nilai tersebut masih berada
diantara range 1000pF sampai 100 uF yang diijinkan pada data sheet. Maka nilai R12
dan R13 :
1
f1 =
R 13 × C5
37
1
R13 =
1200 Hz × 0,022 uF
R13 = 37.878,78 Ω
1
f2 =
R 12 × C5
1
R12 =
2200 Hz × 0,022 uF
R12 = 20.661,16 Ω
dan Penerima FM yang digunakan dalam penelitian ini adalah rangkaian yang sudah
ada dan dijual dipasaran. Adapun pemancar FM yang dipilih adalah buatan RONICA
dengan nama Pemancar Mini FM 88-108 MHz, dan penerimanya adalah penerima
FM dengan merk dagang RONICA. Pemancar ini dapat memancarkan sampai dengan
jarak kurang lebih 10 m. Pemancar dan penerima ditala pada frekuensi 106 Mhz,
dikarenakan pada frekuensi ini tidak digunakan oleh stasiun pemancar lain sehingga
diharapkan data yang di hasilkan akan bagus. Karena berdaya rendah maka pemancar
Untuk mengubah data yang diterima menjadi bentuk data semula dipakai
demodulator FSK XR-2211, dengan bentuk rangkaian seperti pada data sheet
38
(gambar 3.15). Bila menggunakan baud rate 1200 dengan frekuensi mark 1200
Hz dan frekuensi space 2200 Hz maka dapat dicari nilai komponen pendukungnya
RO sebagai resisitor timing nilainya harus berada dalam range 10KΩ sampai
100KΩ. Nilai yang disarankan data sheet adalah 20KΩ. Nilai RO adalah resistor
keluaran VCO. Bila diseri dengan potensiometer (RX) 20 KΩ maka nilai RO:
RX
RO = RO +
2
20 KΩ
RO = 10 KΩ +
2
RO = 20 KΩ
1
CO =
R O + fO
1
CO =
20000 × 1624
CO = 33 nF
R O × fO
R1 = ×2
(f1 - f 2 )
20 × 1624
R1 = ×2
(2200 - 1200)
39
R1 = 65 KΩ
1250 × CO
C1 = dengan ς = 0,5
R1 × ς 2
1250 × 41 nF
C1 =
65 KΩ × 0,25
C1 = 0,0024 uF
RF = R1 x 5
RF = 65 KΩ x 5
RF = 325 KΩ
RB = RF x 5
RB = 325 KΩ x 5
RB = 1,6 MΩ
RSUM =
(R F + R1 ) × R B
(R1 + R F + R B )
RSUM =
(325KΩ + 65KΩ ) × 1.6MΩ
(65KΩ + 325KΩ + 1.6MΩ )
RSUM = 312 KΩ
0,25
CF =
(R SUM × Baud Rate )
0,25
CF =
(312 KΩ × 1200)
CF = 0,66 nF
40
U1 XR-2211
5 14
LDOQN COMP 1
CO
2 13 33n
Siny al In INP NC
0.1u 3
LDF 10
4 TIM R
GND 0.1u
9
6 TIM C2
LDO
2
Vcc = 12 V 12 1 3
1 VREF
Vcc RO 10K
TIM C1
10K
LDO
DO
11
R1
7
8
65K
RL
DATA OUT
5.1K
RB RF
1.6M 325K
CF C1
0.66n 2.4p
Motor DC
pengontrol arah putaran motor DC. Mikrokontroler akan menerima instruksi dari PC
yang berupa data serial. Instruksi-instruksi yang dikirim akan diolah untuk
mengontrol apakah motor akan berputar CW atau CCW, dan juga memberikan
sebagai pengontrol arah putaran motor DC ditunjukkan pada gambar 3.16, dan
VCC
U1
40
31
39 21
EA/VPP
VCC
38 P0.0/AD0 P2.0/A8 22
37 P0.1/AD1 P2.1/A9 23
36 P0.2/AD2 P2.2/A10 24
35 P0.3/AD3 P2.3/A11 25
34 P0.4/AD4 P2.4/A12 26
33 P0.5/AD5 P2.5/A13 27
32 P0.6/AD6 P2.6/A14 28
P0.7/AD7 P2.7/A15
1 10
PIN 1A IC L293D P1.0 P3.0/RXD
2 11
PIN 2A IC L293D P1.1 P3.1/TXD DATA SERIAL IN DARI IC MAX232
3 12
PIN 4A IC L293D P1.2 P3.2/INTO
4 13
5 P1.3 P3.3/INT1 14
6 P1.4 P3.4/TO 15
C3 7 P1.5 P3.5/T1 16
30 pF 8 P1.6 P3.6/WR 17
P1.7 P3.7/RD
19 29
18 XTAL1 PSEN
11.0592Mhz 9 XTAL2 30
RST ALE/PROG
GND
C4
30 pF
20
AT89C51
C2 VCC
R11 10uF
10 K
SW PUSHBUTTON
SW1
M U LAI
IN IS IA L IS A S I
PORT
APAKAH T ID A K
R 1=1 ?
YA
B A C A IN S T R U K S I
Y A N G D IT E R IM A
In s tru k s i P u ta r YA J a d ik a n P 1 . 0 b e r lo g ik a r e n d a h
m o to r C W d a n p 1 . 1 b e r lo g ik a t in g g i
T ID A K
SELESAI
In s tru k s i P u ta r YA J a d ik a n P 1 . 0 b e r lo g ik a t in g g i
m o to r C C W d a n p 1 .1 b e r lo g ik a r e n d a h
T ID A K SELESAI
I n s t r u k s i B u n y ik a n YA
J a d ik a n P 1 . 2 b e r lo g ik a t in g g i
buzer
T ID A K
SELESAI
J a d ik a n P 1 b e r lo g ik a r e n d a h
SELESAI
Level tegangan dari demodulator FSK supaya dapat diterima oleh PC maka
perlu diubah level tegangannya menjadi level RS232. Pengubahan level tegangan
TTL dari Demodulator FSK menjadi tegangan dengan level RS232 dengan
tegangan RS232 ini mengikuti konfigurasi dari data sheet RS232. Input TTL pada
RS232 ada dua yaitu T1IN dan T2IN yang pada perancangan dipilih T2IN sebagai
input tegangan TTL dari demodulator FSK. Sedangkan output yang terhubung dengan
port serial dihubungkan dengan pin T2OUT. Sedangkan pin R2IN sebagai input dari
port serial dan R2OUT sebagai output yang terhubung ke mikrokontroler adalah pin
R2OUT. Ground rangkaian dengan ground pada bagian komputer dihubungkan agar
referensi tegangan antar kedua perangkat sama sehingga data dapat diterima dan
dikirim dengan acuan yang sama. Gambar 3.18 menunjukkan konfigurasi RS232.
VCC 5 V
C12
1uF
16
U1
2 12
VCC
9 V+ R1OUT 14
Mikrokontroler RX P1
10 R2OUT T1OUT 1
Demodulator FSK T2IN
CONNECTOR DB9
6
7 2
1 T2OUT 7
3 C+ 8 3
C13 4 C1- R2IN 8
1uf 5 C2+ 4
C2- 13 9
GN D
6 R1IN 11 5
C14 V- T1IN
1uF MAX232
15
C15
1uF
tegangan RS232 yaitu sebagai kapasitor eksternal untuk Voltage Doubler. Masing-
pada data sheet MAX232. Bila nilai C13 dan C14 dinaikkan, maka akan mengurangi
nilai impedansi input rangkaian voltage doubler dan inverter. Bila nilai C12 dan C15
ketinggian air yang diatur, dan menu pelengkap program. Menu tambahan berupa
menu Bantuan yang disertakan, sehingga pengguna dapat lebih mengenal program
ketinggian air yang akan diatur, setelah diisi program akan menampilkan penunjuk
pintu air dilakukan dengan mengirimkan instruksi menggerakkan motor melalui port
44
serial, berdasarkan perbandingan antara data ketinggian yang di isi oleh user dengan
Form utama berfungsi menampilkan ketinggian air, ketinggian yang akan diatur serta
menu-menu program. Gambar rancangan tampilan form utama seperti Gambar 3.19.
Tombol-tombol pada form utama, bila dipilih akan menuju pilihan atau eksekusi
tertentu seperti ditunjukkan pada diagram alir Gambar 3.20. Data serial ditampilkan
dalam bentuk angka yang mewakili tinggi air sungai. Form utama juga menampilkan
pesan sungai kering saat data 33 diterima dan sungai meluap saat data 113 diterima.
Pengaturan otomatis
Bantuan INPUT USER
ATUR PENGATURAN
KELUAR
KETINGGIAN MANUAL
MULAI
Tampilkan Atur
Ketinggian air A
Tampilkan form
utama
YA
Tombol Pengaturan
Manual ditekan
Tampilkan form
Pengaturan
Manual TIDAK
SELESAI
Tombol Atur
A
YA Ketinggian ditekan
TIDAK
Menu
Bantuan
TIDAK
Tombol Keluar
Olah Data
ditekan?
YA
A
SELESAI
Pengaturan otomatis
Bantuan
SUNGAI MELUAP
ATUR PENGATURAN
KELUAR
KETINGGIAN MANUAL
Pengaturan otomatis
Bantuan
SUNGAI KERING
ATUR PENGATURAN
KELUAR
KETINGGIAN MANUAL
Pada rutin olah data, data ketinggian air yang diterima dibandingkan
dengan data ketinggian air yang diisi user. Hasil data yang dibandingkan dipakai
sebagai acuan untuk mengatur pintu air, seperti pada diagram alir pada gambar 3.23.
bila ketinggian air > dari ketinggian yang isi user maka pintu air akan bergerak
menutup, dan sebaliknya bila ketinggian air < ketinggian yang di isi user maka pintu
air akan bergerak membuka sampai didapat nilai ketinggian air sesuai dengan
ketinggian yang di isi user ( bila ketinggian air = ketinggian yang di isi user). Dan bila
data yang diterima < biner dari 37 (mengindikasikan tidak ada aliran air), akan
ditampilkan pesan sungai kering. Sedang bila data yang diterima > biner dari 105
M u la i
YA T a m p ilk a n p e s a n S u n g a i
D a ta y a n g d i te rim a > d a ta
D a ta y a n g d i te rim a = 1 0 5 M e lu a p d a n b u n y ik a n
y a n g d i is i
buzzer
YA
P u ta r M o to r C W
T ID A K
T ID A K P u ta r M o to r C W
S e le s a i
S e le s a i
YA
D a ta y a n g d i te rim a < T a m p ilk a n p e s a n S u n g a i
D a ta y a n g d i te rim a = 3 7
d a ta y a n g d i is i K e rin g
YA
P u ta r M o to r C C W
T ID A K
T ID A K
P u ta r M o to r C C W
S e le s a i
M o to r B e r h e n ti B e rp u ta r
S e le s a i
S e le s a i
Pengaturan manual digunakan bila user menginginkan pintu air diatur secara manual,
yakni dengan menekan tombol buka dan tutup. Seperti pada rancangan gambar 3.24.
Pengaturan Manual
BUKA
Pengaturan
Keluar
Otomatis
1. Bila tombol buka ditekan maka motor akan berputar CCW, dan
2. Bila tombol tutup ditekan maka motor akan berputar CW, dan
3. Bila tidak ditekan tombol apapun maka motor tidak akan berputar
berfungsi
49
form utama.
Cara kerja pengaturan manual ditunjukkan pada diagram alir gambar 3.25.
Mulai
TIDAK
YA
TIDAK Selesai
Motor berhenti berputar,
bunyikan buzzer dan
tampilkan pesan “Sungai
meluap”
Selesai
Putar motor CW
Tombol TUTUP YA dan tampilkan
di tekan pesan “Menutup
pintu air”
TIDAK
Selesai
Tombol
Tampilkan form YA Pengaturan
utama otomatis
ditekan
Selesai TIDAK
Tombol Keluar
B
di tekan
YA
Selesai
maksimum air sungai yang akan diatur. Adapun rencana tampilan ‘Atur Ketinggian’
Program’. Bila menu ‘Tentang’ dipilih, pesan tentang pembuat program akan
Program ditunjukkan pada Gambar 3.29. Tombol tutup pada masing-masing menu
bila dipilih, akan menutup pesan. Diagram alir lengkap menu bantuan ditunjukkan
Mulai
Selesai
C
YA
Menggunakan TIDAK
Tentang TIDAK Program C
C
ditekan? ditekan?
YA
YA
Selesai
Selesai
Tentang
Menggunakan Program
Supaya motor dapat menggerakkan pintu air naik atau turun maka diperlukan
suatu rangkaian yang dapat membalik putaran motor. Pada perancangan ini dipakai
motor driver tipe L293D sebagai rangkaian pembalik putaran motor. Karena pada seri
L293D dioda sudah terdapat di dalam IC maka untuk dipakai sebagai pembalik
putaran motor DC maka L293D di rangkai seperti pada gambar 3.30 yang disarankan
VCC1
U1
1 16
1,2EN VCC1
2 15
1A 1A 4A
1
3 14
1Y 4Y
4 13
GND GND
VCC2 5 12
MOTOR DC GND GND
6 11
2Y 3Y
7 10
2
2A 2A 3A
8 9
VCC2 3,4EN
L293 D
Cara kerja rangkaian pembalik putaran motor pada gambar diatas menurut tabel
1. Supaya rangkaian terus bekerja maka pin enable harus diberi logika tinggi,
2. Bila kaki 1A mendapat logika tinggi dan kaki 2A mendapat logika rendah
3. Bila kaki 1A mendapat logika rendah dan kaki 2A mendapat logika tinggi
4. Bila kaki 1A dan kaki2A mendapat logika yang sama maka motor DC
Motor DC yang digunakan untuk memutar ulir pada model pintu air adalah
Motor ini mempunyai karakteristik semakin besar arus yang diberikan maka akan
semakin cepat pula perputarannya, motor ini juga mempunyai torque yang besar
sehingga cukup untuk menggerakkan ulir pada model pintu air. Motor DC diberi
catuan 12V pada Vcc1 dan Vcc2 rangkaian driver pengendali arah putaran motor.
Adapun rencana bentuk kontrol pintu air adalah seperti gambar 3.31.
ULIR PENGGERAK
NAIK/TURUN
PENAHAN ULIR
MOTOR DC
LINTASAN NAIK/TURUN
42 Cm
PINTU AIR
12 cm ALIRAN AIR
Supaya motor DC berhenti berputar ketika pintu air sudah berada pada posisi
menutup atau pada posisi terbuka penuh, maka ditambahkan limited switches (LS)
seperti pada gambar 3.32. LS dirangkai sebagai penghubung antara port pararel
dengan input logika rangkaian pembalik putaran motor, seperti pada gambar 3.33.
55
LS A
TUAS PENEKAN LS
MOTOR DC
LS B
PINTU AIR
VCC1
U1
2 1 1 16
P1.0 mikrokontroler 1,2EN VCC1
LS A 2 15
1A 4A
3 14
1Y 4Y
1
4 13
GND GND
5 12
GND GND
MOTOR DC 6 11
2Y 3Y
7 10
2A 3A
2
2 1 8 9
P1.1 mikrokontroler VCC2 3,4EN
LS B
L293 D
Fungsi pembats putaran motor DC adalah untuk mencegah supaya motor tidak
terus berputar ketika pintu air sudah tertutup atau terbuka maksimal, yang pada
akhirnya bisa mengakibatkan kerusakan baik pada motor DC maupun pada model
pintu air. Cara kerja dari rangkaian pembatas putaran motor DC adalah sebagai
berikut :
akan short sedang bila di tekan akan berubah kondisi mejadi open.
2. LS A akan tertekan tuas penekan bila pintu air dalam kondisi terbuka penuh.
3. Bila LS A di tekan maka kondisi yang semula short berubah menjadi open,
akan sampai ke IC L93D sehingga motor akan berhenti berputar atau hanya
4. LS B akan tertekan tuas penekan bila pintu air dalam kondisi tertutup total.
5. Bila LS B di tekan maka kondisi yang semula short berubah menjadi open¸
sampai ke IC L293D sehingga motor akan berhenti berputar atau hanya bisa
Warning sistem digunakan untuk memberi peringatan bila air sungai melebihi
kapasitas (tinggi air sungai >18 cm), cara kerja warning sistem adalah bila ketinggian
air sungai > 18 cm maka mikrokontroler AT89S51 pada P1.2 yang dihubungkan
berbunyi. Begitu sebaliknya, bila air sungai < 19 cm maka logika rendah yang akan
57
dikirim, sehingga buzzer tidak akan berbunyi.. Rangkaian warning sistem ditunjukkan
VCC1
U1 P1.2 mikrokontroler
1 16
1,2EN VCC1
2 15
1A 4A
3 14
1Y 4Y
2
4 13 LS1
GND GND
5 12 BUZZER
GND GND
6 11
2Y 3Y
1
7 10
2A 3A
8 9
VCC2 3,4EN
VCC2
L293 D
Bab ini membahas perihal pengamatan atas rancangan telemetri ketinggian air
sebagai pengatur model pintu air berbasis mikrontroler AT89S51 dan program Visual
Basic, yang berupa pengujian perangkat keras maupun pengamatan perangkat lunak.
pengondisi sinyal, modulator FSK, demodulator FSK, arah perputaran motor DC dan
digital dengan nama dagang SANWA, osiloscop digital, Audio Function Generator,
komputer dengan spesifikasi : Pentium 3 550 MHz, RAM 128 MB, Hardisk 4 Gb,
tegangan sesuai dengan tingkat ketinggian air. Dari hasil pengamatan dapat
1.800
1.600
1.400
1.200
Vsensor
1.000
0.800
0.600
0.400
0.200
0.000
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Ketinggian Air
Gambar 4.1a Gambar Vsensor potensio multi turn saat air naik
1.800
1.600
1.400
1.200
Vsensor
1.000
0.800
0.600
0.400
0.200
0.000
20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Ketinggian Air
Gambar 4.1b Gambar Vsensor potensio multi turn saat air turun
Ternyata dari hasil pengamatan pada waktu air sungai naik di dapat data yang
bagus (mendekati nilai perancangan) tetapi pada saat ketinggian air turun didapat data
yang tidak sempurna. Hal ini dikarenakan adanya perbedaan tekanan pada pelampung
60
sensor ketika bergerak keatas dengan ketika pelampung bergerak kebawah. Ketika
pelampung bergerak keatas maka diperlukan tekanan yang besar sehinga pelampung
seharusanya sudah berputar belum mau berputar. Sedangkan ketika pelampung dalam
keadaan turun kebawah tekanan yang terjadi pada pelampung lebih kecil sehinga
air di mana nantinya hal tersebut akan sangat fatal akibatnya, yakni ketinggian air
sungai yang tertampil pada PC akan berbeda dengan dengan ketinggian air sungai
yang sebenarnya dan hal ini akan mempengaruhi kinerja sistem secara keseluruhan .
Untuk mengatasi hal tersebut di atas maka pada perancangan sensor ketingian
di rubah mengunakan sistem lengan seperti pada gambar 4.2, untuk mengurangi efek
dari perbedaan gaya tekan yang timbul. Adapun sensor yang dipakai adalah
Potensio Linear
20 cm Lengan
ayun
Pelampung
maksimum air sungai 20 cm, dan R sensor untuk ketinggian air sungai 0 cm di set
61
pada 5 KΩ (potensio mulai bernilai stabil bila Rpotensio > 2 KΩ) maka berdasarkan
percobaan yang dilakukan di dapat besar hambatan maksimum dan minimum, yakni
sebesar ;
mengacu pada persamaan 2.5 maka dapat dihitung Vo sensor yang baru, yakni :
5.000 8.330
VO min = × 5V VO max = × 5V
49.000 49.000
(0,85 V - 0,51 V)
Vinterval = × 1cm
20cm
Vinterval = 17 mV
mengacu pada persamaan 3.1 maka didapat persamaan yang baru yakni :
Dari persamaan diatas maka dibangun rangkaian pengkondisi sinyal yang baru seperti
5 Volt
Vee = -5 V
4
1.932K
2 -
1
3 +
V o1 = 1.705 V
10K
1K
8
Vee = -5 V
Vcc = 5 V 10K
4
2 -
10K 1
46.120 K 3 +
Vo3
Vee = -5 V Ke ADC
8
Vee = -5 V 08004
Vcc = 5V
4
4
2 - 10K
1 2 -
3 + 1
3 +
V o2 = Vs e ns or x 4.612
V s e ns or
8
Vcc = 5 V
Vcc = 5 V
Dengan sensor potensio linear maka dari pengamatan didapat data yang lebih
1.000
0.900
0.800
0.700
0.600
Vsensor
0.500
0.400
0.300
0.200
0.100
0.000
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Ketinggian air sungai
Gambar 4.4a Vo sensor ketinggian potensio linear sistem lengan saat air sungai naik
63
1.000
0.900
0.800
0.700
0.600
Vsensor
0.500
0.400
0.300
0.200
0.100
0.000
20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Ketinggian Air
Gambar 4.4b Vo sensor ketinggian potensio linear sistem lengan saat air sungai turun
Dari gambar 4.4 di atas dapat terlihat bahwa sensor potensio sistem lengan
bekerja lebih baik dari pada sensor potensio sistem batang bergerigi (perancangan
awal). Nilai Voutput sensor mendekati nilai pada perancangan baik pada waktu air
sungai bergerak naik maupun pada waktu air sungai bergerak turun. Dari hal trsebut
dilakukan dengan cara melakukan pengukuran sebanyak empat kali pada Voutput
apakah rangkaian pengkondisi sinyal sudah dapat bekerja dengan baik. Hasil
64
pengamatan pada rangkaian pengkondisi sinyal seperti pada tabel 4.1 dengan
0 cm. Dimana Vout praktek rata-rata = 0,645 V. Dan Vout perancangan = 0,647 V.
⎛ 0,647 - 0,645 ⎞
Perbedaan = ⎜ ⎟ × 100%
⎝ 0,647 ⎠
Perbedaan = 0,309 %
Lajutan Tabel 4.1 Tabel perbandingan data praktek dan perhitungan teori
rangkaian pengkondisi sinyal
Ketinggian Air Vout percobaan Vout rata-rata Vout Galat
(cm) (V) Percobaan (V) perancangan (%)
0,987
4 0,991 0,981 0,961 2.145
0,973
0,973 .
1,080
5 1,068 1,062 1,039 2.185
1,058
1,040
1,192
1,148
6 1,157 1,117 3.518
1,127
1,159
1,216
1,253 1,230 1,196 2.856
7
1,203
1,247
1,330
1,338 1,323 1,274 3.807
8
1,303
1,322
1,386
1,398
9 1,389 1,353 2.725
1,380
1,393
1,484
1,470 1,478 1,431 3.316
10
1,470
1,489
1,557
1,557 1,552 1,509 2.819
11
1,550
1,543
1,645
1,647 1,634 1,588 2.891
12
1,630
1,612
66
Lanjutan Tabel 4.1 Tabel perbandingan data praktek dan perhitungan teori
rangkaian pengkondisi sinyal
Ketinggian Air Vout percobaan Vout rata-rata Vout Galat
(cm) (V) Percobaan (V) perancangan (%)
1,726
1,727 1,719 1,666 3.166
13
1,710
1,712
1,811
1,804 1,806 1,745 3.503
14
1,800
1,807
1,903
1,881 1,881 1,823 3.165
15
1,850
1,888
1,955
1,958 1,958 1,901 2.974
16
1,950
1,968
2,010
2,030 2,030 1,980 2.546
17
2,020
2,060
2,180
2,100 2,120 2,058 3.013
18
2,102
2,100
2,240
2,180 2,193 2,137 2.626
19
2,184
2,170
2,280
2,280 2,248 2,215 1.476
20
2,220
2,210
yang akan dikonversikan ke dalam bentuk digital. Output digital hasil ADC masih
bisa ditolerir kebenarannya bila melompat dua angka binernya, sebagai contoh bila
untuk ketinggian 0 cm di wakili oleh data biner 33, maka bila output ADC berupa
67
data biner 35 hasil output ADC tersebut pada PC masih akan ditampilkan data
ketingian 0 cm (data biner 35 masih dianggap benar untuk ketinggian 0 cm). dari hal
tersebut maka dapat dihitung besarnya galat yang masih di tolerir, yakni ;
⎛ 0,647 − 0,686 ⎞
Galat maksimum = ⎜ ⎟ × 100 %
⎝ 0,647 ⎠
= 6,027 %
Maka dengan melihat table 4.1 dapat terlihat bahwa galat rata-rata
nilainya < galat maksimum yang di ijinkan. Maka dapat disimpulkan bahwa
rangkaian pengkondisi sinyal sudah dapat bekerja dengan baik, karena meskipun
outputnya tidak benar-benar tepat seperti pada perancangan namun masih pada batas
Pengamatan pada bagian ini dengan cara memberi led pada keluaran ADC
0804, sehingga berdasar tegangan input rangkaian pengkondisi sinyal akan diketahui
bilangan biner hasil konversi keluaran ADC 0804. dan bila dihitung perbedaan antara
⎛ 33 - 33 ⎞
Perbedaan = ⎜ ⎟ × 100%
⎝ 33 ⎠
Perbedaan = 0%
Dari tabel dapat terlihat hampir sebagian besar besar nilai output ADC
mendekati nilai pada perancangan (dasar teori). Dengan demikian dapat di katakan
bahwa rangkaian ADC0804 pada hasil perancangan BAB III dapat bekerja dengan
Hasil keluaran Modulator FSK berupa gelombang sinus dengan frekuensi yang
tertentu, yang bergantung pada input masukan. Bila di beri input logika 1 maka akan
dihasilkan suatu frekuensi yang disebut f mark, dan bila di beri input logika 0 maka
akan dihasilkan suatu frekuensi yang di sebut f space. Seperti perancangan pada BAB
persamaan 2.10 dan 2.11 dapat di hitung ulang untuk nilai fmark dan f space nya
sebesar ;
1
f mark =
0.022 uF × 38 KΩ
f mark = 1,196KHz
70
1
f space =
0.022 uF × 22 KΩ
hasil percobaan didapatkan nilai frekuensi mark dan space seperti dalam tabel 4.4
f 0 × R0
Δf =
R1
1624 Hz × 30 KΩ
Δf =
65KΩ
Δf = 749,5Hz
Dari hasil perhitungan dan gambar 4.5 di atas maka demodulator XR-2211
ulang maka besarnya frekuensi harus berada di dalam nilai tracking badwidth diatas.
Dimana untuk ;
71
karena output modulator FSK mempunyai nilai yang besarnya masih di dalam
didemodulasikan ulang dengan baik pada rangkaian Demodulator FSK XR-221, atau
dengan kata lain rangkaian Modulator XR-2206 sudah dapat bekrja dengan baik untuk
input masukan berupa gelombang kotak logika TTL dari audio frekuensi generator
dengan frekuensi 600 Hz (untuk mewakili baudrate 1200bps), akan tampak seperti
fmark fspace
Dari hasil percobaan pada gambar 4.5, di dapat untuk setiap logika 0 di wakili
oleh dua buah gelombang dengan frekuensi 1,149 KHz dan logika 1 di wakili satu
perancangan dapat bekerja dengan baik pada baudrate 1200bps. Sebagai contoh bila
Modulator XR-2206 seperti ditunjukkan pada gambar 4.6, yakni bila ada data logika 1
maka output XR-2206 berupa gelombang sinus dengan frekuensi 1,141 KHz, dan bila
ada logika 0 Output XR-2206 berupa gelombang sinus dengan frekuensi 2,041 KHz .
Start Stop
8 Bit Data
Bit Bit
Data serial
0 1 1 1 0 1 0 1 0 1 Out
Output Modulator
XR2206
Hasil keluaran Demodulator FSK XR-2211 berupa gelombang kotak dengan nilai
amplitudo yang tertentu. Dimana besarnya amplitudo bergantung dari input masukan
yang berupa gelombang sinus dengan frekuensi tertentu. Pengamatan hasil keluaran
demodulator FSK ini dilakukan dengan cara memberikan masukan yang berupa
73
gelombang sinus pada kaki input IC XR-2211 dengan nilai frekuensi yang tertentu,
Dari hasil data percobaan, maka meskipun pada rangkaian modulator FSK
frekuensi mark dan space tidak bernilai tepat seperti pada perancangan (di mana
fmark =1,149 KHz dan fspace = 2,041 MHz) namun bila masih berada dalam tracking
badwith rangkaian demodulator FSK, tetap akan menghasilkan output sesuai dengan
logika pada input modulator FSK. Sebagai contohnya bila mikrokontroler AT89S51
yang sama dengan input. Adapun gelombang kotak keluaran demodulator FSK XR-
2211 dari hasil percobaan didapatkan nilai tegangan untuk logika 1 sebesar 10,4 V
dan untuk logika 0 sebesar 0,09 V. Bila berdasarkan data sheet untuk mengubah level
input Voltage min = 2 V dan Low-level input voltage max = 0,8 V, maka dengan nilai
tegangan untuk logika 1 dan 0 hasil percobaan dapat dipakai sebagai input voltage IC
MAX232.
S t a r t b it S to p b it
0 0 1 0 0 0 1 1 0 1
O u t p u t D e m o d u la t o r
F S K X R -2 2 1 1
In p u t M o d u la t o r
F S K X R -2 2 0 6
gelombang yang sama dengan input modulator FSK XR-2206, maka dapat
disimpulkan bahwa rangkaian modem FSK dapat bekerja dengan baik pada baudrate
1200 bps.
RS232. Gambar 4.8 menunjukkan hasil pengubahan logika TTL menjadi logika
RS232.
Dari gambar 4.8 terlihat bahwa rangkaian pengubah level teganagn TTL
menjadi level tegangan RS232 bekerja dengan benar. Dimana logika 1 Level tegangan
TTL (10,4 V) pada output IC MAX232 di rubah level teganganya menjadi level
75
RS232 yakni sebesar -8,8 V, dan begitu sebaliknya untuk logika 0 ( 0,09 V) dirubah
level tegangannya menjadi sebesar 9,6 V. Hal ini sesuai dengan standar sinyal serial
RS 232 yang telah dijelaskan pada BAB II, yakni untuk logika 1 terletak antara -3 V
10,4 V
0,09 V
9,8 V
- 8,8 V
Gambar 4.8 Pengubahan level tegangan TTL menjadi level tegangan RS232
program pinnacle. Ada dua macam program yang diamati, yakni program
mikrokontroler AT80S51 pada bagian pemancar (pengubah data pararel manjadi data
serial) dan pada bagian penerima (pengendali putaran motor DC dan buzzer)
Pada bagian ini pengamatan pada program pinancle berupa output pin kontrol
ADC .Pertama diaktifkan mikrokontroler akan mengirimkan sinyal tulis pada pin
P2.1, seperti ditunjukkan pada Gambar 4.9a. Bila ADC telah selesai mengkonversi
data, maka akan mengirimkan sinyal EOC pada pin P2.0, seperti ditunjukkan pada
76
mengirimkan sinyal baca pada P2.2, output P2.2 seperti Gambar 4.9.
.Pada bagian ini diamati hasil keluaran P1.0, P1.1, dan P1.2 pada
memutar motor dan membunyikan warning system melalui program Visual Basic 6
dan melakukan pengukuran pada P1.0, P1.1, dan P1.2 dengan menggunakan
multimeter digital sesuai dengan instruksi yang diberikan. Dimana hasil keluaran akan
berupa tegangan yang mengindikasikan logika keluaran, yang akan dipakai untuk
mengontrol arah putaran motor DC dan membunyikan buzzer. Hasil percobaan seperti
2. bila berdasar pada data sheet IC L293D untuk logika 1 level tegangan
input harus > 2,3 V dan untuk logika 0 level tegangan input harus < 1,5 V,
L293D
pada kaki input IC l293D sesuai dengan level tegangan output mikrokontroler, yakni
0,05 V (logika 0) atau 4,98 V (logika 1). Dimana pin 2 dan 7 sebagai pin input
pengatur putaran motor DC, dan pin 15 sebagai input pengatur buzzer. Hasil
Dari data yang diperoleh pada tabel 4.6, membuktikan bahwa level tegangan
output pada mikrokontroler AT89S51 dapat berfungsi sebagai diver IC L293D dan
ICL293D sendiri dapat bekerja dengan baik pada sistem rangkaian sebagai rangkaian
pembalik putaran motor DC dan warning system sesuai dengan perancangan pada
BAB III.
program untuk mengetahui ketingian air sungai dan menampilkannya, serta bentuk
menu perintah untuk mengisi ketingian air yang akan diatur, seperti pada gambar
4.10. Bila ketinggian air yang di isi tidak sesuai ketentuan maka akan ditampilkan
Setelah nilai ketinggian air yang akan di atur telah di isi sesuai dengan
ketentuan, form utama pengaturan otomatis akan ditampilkan seperti yang ditunjukan
Gambar 4.10 Instruksi untuk mengisi ketinggian air yang akan diatur
Pada pengaturan otomatis terdapat beberapa menu dan fungsinya, adapun fungsi
ketinggian air sungai yang telah di isi user sewaktu pertama kali membuka
80
program. Bila tombol ini di tekan maka akan muncul tampilan untuk mengisi
ketinggian air sungai yang akan di atur seperti pada gambar 4.10.
3. Tombol “Keluar” : tombol keluar digunakan bila hendak keluar dari program
menu “Bantuan” : menu bantuan di pakai untuk memberi pengetahuan tentang seluk
beluk program tersebut, baik tentang profil pembuatnya maupun tentang cara
menggunakan program.
Tombol untuk
berpindah ke sistem
pengaturan manual
Pada program Visual Basic 6.0 baik pada pengaturan otomatis dan pengaturan
masuk = Comm1.Input
Form manual di pilih bila akan mengatur ketinggian air sungai secara manual.
Tampilan form pengaturan manual seperti pada gambar 4.13. Pada form ini terdapat
tampilan ketinggian air sungai hasil sensor ketinggian air, dan beberapa tombol
1. Tombol “Buka” : tombol buka digunakan untuk membuka pintu air. Bila
tombol ini di tekan maka akan di kirim instruksi putar motor CCW yang
2. Tombol “Tutup” : tombol tutup digunakan untuk menutup pintu air. Bila
tombol ini di tekan maka akan di kirim instruksi putar motor CW yang berarti
Tombol untuk
membuka pintu air
Tombol untuk
menutup pintu air
Ketinggian air
sungai
program. Didalamnya terdapat menu tentang profil pembuat program dan menu cara
Pengamatan ini dilakukan untuk mengamati sejauh mana alat tersebut bekerja.
Pengamatan ini dilakukan dengan membandingkan antara ketinggian air yang terukur
dengan ketinggian air yang tertampil pada PC, dan pengamatan dari kerja program
secara keseluruhan.
Untuk mengetahui apakah modem FSK sudah bekerja dengan baik maka
dengan input demodulator FSK menggunakan media transmisi kabel seperti yang
ditunjukan pada gambar 4.15, dengan kecepatan pengisyaratan data 1200 bps,
kemudian dibandingkan antara ketinggian air yang terukur dengan ketinggian air yang
tertampil pada PC
Pemancar Penerima
FM FM
Kabel Penghubung
Modulator FSK Demodulator FSK
Dari hasil percobaan seperti pada gambar 4.15 diatas, didapatkan tampilan
ketinggian air hasil pengukuran sensor pada program Visual Basic 6.0 seperti pada
tabel 4.7.
84
Dari hasil pengamatan pada table 4.7, PC dapat menampilkan ketinggian air
sungai yang terukur dengan baik. Dari hasil percobaan ini dapat disimpulkan bahwa
modem dapat bekerja dengan baik pada kecepatan pengisyaratan data 1200 bps.
secara termodulasi frekuensi, untuk melihat tingkat keberhasilan kerja sistem secara
telemetri.
85
bps, di dapat data seperti pada tabel 4.8 (dengan hanya mengambil beberapa data
saja).
Tabel 4.8 Tabel perbandingan ketinggian air sungai sebenarnya dengan yang
tertampil pada PC menggunakan transmisi pemancar FM
0 cm
0 cm Tidak tertampil
6 cm
Tidak tertampil
3 cm
5 cm 9 cm
Tidak tertampil
5 cm
10 cm
10 cm 15 cm
20 cm
10 cm
Tidak tertampil
15 cm 7 cm
13 cm
Tidak tertampil
20 cm
20 cm 16 cm
14 cm
Tidak tetampil
Dari hasil pengamatan pada tabel 4.8 terlihat bahwa terjadi banyak kesalahan
dalam penampilan ketinggian air. Tidak tertampilnya ketinggian air sungai pada PC
mengindikasikan bahwa data biner yang di akses program Visual Basic 6.0 melampui
atau kurang dari data yang di ijinkan masuk, dimana data yang di ijinkan masuk di
antara biner 00100000b sampai 01110011b. Bila data yang di akses tidak berada
dalam range tersebut maka Program tidak akan menampilkan ketinggian air sungai.
tidak berkualitas bagus dan daya pancar yang tidak terlalu kuat maka pentransmisian
86
data rentan sekali tehadap intererensi. Dari gambar 4.6 dapat terlihat bahwa fmark
hasil output modulator hanya terdiri dari 1 gelombang sinus, dan fspace terdiri dari 2
gelombang sinus, maka fmark dengan jumlah gelombang yang sedikit akan rentan
gambar 4.16.
D a ta y a n g
d im o d u la s ik a n
D a ta h a s il
d e m o d u la s i
Gambar 4.16
Kesalahan proses demodulasi data FSK
Dari gambar 4.16 data hasil demodulasi berbeda jauh dengan data yang
menurunkan kecepatan pengisyaratan data dari yang semula 1200 bps menjadi 300
bps. Dari hasil percobaan tersebut di dapat data pengamatan seperti yang ditunjukkan
Dari tabel 4.9 dapat disimpulkan bahwa sistem bekerja baik dengan
menggunakan kecepatan pengisyaratan data 300 bps. Hal tersebut di karenakan bila
menggunakan kecepatan pengisyaratan data 300 bps maka jumlah gelombang baik
pada fmark dan fspace akan menjadi lebih banyak (seperti pada gambar 4.17)
sehingga bila terjadi interferensi tidak akan berpengaruh besar pada proses
demodulasi (demodulator FSK masih dapat mengidentifikasi dengan baik fmark dan
fspace)..
88
O u tp u t M o d u la to r F S K
fm a rk fs p a c e
O u tp u t D e m o d u la to r F S K
Gambar 4.17 Ouput Modem FSK dengan kecepatan pengisyaratan data 300 bps
Dari hasil pengamatan pada tabel 4.7 di atas dapat di simpulkan bahwa
pengukuran yang tidak benar-benar tepat, atau dengan kata lain sensor ketinggian
Pada pengaturan otomatis data yang dimasukan oleh user di pakai sebagai
pembanding untuk menentukan apakah pintu air harus menutup, membuka atau diam.
Pada pengamatan ini dilakukan dengan cara memberikan masukan input ketinggian
yang akan diatur, dimana diambil ketinggian yang akan di atur adalah 6 cm.
Pengamatan di lakukan pada kondisi awal model sungai dalam keadaan kering
(ketinggian 0 cm) dan di amati dalam rentang waktu tertentu. Dari hasil pengamatan
dapat digambarkan grafik perubahan waktu terhadap ketinggian air sungai hasil
6
Ketinggian air sungai
0
0 20 40 60 80 100 120
Dari gambar 4.18 pengaturan secara otomatis dalam mengatur ketinggian air
masih terjadi overshoot terhadap batas ketinggian yang ditentukan. Hal ini
dikarenakan sangat sulitnya membuat model pintu air sungai yang mendekati kondisi
sebenarnya. Sehingga ketika pintu air membuka sedikit saja air langsung naik dengan
pemberitahu seperti yang ditunjukkan pada gambar 4.19 dan 4.20. Bila ketinggian air
sungai > 18 cm maka akan tertampil peringatan bahwa sungai meluasp, dan warning
system akan aktif dengan di tandai berbunyinya buzzer. Sedangkan bila ketinggian
sungai kurang dari 1 cm maka pada form pengaturan otomatis tertampil pesan sungai
Ketinggian
> 18 cm
Pesan
pemberitahu
sungai meluap
Ketinggian
air <1 cm
Pesan sungai
kering
Pada sistem pengaturan manual user melakukan perintah untuk membuka atau
menutup pintu air secara manual, yakni dengan menekan tombol “Buka” atau “Tutup’
yang terdapat pada form pengaturan manual. Pengamatan dilakukan dengan cara
memberikan perintah membuka atau menutup pintu air, dan berdasarkan data
ketinggian air yang di terima di amati kerja sistem pada pengaturan manual.
Dari hasil pengamatan yang dilakukan maka di buat tabel hasil pengamatan
0 0
10 2,2
Tombol 20 4,3
“ BUKA “ di 30 6,1
tekan 40 8
50 9,7
60 10.5
0 10
10 8,6
Tombol 20 6,1
“TUTUP” di 30 4,8
tekan 40 2,5
50 0,9
60 0
92
0 0
10 0
Tidak ditekan
20 0
tombol apapun
30 0
40 0
50 0
60 0
diantaranya pesan pemberitahu apakah user sedang membuka atau menutup pintu air
(seperti pada gambar 4.21 dan gambar 4.22), pesan pemberitahu bahwa pintu tidak
dapat di buka lagi karena air sungai berada pada ketinggian di atas 18 cm (seperti
pada gambar 4.23), dan pesan pemberitahu bahwa pintu air tidak dapat di tutup lagi
karena air sungai berada pada ketinggian 0 (seperti pada gambar 4.24).
93
Instruksi yang
Pesan pemberitahu
dilakukan
instruksi yang
dilakukan
Ketinggian air
sungai
Pesan pemberitahu
instruksi yang
dilakukan
Instruksi yang
dilakukan
Ketinggian air
sungai
Pesan
Gambar pemberitahu
Instruksi yang
dilakukan
Pesan
peringatan
Ketinggian air
sungai
Pesan
pemberitahu
Pesan
peringatan Instruksi yang
dilakukan
Ketinggian air
sungai
5.1 Kesimpulan
model pintu air dengan MCS-51 dan program Visual Basic dapat diambil kesimpulan
sebagai berikut :
menggatur model pintu air dan dapat memberi peringatan bahwa sungai meluap
2. Sensor ketinggian air mempunyai hasil pengukuran yang kurang baik untuk
hasil dari pengaturan ketinggian air tidak benar-benar tepat seperti yang
dimasukkan user, tetapi masih terjadi overshoot terhadap ketinggian yang di atur.
5.2 Saran
1. Pengukuran ketinggian air dapat di buat lebih teliti, yakni dengan memperkecil
2. Telemetri ketinggian air sebagai pengatur model pintu air dapat dikembangkan
untuk sistem operasi yang berbasis open source seperti pada linux.
96
3. Telemetri ketinggian air sebagai pengatur model pintu air dapat dikembangkan
penghematan biaya.
4. Perancangan telemetri ketinggian air sebagai pengatur model pintu air dapat
nyata.
DAFTAR PUSTAKA
1986.
[2] http://pdf1.alldatasheet.com/datasheet-pdf/view/66283/INTERSIL/ADC0804.html
[3] http://www.elektro.undip.ac.id/transmisi/des05/sukiswodes05.PDF
[4] http://www.ortodoxism.ro/datasheets/exar/XR2206v103.pdf
[5] http://www.jaycar.com.au/images_uploaded/XR2211V3.PDF
[6] Agfianto Eko Putra, Belajar Mikrokontoler AT89C51/52/55 (Teori dan Aplikasi),
[7] Retna Prasetia dan Catur Edi Widodo, Interfacing Port Paralel dan Port Serial
[8] Eko Pamuji, Komunikasi Full Duplex dengan Modulasi Frekuensi, Jurusan
[9] http://en.wikipedia.org/wiki/DC_motor
[10] http://focus.ti.com/lit/ds/symlink/l293.pdf
96
LAMPIRAN
RANGKAIAN TELEMETRI BAGIAN PEMANCAR
R4 C6
40
31
1.932 K 2 1uF
4
39 21
EA/VPP
VC C
2 - 38 P0.0/AD0 P2.0/A8 22
6 37 P0.1/AD1 P2.1/A9 23
P0.2/AD2 P2.2/A10
4
3 + R11 R12 VCC = 5V 36 24
U3 R8 2.2 K 2.2 K 35 P0.3/AD3 P2.3/A11 25 1 16
3
VC C
CA3140 10 K 34 P0.4/AD4 P2.4/A12 26 5 AMSI SYMA2 15
R5 33 P0.5/AD5 P2.5/A13 27 TC1 SYMA1 14
8
20
R6 Vee = -5 V P0.7/AD7 P2.7/A15 0.022 uF 6 R16 200
Vcc = 5 V 10 K 9 18 1 10 9 TC2 13
VC C /VR EF
VREF/2 DB0 17 2 P1.0 P3.0/RXD 11 FSKI WAVEA1
1 DB1 16 3 P1.1 P3.1/TXD 12 2
CS DB2 P1.2 P3.2/INTO STO PEMANCAR FM
4
15 4 13 7
2 - DB3 14 5 P1.3 P3.3/INT1 14 TR1
R3 6 6 DB4 13 6 P1.4 P3.4/TO 15 R14 38K 11
46.120K 3 R9 10K +IN DB5 12 7 P1.5 P3.5/T1 16 8 SYNCO
BIAS
GN D
+
DB6 P1.6 P3.6/WR TR2
MO
U4 19 11 C3 8 17
R7 CA3140 CLKR DB7 30 pF P1.7 P3.7/RD R15 22K U7
Vee = -5 V 10 K 4 19 29 XR-2206
8
CLKIN XTAL1 PSEN
10
12
Vee = -5 V 150 pf 18
3
C1 2 11.0592Mhz 9 XTAL2 30
GND
GND
6 Volt Vcc = 5V 3 RD 5 RST ALE/PROG
-IN
GN D
WR INTR R19
4
R2
1
1
R1 2 - 10k C4 C7 50 K
10
6 2 U5 30 pF 1uF Vee -5V
7
8
-
20
SENSOR 2 3 + 6 ADC0804 U6 2
CA3140 3 + C2 VCC AT89S51
U2
U1 CA3140
8
R13 10uF C8
8
10 K 10 uF
3
3
Vcc = 5 V
Vcc = 5 V R17 R18
SW PUSHBUTTON
VCC 12V
SW1
5.1K 5.1K
Title
TELEMETRI KETINGGIAN AIR SEBAGAI PENGATUR MODEL PINTU AIR
L1
VCC = 5V
40
31
39 21
E A /V P P
VC C
38 P0.0/AD0 P2.0/A8 22 VCC = 12V VCC = 12V
37 P0.1/AD1 P2.1/A9 23
36 P0.2/AD2 P2.2/A10 24
35 P0.3/AD3 P2.3/A11 25 2 1 1 16
34 P0.4/AD4 P2.4/A12 26 1,2EN VCC1
33 P0.5/AD5 P2.5/A13 27 LS A 2 15
32 P0.6/AD6 P2.6/A14 28 1A 4A
P0.7/AD7 P2.7/A15 3 14
1Y 4Y
2
1 10
2 P1.0 P3.0/RXD 11 4 13 LS1
3 P1.1 P3.1/TXD 12 GND GND
5 14 4 P1.2 P3.2/INTO 13 MOTOR DC 5 12 BUZZER
LDOQN COMP 1 C6 5 P1.3 P3.3/INT1 14 GND GND
C1 C4 30 pF 6 P1.4 P3.4/TO 15 6 11
2 13 33n 7 P1.5 P3.5/T1 16 2Y 3Y
PENERIMA FM
1
INP NC 8 P1.6 P3.6/WR 17 7 10
3 P1.7 P3.7/RD 2A 3A
2
0.1 u LDF 10 19 29 2 1 8 9
4 TIM R 11.0592Mhz 18 XTAL1 PSEN VCC2 3,4EN
GND C5 9 XTAL2 30 LS B
9 0.1 u RST ALE/PROG U4
GND
6 TIM C2 L293 D
LDO C7 VCC = 12V
30 pF
20
U2
Vcc = 12 V 12 1 3 AT89S51
1 VREF
Vcc R5 10K C8 VCC = 5 V
T IM C 1
10K
LD O
U1
DO
XR-2211 R6 10uF
10 K
11
R4
7
65K
R1 SW PUSHBUTTON
5.1K SW1
R2 R3 VCC 5 V
1.6M 325K
C2 C3 C9
0.66n 2.4n 1uF
16
2 12
VC C
9 V+ R1OUT 14
P1
10 R2OUT T1OUT 1
T2IN
C ON N EC T OR D B9
6
7 2
1 T2OUT 7
3 C+ 8 3
C10 4 C1- R2IN 8
1uf 5 C2+ 4
C2- 13 9
GN D
6 R1IN 11 5
C11 V- T1IN
1uF
15
U3
MAX232
C12
1uF
Title
TELEMETRI KETINGGIAN AIR SEBAGAI PENGATUR MODEL PINTU AIR
L2
PRORAM VISUAL BASIC :
End If
If Asc(a) < 48 Then GoTo nilai
If Asc(a) > 57 Then GoTo nilai
akir:
End Sub
,-----------------------------------------------------------------------------------------------------------
‘Merubah ketinggian air yang akan di atur
‘-----------------------------------------------------------------------------------------------------------
Private Sub atur_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As
Single)
nilai:
L3
masukan.Caption = InputBox("Masukkan nilai ketinggian air sungai yang ingin di atur
(dalam rentang 0 - 20 cm)")
a = masukan.Caption
If Val(a) > 20 Then
MsgBox ("Maaf nilai yang anda masukan melebihi batas. Silahkan ulangi kembali ")
GoTo nilai
End If
If a = "" Then
MsgBox ("Anda belum memasukan nilai ketinggian yang akan diatur. Masukkan nilai
ketinggian air sungai yang ingin anda atur ")
GoTo nilai
End If
If Asc(a) < 48 Then GoTo nilai
If Asc(a) > 57 Then GoTo nilai
End Sub
,-----------------------------------------------------------------------------------------------------------
‘Berpindah kepengaturan manual
‘-----------------------------------------------------------------------------------------------------------
Private Sub manual_Click()
Comm1.Output = "S"
Timer1.Enabled = False
Timer2.Enabled = False
Timer3.Enabled = False
pengatotomatis.Comm1.PortOpen = False
pengaturanmanual.Visible = True
pengatotomatis.Visible = False
pengaturanmanual.Comm1.PortOpen = True
pengaturanmanual.Timera.Enabled = True
pengaturanmanual.Timerb.Enabled = True
pengaturanmanual.Timerc.Enabled = True
End Sub
,-----------------------------------------------------------------------------------------------------------
‘Deklarasi ketinggian air
------------------------------------------------------------------------------------------------------------
Private Sub Timer1_Timer()
Dim tinggi, Text2 As Integer
Dim masuk As String
masuk = Comm1.Input
L4
ElseIf masuk = "%" Then
tinggi = 1
ElseIf masuk = "&" Then
tinggi = 1
ElseIf masuk = "'" Then
tinggi = 1
ElseIf masuk = "(" Then
tinggi = 2
ElseIf masuk = ")" Then
tinggi = 2
ElseIf masuk = "*" Then
tinggi = 2
ElseIf masuk = "+" Then
tinggi = 2
ElseIf masuk = "," Then
tinggi = 3
ElseIf masuk = "-" Then
tinggi = 3
ElseIf masuk = "." Then
tinggi = 3
ElseIf masuk = "/" Then
tinggi = 3
ElseIf masuk = "0" Then
tinggi = 4
ElseIf masuk = "1" Then
tinggi = 4
ElseIf masuk = "2" Then
tinggi = 4
ElseIf masuk = "3" Then
tinggi = 4
ElseIf masuk = "4" Then
tinggi = 5
ElseIf masuk = "5" Then
tinggi = 5
ElseIf masuk = "6" Then
tinggi = 5
ElseIf masuk = "7" Then
tinggi = 5
ElseIf masuk = "8" Then
tinggi = 6
ElseIf masuk = "9" Then
tinggi = 6
ElseIf masuk = ":" Then
tinggi = 6
ElseIf masuk = ";" Then
tinggi = 6
L5
ElseIf masuk = "<" Then
tinggi = 7
ElseIf masuk = "=" Then
tinggi = 7
ElseIf masuk = ">" Then
tinggi = 7
ElseIf masuk = "@" Then
tinggi = 8
ElseIf masuk = "A" Then
tinggi = 8
ElseIf masuk = "B" Then
tinggi = 8
ElseIf masuk = "C" Then
tinggi = 8
ElseIf masuk = "D" Then
tinggi = 9
ElseIf masuk = "E" Then
tinggi = 9
ElseIf masuk = "F" Then
tinggi = 9
ElseIf masuk = "G" Then
tinggi = 9
ElseIf masuk = "H" Then
tinggi = 10
ElseIf masuk = "I" Then
tinggi = 10
ElseIf masuk = "J" Then
tinggi = 10
ElseIf masuk = "K" Then
tinggi = 10
ElseIf masuk = "L" Then
tinggi = 11
ElseIf masuk = "M" Then
tinggi = 11
ElseIf masuk = "N" Then
tinggi = 11
ElseIf masuk = "O" Then
tinggi = 11
ElseIf masuk = "P" Then
tinggi = 12
ElseIf masuk = "Q" Then
tinggi = 12
ElseIf masuk = "R" Then
tinggi = 12
ElseIf masuk = "S" Then
tinggi = 12
L6
ElseIf masuk = "T" Then
tinggi = 13
ElseIf masuk = "U" Then
tinggi = 13
ElseIf masuk = "V" Then
tinggi = 13
ElseIf masuk = "W" Then
tinggi = 13
ElseIf masuk = "X" Then
tinggi = 14
ElseIf masuk = "Y" Then
tinggi = 14
ElseIf masuk = "Z" Then
tinggi = 14
ElseIf masuk = "[" Then
tinggi = 14
ElseIf masuk = "\" Then
tinggi = 15
ElseIf masuk = "]" Then
tinggi = 15
ElseIf masuk = "^" Then
tinggi = 15
ElseIf masuk = "_" Then
tinggi = 15
ElseIf masuk = "`" Then
tinggi = 16
ElseIf masuk = "a" Then
tinggi = 16
ElseIf masuk = "b" Then
tinggi = 16
ElseIf masuk = "c" Then
tinggi = 17
ElseIf masuk = "d" Then
tinggi = 17
ElseIf masuk = "e" Then
tinggi = 17
ElseIf masuk = "f" Then
tinggi = 17
ElseIf masuk = "g" Then
tinggi = 18
ElseIf masuk = "h" Then
tinggi = 18
ElseIf masuk = "i" Then
tinggi = 18
ElseIf masuk = "j" Then
tinggi = 18
L7
ElseIf masuk = "k" Then
tinggi = 19
ElseIf masuk = "l" Then
tinggi = 19
ElseIf masuk = "m" Then
tinggi = 19
ElseIf masuk = "n" Then
tinggi = 19
ElseIf masuk = "o" Then
tinggi = 20
ElseIf masuk = "p" Then
tinggi = 20
ElseIf masuk = "q" Then
tinggi = 20
ElseIf masuk = "r" Then
tinggi = 20
ElseIf masuk = "s" Then
tinggi = 20
ElseIf masuk = "t" Then
tinggi = 20
ElseIf masuk = "u" Then
tinggi = 20
ElseIf masuk = "v" Then
tinggi = 20
ElseIf masuk = "w" Then
tinggi = 20
ElseIf masuk = "x" Then
tinggi = 20
ElseIf masuk = "y" Then
tinggi = 20
End If
sensor.Caption = tinggi
End Sub
,-----------------------------------------------------------------------------------------------------------
‘Pengaturan pintu air
‘-----------------------------------------------------------------------------------------------------------
Private Sub Timer2_Timer()
If Val(sensor.Caption) < Val(masukan.Caption) Then
GoTo buka
If Val(sensor.Caption) > Val(masukan.Caption) Then
GoTo tutup
Else: Comm1.Output = "S"
End If
End If
L8
buka:
If Val(sensor.Caption) < 19 Then
Comm1.Output = "R"
Else
Comm1.Output = "W"
End If
tutup:
If Val(sensor.Caption) < 19 Then
Comm1.Output = "K"
Else
Comm1.Output = "V"
End If
End Sub
,-----------------------------------------------------------------------------------------------------------
‘Pesan pemberitahuan
‘-----------------------------------------------------------------------------------------------------------
Private Sub Timer3_Timer()
Select Case Val(sensor.Caption)
Case Is < 1
report.Visible = True
report.Caption = "SUNGAI KERING"
Case Is < 19
report.Visible = False
Case Is > 18
report.Visible = True
report.Caption = "SUNGAI MELUAP"
End Select
End Sub
,-----------------------------------------------------------------------------------------------------------
‘Membuka data pembuat
‘-----------------------------------------------------------------------------------------------------------
Private Sub penulis_Click()
Tentang.Visible = True
End Sub
,-----------------------------------------------------------------------------------------------------------
‘Membuka penggunaan program
‘-----------------------------------------------------------------------------------------------------------
Private Sub program_Click()
penggunaan.Visible = True
End
End Sub
L9
,-----------------------------------------------------------------------------------------------------------
‘Keluar dari program
‘-----------------------------------------------------------------------------------------------------------
Private Sub KELUAR_Click()
Comm1.Output = "S"
End
End Sub
‘-----------------------------------------------------------------------------------------------------------
L10
,-----------------------------------------------------------------------------------------------------------
‘Menutup pintu air
,-----------------------------------------------------------------------------------------------------------
Private Sub tutup_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As
Single)
Timerc.Enabled = False
If Val(sensor.Caption) < 1 Then
tampil.Caption = "Pintu air tidak bisa di tutup lagi"
Comm1.Output = "S"
ElseIf Val(sensor.Caption) < 18 Then
tampil.Caption = "Pintu air menutup"
Comm1.Output = "K"
ElseIf Val(sensor.Caption) > 18 Then
tampil.Caption = "Pintu air menutup"
Comm1.Output = "V"
End If
End Sub
,-----------------------------------------------------------------------------------------------------------
‘Menutup pintu air selesai
,-----------------------------------------------------------------------------------------------------------
Private Sub tutup_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As
Single)
tampil.Caption = ""
Timerc.Enabled = True
End Sub
,-----------------------------------------------------------------------------------------------------------
‘Pesan pemberitahu
,-----------------------------------------------------------------------------------------------------------
Private Sub Timera_Timer()
sensor.Caption = tinggi
Text1.Text = masuk + Text1.Text
Select Case Val(sensor.Caption)
Case Is < 1
WARNING.Visible = True
WARNING.Caption = "SUNGAI KERING"
Case Is < 19
WARNING.Visible = False
Case Is > 18
WARNING.Visible = True
WARNING.Caption = "SUNGAI MELUAP"
End Select
End Sub
,-----------------------------------------------------------------------------------------------------------
‘Pemantauan keinggian air
,-----------------------------------------------------------------------------------------------------------
L11
Private Sub TimerC_Timer()
If Val(sensor.Caption) > 18 Then
Comm1.Output = "T"
Else
Comm1.Output = "S"
End If
End Sub
,-----------------------------------------------------------------------------------------------------------
‘Deklarasi ketinggian air
,-----------------------------------------------------------------------------------------------------------
Private Sub Timerb_Timer()
Dim tinggi, Text2 As Integer
Dim masuk As String
masuk = Comm1.Input
L12
ElseIf masuk = "1" Then
tinggi = 4
ElseIf masuk = "2" Then
tinggi = 4
ElseIf masuk = "3" Then
tinggi = 4
ElseIf masuk = "4" Then
tinggi = 5
ElseIf masuk = "5" Then
tinggi = 5
ElseIf masuk = "6" Then
tinggi = 5
ElseIf masuk = "7" Then
tinggi = 5
ElseIf masuk = "8" Then
tinggi = 6
ElseIf masuk = "9" Then
tinggi = 6
ElseIf masuk = ":" Then
tinggi = 6
ElseIf masuk = ";" Then
tinggi = 6
ElseIf masuk = "<" Then
tinggi = 7
ElseIf masuk = "=" Then
tinggi = 7
ElseIf masuk = ">" Then
tinggi = 7
ElseIf masuk = "@" Then
tinggi = 8
ElseIf masuk = "A" Then
tinggi = 8
ElseIf masuk = "B" Then
tinggi = 8
ElseIf masuk = "C" Then
tinggi = 8
ElseIf masuk = "D" Then
tinggi = 9
ElseIf masuk = "E" Then
tinggi = 9
ElseIf masuk = "F" Then
tinggi = 9
ElseIf masuk = "G" Then
tinggi = 9
ElseIf masuk = "H" Then
tinggi = 10
L13
ElseIf masuk = "I" Then
tinggi = 10
ElseIf masuk = "J" Then
tinggi = 10
ElseIf masuk = "K" Then
tinggi = 10
ElseIf masuk = "L" Then
tinggi = 11
ElseIf masuk = "M" Then
tinggi = 11
ElseIf masuk = "N" Then
tinggi = 11
ElseIf masuk = "O" Then
tinggi = 11
ElseIf masuk = "P" Then
tinggi = 12
ElseIf masuk = "Q" Then
tinggi = 12
ElseIf masuk = "R" Then
tinggi = 12
ElseIf masuk = "S" Then
tinggi = 12
ElseIf masuk = "T" Then
tinggi = 13
ElseIf masuk = "U" Then
tinggi = 13
ElseIf masuk = "V" Then
tinggi = 13
ElseIf masuk = "W" Then
tinggi = 13
ElseIf masuk = "X" Then
tinggi = 14
ElseIf masuk = "Y" Then
tinggi = 14
ElseIf masuk = "Z" Then
tinggi = 14
ElseIf masuk = "[" Then
tinggi = 14
ElseIf masuk = "\" Then
tinggi = 15
ElseIf masuk = "]" Then
tinggi = 15
ElseIf masuk = "^" Then
tinggi = 15
ElseIf masuk = "_" Then
tinggi = 15
L14
ElseIf masuk = "`" Then
tinggi = 16
ElseIf masuk = "a" Then
tinggi = 16
ElseIf masuk = "b" Then
tinggi = 16
ElseIf masuk = "c" Then
tinggi = 17
ElseIf masuk = "d" Then
tinggi = 17
ElseIf masuk = "e" Then
tinggi = 17
ElseIf masuk = "f" Then
tinggi = 17
ElseIf masuk = "g" Then
tinggi = 18
ElseIf masuk = "h" Then
tinggi = 18
ElseIf masuk = "i" Then
tinggi = 18
ElseIf masuk = "j" Then
tinggi = 18
ElseIf masuk = "k" Then
tinggi = 19
ElseIf masuk = "l" Then
tinggi = 19
ElseIf masuk = "m" Then
tinggi = 19
ElseIf masuk = "n" Then
tinggi = 19
ElseIf masuk = "o" Then
tinggi = 20
ElseIf masuk = "p" Then
tinggi = 20
ElseIf masuk = "q" Then
tinggi = 20
ElseIf masuk = "r" Then
tinggi = 20
ElseIf masuk = "s" Then
tinggi = 20
ElseIf masuk = "t" Then
tinggi = 20
ElseIf masuk = "u" Then
tinggi = 20
ElseIf masuk = "v" Then
tinggi = 20
L15
ElseIf masuk = "w" Then
tinggi = 20
ElseIf masuk = "x" Then
tinggi = 20
ElseIf masuk = "y" Then
tinggi = 20
End If
sensor.Caption = tinggi
End Sub
,-----------------------------------------------------------------------------------------------------------
‘Keluar program
,-----------------------------------------------------------------------------------------------------------
Private Sub KELUAR_Click()
Comm1.Output = "S"
End
End Sub
,-----------------------------------------------------------------------------------------------------------
‘Berganti ke pengaturan otomatis
,-----------------------------------------------------------------------------------------------------------
Private Sub otomatis_Click()
Comm1.Output = "S"
Timera.Enabled = False
Timerb.Enabled = False
Timerc.Enabled = False
pengaturanmanual.Comm1.PortOpen = False
pengaturanmanual.Visible = False
pengatotomatis.Visible = True
pengatotomatis.Comm1.PortOpen = True
pengatotomatis.Timer1.Enabled = True
pengatotomatis.Timer2.Enabled = True
pengatotomatis.Timer3.Enabled = True
End Sub
,-----------------------------------------------------------------------------------------------------------
L16
;AT89S51 MICROCONTROLLER PROGRAM
;***********************************************************************
; PROGRAM PENGUBAH DATA PARAREL KE SERIAL
; TELEMETRI KETINGGIAN AIR SEBAGAI PENGATUR MODEL PINTU AIR
; BERBASIS MIKROKONTROLER AT89S51 DAN PC
;-----------------------------------------------------------------------------------------------------------
;NAMA : BRIATMA KURNIA PUTRA P
;NIM : 025114006
;***********************************************************************
KONVERSI:
MOV R1,#10H ;DEKLARASI KONTROL AWAL DATA DISIMPAN
MOV R2,#16
CLR P2.1 ;AWAL ADC KONVERSI
SETB P2.1
JB P2.0,$ ;AKHIR ADC KONVERSI
BACA:
CLR P2.2 ;BACA ADC
MOV A,P1
SETB P2.2 ;SELESAI BACA ADC
MOV 15H,10H
MOV 16H,11H
MOV 17H,12H
MOV 10H,A
MOV 11H,15H
MOV 12H,16H
MOV 13H,17H
MOV R0,#11H
MOV R1,#3
MOV 20H,#00H
L17
JUMLAH:
ADD A,@R0
JC TEMP
INC R0
DJNZ R1,JUMLAH
SJMP PUTAR
TEMP:
INC 20H
INC R0
DJNZ R1,JUMLAH
SJMP PUTAR
PUTAR: ;PEMBAGIAN 4
CLR C
MOV C,00H
RRC A
CLR C
MOV C,01H
RRC A
SJMP BANDING
L18
JMP KONVERSI
KIRIM61:
MOV A,#3DH
MOV SBUF,A
MOV P0,A
JNB TI,$
CLR TI
JMP KONVERSI
KIRIM:
MOV SBUF,A ;KIRIM DATA SERIAL
MOV P0,A
JNB TI,$ ;TUNGGU TRANSMIT INTERUPT
CLR TI ;NOLKAN TI
JMP KONVERSI
END
L19
;***********************************************************************
; PROGRAM PENGENDALI ARAH PUTARAN MOTOR DC DAN BUZZER
; TELEMETRI KETINGGIAN AIR SEBAGAI PENGATUR MODEL PINTU AIR
; BERBASIS MIKROKONTROLER AT89S51 DAN PC
;-----------------------------------------------------------------------------------------------------------
;NAMA : BRIATMA KURNIA PUTRA P
;NIM : 025114006
;***********************************************************************
ORG 23H
SJMP SERINT
ORG 30H
MAIN:
MOV TMOD,#20H ;TIMER 1 MODE, MODE2
MOV TH1,#-96 ;BAUD RATE 300BPS
MOV SCON,#50H ;PORT SERIAL, MODE 1
MOV P1,#00000000B
SETB TR1
SETB ES ;AKTIFKAN INTERUPSI SERIAL
SETB EA ;AKTIFKAN INTERUPSI
DEAD:
SJMP DEAD
SERINT:
JB RI,RCV_CH ;BILA RECEIVE INETRUPT DITERIMA LOMPAT KE
;RCV_CH
CLR TI ;NOLKAN TI
RETI
RCV_CH:
CLR RI ;INTERUPSI SERIAL PENERIAMAN SIAP
MOV A,SBUF ;PINDAH DATA YANG DI TERIMA KE
;AKUMULATOR
CJNE A,#'K',BANDING2
MOV P1,#00000010b ;JIKA DATA DI TERIMA "K" PUTAR
;MOTOR CW
RETI
L20
BANDING2:
CJNE A,'R',BANDING3
MOV P1,#00000001b ;JIKA DATA DI TERIMA "R" PUTAR
;MOTOR CCW
RETI
BANDING3:
CJNE A,#'S',ALARM
MOV P1,#00000000b ;JIKA DATA DI TERIMA "S" MOTOR
;TIDAK BERPUTAR
RETI
ALARM:
CJNE A,#'T',ALARM2
MOV P1,#00000100b ;JIKA DATA DI TERIMA "T"
;BUNYIKAN BUZZER
RETI
ALARM2:
CJNE A,#'W',ALARM3
MOV P1,#00000101b ;JIKA DATA DITERIMA "W"
;BUNYIKAN BUZZER DAN PUTAR
;MOTOR CCW
RETI
ALARM3:
CJNE A,#'V',STOP
MOV P1,#00000110b ;JIKA DATA DITERIMA "V" BUNYIKAN
;BUZZER DAN PUTAR MOTOR CW
RETI
STOP:
MOV P1,#00000000b ;DATA YANG DITERIMA TAK
;DIKENAL MATIKAN BUZZER DAN
;MOTOR
RETI
END
L21
Telemetri Ketinggian Air Sebagai Pengatur Model Pintu Air
L22
Sensor Ketinggian Air
L23
Rangkaian penerima dihubungkan ke motor DC
L24
CA3140, CA3140A
INV. INPUT 2 7 V+
-
NON-INV. +
3 6 OUTPUT
INPUT
4 OFFSET
V- 5
NULL
1 CAUTION: These devices are sensitive to electrostatic discharge; follow proper IC Handling Procedures.
1-888-INTERSIL or 321-724-7143 | Copyright © Intersil Corporation 1999
CA3140, CA3140A
NOTES:
1. θJA is measured with the component mounted on an evaluation PC board in free air.
2. Short circuit may be applied to ground or to either supply.
TYPICAL VALUES
Input Capacitance CI 4 4 pF
Output Resistance RO 60 60 Ω
Equivalent Input Noise Voltage (See Figure 35) eN RS = 100Ω f = 1kHz 40 40 nV/√Hz
f = 10kHz 12 12 nV/√Hz
IOM- Sink 18 18 mA
Electrical Specifications For Equipment Design, at VSUPPLY = ±15V, TA = 25oC, Unless Otherwise Specified
CA3140 CA3140A
Input Current II - 10 50 - 10 40 pA
2
CA3140, CA3140A
Electrical Specifications For Equipment Design, at VSUPPLY = ±15V, TA = 25oC, Unless Otherwise Specified (Continued)
CA3140 CA3140A
Common Mode Input Voltage Range (See Figure 8) VICR -15 -15.5 to +12.5 11 -15 -15.5 to +12.5 12 V
NOTES:
3. At VO = 26VP-P , +12V, -14V and RL = 2kΩ.
4. At RL = 2kΩ.
TYPICAL VALUES
Input Current II 2 2 pA
Input Resistance RI 1 1 TΩ
Large Signal Voltage Gain (See Figures 6, 29) AOL 100 100 kV/V
100 100 dB
90 90 dB
Common Mode Input Voltage Range (See Figure 8) VICR -0.5 -0.5 V
2.6 2.6 V
Sink I
OM- 1 1 mA
Device Dissipation PD 8 8 mW
Sink Current from Terminal 8 to Terminal 4 to Swing Output Low 200 200 µA
3
CA3140, CA3140A
Block Diagram
2mA 4mA
7 V+
BIAS CIRCUIT
CURRENT SOURCES
AND REGULATOR
12pF
4 V-
5 1 8 STROBE
OFFSET
NULL
Schematic Diagram
BIAS CIRCUIT INPUT STAGE SECOND STAGE OUTPUT STAGE DYNAMIC CURRENT SINK
7 V+
D1 D7
R13
5K
Q3 R9 Q20
Q1 Q2
50Ω
D8
R10
Q4 1K
Q6 Q5 R14
R12 20K
Q19 R11
20Ω 12K
Q7
Q21
Q17
R1
8K Q8 R8
1K Q
18
6 OUTPUT
D2 D3 D4
D5
INVERTING
2
INPUT
- Q9 Q10
+
NON-INVERTING 3
INPUT C1
R2 R3
500Ω 500Ω 12pF
Q14 Q15 Q16
Q13
Q11 Q12 D6
R4 R5 R6 R7
500Ω 500Ω 50Ω 30Ω
5 1 8 4
OFFSET NULL STROBE V-
4
CA3140, CA3140A
Application Information When the CA3140 is operating such that output Terminal 6 is
sinking current to the V- bus, transistor Q16 is the current
Circuit Description
sinking element. Transistor Q16 is mirror connected to D6, R7,
As shown in the block diagram, the input terminals may be with current fed by way of Q21, R12, and Q20. Transistor Q20, in
operated down to 0.5V below the negative supply rail. Two turn, is biased by current flow through R13, zener D8, and R14.
class A amplifier stages provide the voltage gain, and a The dynamic current sink is controlled by voltage level sensing.
unique class AB amplifier stage provides the current gain For purposes of explanation, it is assumed that output Terminal
necessary to drive low-impedance loads. 6 is quiescently established at the potential midpoint between
A biasing circuit provides control of cascoded constant current the V+ and V- supply rails. When output current sinking mode
flow circuits in the first and second stages. The CA3140 operation is required, the collector potential of transistor Q13 is
includes an on chip phase compensating capacitor that is driven below its quiescent level, thereby causing Q17, Q18 to
sufficient for the unity gain voltage follower configuration. decrease the output voltage at Terminal 6. Thus, the gate
terminal of PMOS transistor Q21 is displaced toward the V- bus,
Input Stage
thereby reducing the channel resistance of Q21. As a
The schematic diagram consists of a differential input stage consequence, there is an incremental increase in current flow
using PMOS field-effect transistors (Q9, Q10) working into a through Q20, R12, Q21, D6, R7, and the base of Q16. As a
mirror pair of bipolar transistors (Q11, Q12) functioning as load result, Q16 sinks current from Terminal 6 in direct response to
resistors together with resistors R2 through R5. The mirror pair the incremental change in output voltage caused by Q18. This
transistors also function as a differential-to-single-ended sink current flows regardless of load; any excess current is
converter to provide base current drive to the second stage internally supplied by the emitter-follower Q18. Short circuit
bipolar transistor (Q13). Offset nulling, when desired, can be protection of the output circuit is provided by Q19, which is
effected with a 10kΩ potentiometer connected across driven into conduction by the high voltage drop developed
Terminals 1 and 5 and with its slider arm connected to Terminal across R11 under output short circuit conditions. Under these
4. Cascode-connected bipolar transistors Q2, Q5 are the conditions, the collector of Q19 diverts current from Q4 so as to
constant current source for the input stage. The base biasing reduce the base current drive from Q17, thereby limiting current
circuit for the constant current source is described flow in Q18 to the short circuited load terminal.
subsequently. The small diodes D3, D4, D5 provide gate oxide
protection against high voltage transients, e.g., static electricity. Bias Circuit
Quiescent current in all stages (except the dynamic current
Second Stage
sink) of the CA3140 is dependent upon bias current flow in R1.
Most of the voltage gain in the CA3140 is provided by the
The function of the bias circuit is to establish and maintain
second amplifier stage, consisting of bipolar transistor Q13
constant current flow through D1, Q6, Q8 and D2. D1 is a diode
and its cascode connected load resistance provided by
connected transistor mirror connected in parallel with the base
bipolar transistors Q3, Q4. On-chip phase compensation,
emitter junctions of Q1, Q2, and Q3. D1 may be considered as a
sufficient for a majority of the applications is provided by C1.
current sampling diode that senses the emitter current of Q6
Additional Miller-Effect compensation (roll off) can be
and automatically adjusts the base current of Q6 (via Q1) to
accomplished, when desired, by simply connecting a small
maintain a constant current through Q6, Q8, D2. The base
capacitor between Terminals 1 and 8. Terminal 8 is also
currents in Q2, Q3 are also determined by constant current flow
used to strobe the output stage into quiescence. When
D1. Furthermore, current in diode connected transistor Q2
terminal 8 is tied to the negative supply rail (Terminal 4) by
establishes the currents in transistors Q14 and Q15.
mechanical or electrical means, the output Terminal 6
swings low, i.e., approximately to Terminal 4 potential. Typical Applications
Output Stage Wide dynamic range of input and output characteristics with
The CA3140 Series circuits employ a broad band output stage the most desirable high input impedance characteristics is
that can sink loads to the negative supply to complement the achieved in the CA3140 by the use of an unique design based
capability of the PMOS input stage when operating near the upon the PMOS Bipolar process. Input common mode voltage
negative rail. Quiescent current in the emitter-follower cascade range and output swing capabilities are complementary,
circuit (Q17, Q18) is established by transistors (Q14, Q15) allowing operation with the single supply down to 4V.
whose base currents are “mirrored” to current flowing through
The wide dynamic range of these parameters also means
diode D2 in the bias circuit section. When the CA3140 is
that this device is suitable for many single supply
operating such that output Terminal 6 is sourcing current,
applications, such as, for example, where one input is driven
transistor Q18 functions as an emitter-follower to source current
below the potential of Terminal 4 and the phase sense of the
from the V+ bus (Terminal 7), via D7, R9, and R11. Under these
output signal must be maintained – a most important
conditions, the collector potential of Q13 is sufficiently high to
consideration in comparator applications.
permit the necessary flow of base current to emitter follower
Q17 which, in turn, drives Q18.
5
CA3140, CA3140A
Output Circuit Considerations level shifting circuitry usually associated with the 741 series
Excellent interfacing with TTL circuitry is easily achieved of operational amplifiers.
with a single 6.2V zener diode connected to Terminal 8 as Figure 4 shows some typical configurations. Note that a
shown in Figure 1. This connection assures that the series resistor, RL, is used in both cases to limit the drive
maximum output signal swing will not go more positive than available to the driven device. Moreover, it is recommended
the zener voltage minus two base-to-emitter voltage drops that a series diode and shunt diode be used at the thyristor
within the CA3140. These voltages are independent of the input to prevent large negative transient surges that can
operating supply voltage. appear at the gate of thyristors, from damaging the
integrated circuit.
V+
5V TO 36V
LOGIC Offset Voltage Nulling
7
SUPPLY
2 8 6.2V 5V
The input offset voltage can be nulled by connecting a 10kΩ
potentiometer between Terminals 1 and 5 and returning its
CA3140 6 TYPICAL wiper arm to terminal 4, see Figure 3A. This technique,
TTL GATE
3 ≈ 5V however, gives more adjustment range than required and
4 therefore, a considerable portion of the potentiometer
rotation is not fully utilized. Typical values of series resistors
(R) that may be placed at either end of the potentiometer,
FIGURE 1. ZENER CLAMPING DIODE CONNECTED TO
see Figure 3B, to optimize its utilization range are given in
TERMINALS 8 AND 4 TO LIMIT CA3140 OUTPUT the Electrical Specifications table.
SWING TO TTL LEVELS
An alternate system is shown in Figure 3C. This circuit uses
1000 only one additional resistor of approximately the value
OUTPUT STAGE TRANSISTOR (Q15, Q16)
V+
V+ V+
2 7
2 7 2 7
CA3140 6
CA3140 6 CA3140 6
3 4
3 4 5 3 4
5 1 5
1 R R 1
10kΩ 10kΩ 10kΩ
R
V- V- V-
FIGURE 3A. BASIC FIGURE 3B. IMPROVED RESOLUTION FIGURE 3C. SIMPLER IMPROVED RESOLUTION
FIGURE 3. THREE OFFSET VOLTAGE NULLING METHODS
6
CA3140, CA3140A
RS V+ +HV
7 LOAD
LOAD 2
30V
NO LOAD MT2 CA3140 6
120VAC 7 RL
2
3
CA3140 6 4
MT1
RL
3
4
FIGURE 4. METHODS OF UTILIZING THE VCE(SAT) SINKING CURRENT CAPABILITY OF THE CA3140 SERIES
FOLLOWER
+15V
7
3 0.1µF
SIMULATED
10kΩ LOAD
CA3140 6
2 100pF 2kΩ
4
0.1µF
-15V
2kΩ
LOAD RESISTANCE (RL) = 2kΩ
LOAD CAPACITANCE (CL) = 100pF
0.05µF
SUPPLY VOLTAGE: VS = ±15V
TA = 25oC INVERTING
10 5kΩ
1mV 1mV
8
10mV 10mV +15V
6
7
INPUT VOLTAGE (V)
4 0.1µF
2 SIMULATED
2 5kΩ LOAD
FOLLOWER CA3140 6
0 200Ω
INVERTING
-2 3 100pF 2kΩ
4
-4 0.1µF
4.99kΩ 5.11kΩ
-6 1mV 1mV -15V
-8 10mV 10mV SETTLING POINT
-10 D1 D2
0.1 1.0 10
SETTLING TIME (µs) 1N914 1N914
Bandwidth and Slew Rate are largely due to the high combination of high gain and wide
For those cases where bandwidth reduction is desired, for bandwidth of the CA3140; as shown in Figure 6.
example, broadband noise reduction, an external capacitor Input Circuit Considerations
connected between Terminals 1 and 8 can reduce the open
As mentioned previously, the amplifier inputs can be driven
loop -3dB bandwidth. The slew rate will, however, also be
below the Terminal 4 potential, but a series current limiting
proportionally reduced by using this additional capacitor.
resistor is recommended to limit the maximum input terminal
Thus, a 20% reduction in bandwidth by this technique will
current to less than 1mA to prevent damage to the input
also reduce the slew rate by about 20%.
protection circuitry.
Figure 5 shows the typical settling time required to reach
Moreover, some current limiting resistance should be
1mV or 10mV of the final value for various levels of large
provided between the inverting input and the output when
signal inputs for the voltage follower and inverting unity gain
the CA3140 is used as a unity gain voltage follower. This
amplifiers. The exceptionally fast settling time characteristics
resistance prevents the possibility of extremely large input
7
CA3140, CA3140A
signal transients from forcing a signal through the input differential input voltages that are sustained over long
protection network and directly driving the internal constant periods at elevated temperatures.
current source which could result in positive feedback via the
Both applied voltage and temperature accelerate these
output terminal. A 3.9kΩ resistor is sufficient.
changes. The process is reversible and offset voltage shifts of
The typical input current is on the order of 10pA when the the opposite polarity reverse the offset. Figure 9 shows the
inputs are centered at nominal device dissipation. As the typical offset voltage change as a function of various stress
output supplies load current, device dissipation will increase, voltages at the maximum rating of 125oC (for metal can); at
raising the chip temperature and resulting in increased input lower temperatures (metal can and plastic), for example, at
current. Figure 7 shows typical input terminal current versus 85oC, this change in voltage is considerably less. In typical
ambient temperature for the CA3140. linear applications, where the differential voltage is small and
symmetrical, these incremental changes are of about the
It is well known that MOSFET devices can exhibit slight
same magnitude as those encountered in an operational
changes in characteristics (for example, small changes in
amplifier employing a bipolar transistor input stage.
input offset voltage) due to the application of large
(DEGREES)
OPEN LOOP VOLTAGE GAIN (dB)
RL = 2kΩ,
100 -105
φOL CL = 0pF
-120 1K
10
20
0 1
101 102 103 104 105 106 107 108 -60 -40 -20 0 20 40 60 80 100 120 140
FREQUENCY (Hz) TEMPERATURE (oC)
FIGURE 6. OPEN LOOP VOLTAGE GAIN AND PHASE vs FIGURE 7. INPUT CURRENT vs TEMPERATURE
FREQUENCY
INPUT AND OUTPUT VOLTAGE EXCURSIONS
RL = ∞
0 1.5
-2.0 -0.5
-2.5 -1.0
-3.0 -1.5
0 5 10 15 20 25 0 5 10 15 20 25
SUPPLY VOLTAGE (V+, V-) SUPPLY VOLTAGE (V+, V-)
FIGURE 8. OUTPUT VOLTAGE SWING CAPABILITY AND COMMON MODE INPUT VOLTAGE RANGE vs SUPPLY VOLTAGE
All Intersil semiconductor products are manufactured, assembled and tested under ISO9000 quality systems certification.
Intersil semiconductor products are sold by description only. Intersil Corporation reserves the right to make changes in circuit design and/or specifications at any time with-
out notice. Accordingly, the reader is cautioned to verify that data sheets are current before placing orders. Information furnished by Intersil is believed to be accurate and
reliable. However, no responsibility is assumed by Intersil or its subsidiaries for its use; nor for any infringements of patents or other rights of third parties which may result
from its use. No license is granted by implication or otherwise under any patent or patent rights of Intersil or its subsidiaries.
For information regarding Intersil Corporation and its products, see web site http://www.intersil.com
8
CA3140, CA3140A
9
CA3140, CA3140A
CENTERING
-15V 10kΩ +15V
HIGH
7.5kΩ +15V +15V FREQUENCY
LEVEL 62kΩ 10kΩ
360Ω 0.1 910kΩ
7 µF 7-60pF
3 + 7
15kΩ 5 EXTERNAL
360Ω CA3080A 6 3 + 7
51 OUTPUT
2 - 7-60 CA3140 6 2 -
4 pF
pF 2 - 11kΩ CA3080 6
5 10kΩ 11kΩ 3 +
2MΩ HIGH 4
4 2.7kΩ
SYMMETRY -15V FREQ. 0.1
-15V EXTERNAL
+15V SHAPE -15V µF -15V
OUTPUT 13kΩ TO OUTPUT
2kΩ
100kΩ
AMPLIFIER
FROM BUFFER METER FREQUENCY
DRIVER (OPTIONAL) ADJUSTMENT 5.1kΩ TO
39kΩ 120Ω 10kΩ SINE WAVE
SHAPER 1N914
-15V +15V OUTPUT
AMPLIFIER
THIS NETWORK IS USED WHEN THE
OPTIONAL BUFFER CIRCUIT IS NOT USED
FREQUENCY
ADJUSTMENT
WIDEBAND
LINE DRIVER
SINE WAVE
SHAPER
51Ω
GATE DC LEVEL
FINE SWEEP
SWEEP ADJUST
RATE GENERATOR
OFF INT.
EXTERNAL
COARSE V- EXT. INPUT
RATE
SWEEP
1V/Div., 1s/Div. LENGTH
Three tone test signals, highest frequency ≥0.5MHz. Note the slight V-
asymmetry at the three second/cycle signal. This asymmetry is due to
slightly different positive and negative integration from the CA3080A
and from the PC board and component leakages at the 100pA level.
FIGURE 10C. FUNCTION GENERATOR WITH FIXED FIGURE 10D. INTERCONNECTIONS
FREQUENCIES
FIGURE 10. FUNCTION GENERATOR
10
CA3140, CA3140A
FREQUENCY
500kΩ CALIBRATION
MAXIMUM
FREQUENCY 620kΩ
51kΩ 7
ADJUSTMENT TO CA3080A +15V -15V
10kΩ 3 + OF FUNCTION CA3080A
0.1µF
CA3140 6 GENERATOR
SWEEP IN (FIGURE 10) 7 5.6kΩ
3MΩ 2 - 4.7kΩ 4 3 +
7.5kΩ
5.1kΩ CA3140 6
4 5
TO
+15V 2 - 4 SUBSTRATE WIDEBAND
2kΩ METER 620Ω
0.1µF OF CA3019 OUTPUT
SENSITIVITY
12kΩ ADJUSTMENT 0.1µF AMPLIFIER
1kΩ 7
FREQUENCY 2.4kΩ -15V 10kΩ
CALIBRATION 200µA +15V
M METER R3 10kΩ
MINIMUM EXTERNAL
2.5 100 1MΩ
kΩ 11 OUTPUT
kΩ D1 D4
9 9.1kΩ
510Ω -15V
510Ω 6 5 8 2
R1
8 10 14 10kΩ
2kΩ D3 D6 D2 430Ω
6 12 9 1
METER R2
7 POSITION 3.6kΩ 13 1kΩ
ADJUSTMENT 3 4
3/ OF CA3086 D
5 CA3019 5
-15V DIODE ARRAY
FIGURE 11. METER DRIVER AND BUFFER AMPLIFIER FIGURE 12. SINE WAVE SHAPER
750kΩ
“LOG”
100kΩ
SAWTOOTH 18MΩ
1N914
1MΩ 100kΩ FINE
RATE
22MΩ
470pF 75kΩ
SAWTOOTH 51kΩ
+15V
0.1
µF “LOG”+15V
+15V
7
2 - TRIANGLE 36kΩ 7
CA3140 6 3 - 10kΩ GATE
3 + 100kΩ CA3140 6 PULSE
4 30kΩ OUTPUT
0.1 TO OUTPUT 2 + 4
µF 50kΩ AMPLIFIER
LOG -15V
-15V 10kΩ
RATE
ADJUST EXTERNAL OUTPUT
43kΩ
10kΩ TO FUNCTION GENERATOR “SWEEP IN”
SWEEP WIDTH
-15V
7 +15V
3 +
CA3140 6
2 - 4 51kΩ 6.8kΩ 91kΩ 10kΩ
LOGVIO 5
1 TRIANGLE
25kΩ
5 1
3.9Ω TRANSISTORS SAWTOOTH
4 2 FROM CA3086
-15V ARRAY
100Ω “LOG”
390Ω 3
11
CA3140, CA3140A
Sweeping Generator
Figure 13 shows a sweeping generator. Three CA3140s are FIGURE 15. BASIC SINGLE SUPPLY VOLTAGE REGULATOR
SHOWING VOLTAGE FOLLOWER CONFIGURATION
used in this circuit. One CA3140 is used as an integrator, a
second device is used as a hysteresis switch that Essentially, the regulators, shown in Figures 16 and 17, are
determines the starting and stopping points of the sweep. A connected as non inverting power operational amplifiers with a
third CA3140 is used as a logarithmic shaping network for gain of 3.2. An 8V reference input yields a maximum output
the log function. Rates and slopes, as well as sawtooth, voltage slightly greater than 25V. As a voltage follower, when
triangle, and logarithmic sweeps are generated by this the reference input goes to 0V the output will be 0V. Because
circuit. the offset voltage is also multiplied by the 3.2 gain factor, a
potentiometer is needed to null the offset voltage.
Wideband Output Amplifier
Series pass transistors with high ICBO levels will also
Figure 14 shows a high slew rate, wideband amplifier
prevent the output voltage from reaching zero because there
suitable for use as a 50Ω transmission line driver. This
is a finite voltage drop (VCESAT) across the output of the
circuit, when used in conjunction with the function generator
CA3140 (see Figure 2). This saturation voltage level may
and sine wave shaper circuits shown in Figures 10 and 12
indeed set the lowest voltage obtainable.
provides 18VP-P output open circuited, or 9VP-P output
when terminated in 50Ω. The slew rate required of this The high impedance presented by Terminal 8 is
amplifier is 28V/µs (18VP-P x π x 0.5MHz). advantageous in effecting current limiting. Thus, only a small
+15V signal transistor is required for the current-limit sensing
+ 50µF 2.2 amplifier. Resistive decoupling is provided for this transistor
SIGNAL
LEVEL - 25V kΩ 2N3053
ADJUSTMENT
to minimize damage to it or the CA3140 in the event of
unusual input or output transients on the supply rail.
2.5kΩ 3 + 7 1N914 2.7Ω OUT
51Ω
CA3140 6 Figures 16 and 17, show circuits in which a D2201 high speed
200Ω 1N914 2.7Ω 2W
2 - 4 diode is used for the current sensor. This diode was chosen
8
1 - 50µF for its slightly higher forward voltage drop characteristic, thus
+ 25V 2.2
OUTPUT
kΩ
2N4037 giving greater sensitivity. It must be emphasized that heat
DC LEVEL +15V 2.4pF
ADJUSTMENT 3kΩ 2pF sinking of this diode is essential to minimize variation of the
-15V
current trip point due to internal heating of the diode. That is,
-15V
1.8kΩ NOMINAL BANDWIDTH = 10MHz
1A at 1V forward drop represents one watt which can result in
200Ω tr = 35ns significant regenerative changes in the current trip point as the
diode temperature rises. Placing the small signal reference
amplifier in the proximity of the current sensing diode also
FIGURE 14. WIDEBAND OUTPUT AMPLIFIER helps minimize the variability in the trip level due to the
Power Supplies negative temperature coefficient of the diode. In spite of those
limitations, the current limiting point can easily be adjusted
High input impedance, common mode capability down to the over the range from 10mA to 1A with a single adjustment
negative supply and high output drive current capability are potentiometer. If the temperature stability of the current
key factors in the design of wide range output voltage limiting system is a serious consideration, the more usual
supplies that use a single input voltage to provide a current sampling resistor type of circuitry should be employed.
regulated output voltage that can be adjusted from
A power Darlington transistor (in a metal can with heatsink),
essentially 0V to 24V.
is used as the series pass element for the conventional
Unlike many regulator systems using comparators having a current limiting system, Figure 16, because high power
bipolar transistor input stage, a high impedance reference Darlington dissipation will be encountered at low output
voltage divider from a single supply can be used in voltage and high currents.
connection with the CA3140 (see Figure 15).
12
CA3140, CA3140A
A small heat sink VERSAWATT transistor is used as the regulation also remains constant. Line regulation is 0.1% per
series pass element in the fold back current system, Figure volt. Hum and noise voltage is less than 200µV as read with a
17, since dissipation levels will only approach 10W. In this meter having a 10MHz bandwidth.
system, the D2201 diode is used for current sampling.
Figure 18A shows the turn ON and turn OFF characteristics
Foldback is provided by the 3kΩ and 100kΩ divider network
of both regulators. The slow turn on rise is due to the slow
connected to the base of the current sensing transistor.
rate of rise of the reference voltage. Figure 18B shows the
Both regulators provide better than 0.02% load regulation. transient response of the regulator with the switching of a
Because there is constant loop gain at all voltage settings, the 20Ω load at 20V output.
6 4 CA3086
6 4 CA3086
1kΩ
1kΩ
62kΩ
62kΩ
HUM AND NOISE OUTPUT <200µVRMS LOAD REGULATION
HUM AND NOISE OUTPUT <200µVRMS LOAD REGULATION (MEASUREMENT BANDWIDTH ~10MHz) (NO LOAD TO FULL LOAD)
(MEASUREMENT BANDWIDTH ~10MHz) (NO LOAD TO FULL LOAD) LINE REGULATION 0.1%/V <0.02%
LINE REGULATION 0.1%/V <0.02%
FIGURE 16. REGULATED POWER SUPPLY FIGURE 17. REGULATED POWER SUPPLY WITH “FOLDBACK”
CURRENT LIMITING
13
CA3140, CA3140A
Tone Control Circuits Bass treble boost and cut are ±15dB at 100Hz and 10kHz,
High slew rate, wide bandwidth, high output voltage respectively. Full peak-to-peak output is available up to at
capability and high input impedance are all characteristics least 20kHz due to the high slew rate of the CA3140. The
required of tone control amplifiers. Two tone control circuits amplifier gain is 3dB down from its “flat” position at 70kHz.
that exploit these characteristics of the CA3140 are shown in Figure 19 shows another tone control circuit with similar
Figures 19 and 20. boost and cut specifications. The wideband gain of this
The first circuit, shown in Figure 20, is the Baxandall tone circuit is equal to the ultimate boost or cut plus one, which in
control circuit which provides unity gain at midband and this case is a gain of eleven. For 20dB boost and cut, the
uses standard linear potentiometers. The high input input loading of this circuit is essentially equal to the value of
impedance of the CA3140 makes possible the use of low- the resistance from Terminal No. 3 to ground. A detailed
cost, low-value, small size capacitors, as well as reduced analysis of this circuit is given in “An IC Operational
load of the driving stage. Transconductance Amplifier (OTA) With Power Capability” by
L. Kaplan and H. Wittlinger, IEEE Transactions on Broadcast
and Television Receivers, Vol. BTR-18, No. 3, August, 1972.
FIGURE 19. TONE CONTROL CIRCUIT USING CA3130 SERIES (20dB MIDBAND GAIN)
14
CA3140, CA3140A
15
CA3140, CA3140A
Pulse “droop” during the hold interval is 170pA/200pF which is Current Amplifier
0.85µV/µs; (i.e., 170pA/200pF). In this case, 170pA represents The low input terminal current needed to drive the CA3140
the typical leakage current of the CA3080A when strobed off. If makes it ideal for use in current amplifier applications such
C1 were increased to 2000pF, the “hold-droop” rate will as the one shown in Figure 25 (see Note 14). In this circuit,
decrease to 0.085µV/µs, but the slew rate would decrease to low current is supplied at the input potential as the power
0.25V/µs. The parallel diode network connected between supply to load resistor RL. This load current is increased by
Terminal 3 of the CA3080A and Terminal 6 of the CA3140 the multiplication factor R2/R1, when the load current is
prevents large input signal feedthrough across the input monitored by the power supply meter M. Thus, if the load
terminals of the CA3080A to the 200pF storage capacitor when current is 100nA, with values shown, the load current
the CA3080A is strobed off. Figure 24 shows dynamic presented to the supply will be 100µA; a much easier current
characteristic waveforms of this sample-and-hold system. to measure in many systems.
R1
10kΩ
+15V
R2
IL x 0.1µF
R1
7
3 + R2
M CA3140 6
10MΩ IL
2 - 4
0.1µF
POWER 1
SUPPLY 5 RL
100kΩ
Note that the input and output voltages are transferred at the
same potential and only the output current is multiplied by
the scale factor.
16
CA3140, CA3140A
R2 +15V
5kΩ +15V
0.1µF
10kΩ 7 SIMULATED
R1 0.1µF INPUT LOAD
3 +
2 - 7
10kΩ CA3140 6
CA3140 6
2 -
3 + 1N914 100pF 2kΩ
4 4
5 10kΩ
1
8 R3 0.1µF
PEAK
ADJUST
100kΩ -15V
10kΩ BW (-3dB) = 4.5MHz
OFFSET
SR = 9V/µs
ADJUST 2kΩ
R2 R3
GAIN = ------- = X = ----------------------------- 0.05µF
R1 R1 R2 + R3
2 FIGURE 28A. TEST CIRCUIT
R 3 = ----------------- R 1
X+X
1–X
5kΩ R2
FOR X = 0.5 --------------- = -------
10kΩ R1
OUTPUT
0 Top Trace: Output; 50mV/Div., 200ns/Div.
Bottom Trace: Input; 50mV/Div., 200ns/Div.
INPUT FIGURE 28B. SMALL SIGNAL RESPONSE
0
+15V
0.01µF
RS 7
3 +
1MΩ NOISE VOLTAGE
CA3140 6
OUTPUT
2 -
4
(Measurement made with Tektronix 7A13 differential amplifier.)
30.1kΩ
0.01µF
-15V Top Trace: Output Signal; 5V/Div., 5µs/Div.
Center Trace: Difference Signal; 5mV/Div., 5µs/Div.
BW (-3dB) = 140kHz Bottom Trace: Input Signal; 5V/Div., 5µs/Div.
1kΩ
TOTAL NOISE VOLTAGE
(REFERRED TO INPUT ) = 48µV (TYP)
FIGURE 28C. INPUT-OUTPUT DIFFERENCE SIGNAL SHOWING
SETTLING TIME
FIGURE 27. TEST CIRCUIT AMPLIFIER (30dB GAIN) USED FOR
WIDEBAND NOISE MEASUREMENT FIGURE 28. SPLIT SUPPLY VOLTAGE FOLLOWER TEST
CIRCUIT AND ASSOCIATED WAVEFORMS
17
CA3140, CA3140A
10
TA = -55oC
OPEN-LOOP VOLTAGE GAIN (dB)
25oC 25oC
125
125oC 125oC
TA = -55oC
100
75
50
25
0 1
0 5 10 15 20 25 0 5 10 15 20 25
SUPPLY VOLTAGE (V) SUPPLY VOLTAGE (V)
FIGURE 29. OPEN-LOOP VOLTAGE GAIN vs SUPPLY FIGURE 30. GAIN BANDWIDTH PRODUCT vs SUPPLY
VOLTAGE AND TEMPERATURE VOLTAGE AND TEMPERATURE
RL = 2kΩ RL = ∞
CL = 100pF 7
QUIESCENT SUPPLY CURRENT (mA)
6
TA = -55oC
25oC 5 25oC
125oC
20 TA = -55oC 4 125oC
SLEW RATE (V/µs)
15 3
10 2
5 1
0 0
0 5 10 15 20 25 0 5 10 15 20 25
SUPPLY VOLTAGE (V) SUPPLY VOLTAGE (V)
FIGURE 31. SLEW RATE vs SUPPLY VOLTAGE AND FIGURE 32. QUIESCENT SUPPLY CURRENT vs SUPPLY
TEMPERATURE VOLTAGE AND TEMPERATURE
TA = 25oC TA = 25oC
25 100
OUTPUT SWING (VP-P)
20 80
15 60
10 40
5 20
0 0
10K 100K 1M 4M 101 102 103 104 105 106 107
FREQUENCY (Hz) FREQUENCY (Hz)
FIGURE 33. MAXIMUM OUTPUT VOLTAGE SWING vs FIGURE 34. COMMON MODE REJECTION RATIO vs FREQUENCY
FREQUENCY
18
CA3140, CA3140A
1000
SUPPLY VOLTAGE: VS = ±15V SUPPLY VOLTAGE: VS = ±15V
EQUIVALENT INPUT NOISE VOLTAGE (nV/√Hz)
TA = 25oC TA = 25oC
100
60
10 40 -PSRR
20
POWER SUPPLY REJECTION RATIO
(PSRR) = ∆VIO/∆VS
1 0
1 101 102 103 104 105 101 102 103 104 105 106 107
FREQUENCY (Hz) FREQUENCY (Hz)
FIGURE 35. EQUIVALENT INPUT NOISE VOLTAGE vs FIGURE 36. POWER SUPPLY REJECTION RATIO vs FREQUENCY
FREQUENCY
0 10 20 30 40 50 60 65
61
60
50
40
58-66
30 (1.473-1.676)
20
10
0
4-10
(0.102-0.254)
62-70
(1.575-1.778)
19
ADC0801/ADC0802/ADC0803/ADC0804/ADC0805 8-Bit µP Compatible A/D Converters
November 1999
ADC0801/ADC0802/ADC0803/ADC0804/ADC0805
8-Bit µP Compatible A/D Converters
General Description n Differential analog voltage inputs
n Logic inputs and outputs meet both MOS and TTL
The ADC0801, ADC0802, ADC0803, ADC0804 and
voltage level specifications
ADC0805 are CMOS 8-bit successive approximation A/D
n Works with 2.5V (LM336) voltage reference
converters that use a differential potentiometric
ladder — similar to the 256R products. These converters are n On-chip clock generator
designed to allow operation with the NSC800 and INS8080A n 0V to 5V analog input voltage range with single 5V
derivative control bus with TRI-STATE output latches directly supply
driving the data bus. These A/Ds appear like memory loca- n No zero adjust required
tions or I/O ports to the microprocessor and no interfacing n 0.3" standard width 20-pin DIP package
logic is needed. n 20-pin molded chip carrier or small outline package
Differential analog voltage inputs allow increasing the n Operates ratiometrically or with 5 VDC, 2.5 VDC, or
common-mode rejection and offsetting the analog zero input analog span adjusted voltage reference
voltage value. In addition, the voltage reference input can be
adjusted to allow encoding any smaller analog voltage span Key Specifications
to the full 8 bits of resolution.
n Resolution 8 bits
n Total error ± 1⁄4 LSB, ± 1⁄2 LSB and ± 1 LSB
Features n Conversion time 100 µs
n Compatible with 8080 µP derivatives — no interfacing
logic needed - access time - 135 ns
n Easy interface to all microprocessors, or operates “stand
alone”
Connection Diagram
ADC080X
Dual-In-Line and Small Outline (SO) Packages
DS005671-30
Ordering Information
TEMP RANGE 0˚C TO 70˚C 0˚C TO 70˚C −40˚C TO +85˚C
± 1⁄4 Bit Adjusted ADC0801LCN
ERROR ± 1⁄2 Bit Unadjusted ADC0802LCWM ADC0802LCN
± 1⁄2 Bit Adjusted ADC0803LCN
± 1Bit Unadjusted ADC0804LCWM ADC0804LCN ADC0805LCN/ADC0804LCJ
PACKAGE OUTLINE M20B — Small N20A — Molded DIP
Outline
DS005671-1
8080 Interface
DS005671-31
ADC0804 ± 1 LSB
ADC0805 ± 1 LSB
www.national.com 2
ADC0801/ADC0802/ADC0803/ADC0804/ADC0805
Absolute Maximum Ratings (Notes 1, 2) Infrared (15 seconds) 220˚C
If Military/Aerospace specified devices are required, Storage Temperature Range −65˚C to +150˚C
please contact the National Semiconductor Sales Office/ Package Dissipation at TA =25˚C 875 mW
Distributors for availability and specifications. ESD Susceptibility (Note 10) 800V
Supply Voltage (VCC) (Note 3) 6.5V
Voltage Operating Ratings (Notes 1, 2)
Logic Control Inputs −0.3V to +18V Temperature Range TMIN≤TA≤TMAX
At Other Input and Outputs −0.3V to (VCC+0.3V) ADC0804LCJ −40˚C≤TA≤+85˚C
Lead Temp. (Soldering, 10 seconds) ADC0801/02/03/05LCN −40˚C≤TA≤+85˚C
Dual-In-Line Package (plastic) 260˚C ADC0804LCN 0˚C≤TA≤+70˚C
Dual-In-Line Package (ceramic) 300˚C ADC0802/04LCWM 0˚C≤TA≤+70˚C
Surface Mount Package Range of VCC 4.5 VDC to 6.3 VDC
Vapor Phase (60 seconds) 215˚C
Electrical Characteristics
The following specifications apply for VCC =5 VDC, TMIN≤TA≤TMAX and fCLK =640 kHz unless otherwise specified.
Parameter Conditions Min Typ Max Units
ADC0801: Total Adjusted Error (Note 8) With Full-Scale Adj. ±⁄14 LSB
(See Section 2.5.2)
ADC0802: Total Unadjusted Error (Note 8) VREF/2=2.500 VDC ± 1 ⁄2 LSB
ADC0803: Total Adjusted Error (Note 8) With Full-Scale Adj. ± 1 ⁄2 LSB
(See Section 2.5.2)
ADC0804: Total Unadjusted Error (Note 8) VREF/2=2.500 VDC ±1 LSB
ADC0805: Total Unadjusted Error (Note 8) VREF/2-No Connection ±1 LSB
VREF/2 Input Resistance (Pin 9) ADC0801/02/03/05 2.5 8.0 kΩ
ADC0804 (Note 9) 0.75 1.1 kΩ
Analog Input Voltage Range (Note 4) V(+) or V(−) Gnd–0.05 VCC+0.05 VDC
DC Common-Mode Error Over Analog Input Voltage ± 1/16 ±⁄18 LSB
Range
Power Supply Sensitivity VCC =5 VDC ± 10% Over ± 1/16 ± 1 ⁄8 LSB
Allowed VIN(+) and VIN(−)
Voltage Range (Note 4)
AC Electrical Characteristics
The following specifications apply for VCC =5 VDC and TMIN≤TA≤TMAX unless otherwise specified.
Symbol Parameter Conditions Min Typ Max Units
TC Conversion Time fCLK =640 kHz (Note 6) 103 114 µs
TC Conversion Time (Notes 5, 6) 66 73 1/fCLK
fCLK Clock Frequency VCC =5V, (Note 5) 100 640 1460 kHz
Clock Duty Cycle 40 60 %
CR Conversion Rate in Free-Running INTR tied to WR with 8770 9708 conv/s
Mode CS =0 VDC, fCLK =640 kHz
tW(WR)L Width of WR Input (Start Pulse Width) CS =0 VDC (Note 7) 100 ns
tACC Access Time (Delay from Falling CL =100 pF 135 200 ns
Edge of RD to Output Data Valid)
t1H, t0H TRI-STATE Control (Delay CL =10 pF, RL =10k 125 200 ns
from Rising Edge of RD to (See TRI-STATE Test
Hi-Z State) Circuits)
tWI, tRI Delay from Falling Edge 300 450 ns
of WR or RD to Reset of INTR
CIN Input Capacitance of Logic 5 7.5 pF
Control Inputs
3 www.national.com
ADC0801/ADC0802/ADC0803/ADC0804/ADC0805
AC Electrical Characteristics (Continued)
The following specifications apply for VCC =5 VDC and TMIN≤TA≤TMAX unless otherwise specified.
Symbol Parameter Conditions Min Typ Max Units
COUT TRI-STATE Output 5 7.5 pF
Capacitance (Data Buffers)
CONTROL INPUTS [Note: CLK IN (Pin 4) is the input of a Schmitt trigger circuit and is therefore specified separately]
VIN (1) Logical “1” Input Voltage VCC =5.25 VDC 2.0 15 VDC
(Except Pin 4 CLK IN)
VIN (0) Logical “0” Input Voltage VCC =4.75 VDC 0.8 VDC
(Except Pin 4 CLK IN)
IIN (1) Logical “1” Input Current VIN =5 VDC 0.005 1 µADC
(All Inputs)
IIN (0) Logical “0” Input Current VIN =0 VDC −1 −0.005 µADC
(All Inputs)
CLOCK IN AND CLOCK R
VT+ CLK IN (Pin 4) Positive Going 2.7 3.1 3.5 VDC
Threshold Voltage
VT− CLK IN (Pin 4) Negative 1.5 1.8 2.1 VDC
Going Threshold Voltage
VH CLK IN (Pin 4) Hysteresis 0.6 1.3 2.0 VDC
(VT+)−(VT−)
VOUT (0) Logical “0” CLK R Output IO =360 µA 0.4 VDC
Voltage VCC =4.75 VDC
VOUT (1) Logical “1” CLK R Output IO =−360 µA 2.4 VDC
Voltage VCC =4.75 VDC
DATA OUTPUTS AND INTR
VOUT (0) Logical “0” Output Voltage
Data Outputs IOUT =1.6 mA, VCC =4.75 VDC 0.4 VDC
INTR Output IOUT =1.0 mA, VCC =4.75 VDC 0.4 VDC
VOUT (1) Logical “1” Output Voltage IO =−360 µA, VCC =4.75 VDC 2.4 VDC
VOUT (1) Logical “1” Output Voltage IO =−10 µA, VCC =4.75 VDC 4.5 VDC
IOUT TRI-STATE Disabled Output VOUT =0 VDC −3 µADC
Leakage (All Data Buffers) VOUT =5 VDC 3 µADC
ISOURCE VOUT Short to Gnd, TA =25˚C 4.5 6 mADC
ISINK VOUT Short to VCC, TA =25˚C 9.0 16 mADC
POWER SUPPLY
ICC Supply Current (Includes fCLK =640 kHz,
Ladder Current) VREF/2=NC, TA =25˚C
and CS =5V
ADC0801/02/03/04LCJ/05 1.1 1.8 mA
ADC0804LCN/LCWM 1.9 2.5 mA
Note 1: Absolute Maximum Ratings indicate limits beyond which damage to the device may occur. DC and AC electrical specifications do not apply when operating
the device beyond its specified operating conditions.
Note 2: All voltages are measured with respect to Gnd, unless otherwise specified. The separate A Gnd point should always be wired to the D Gnd.
Note 3: A zener diode exists, internally, from VCC to Gnd and has a typical breakdown voltage of 7 VDC.
Note 4: For VIN(−)≥ VIN(+) the digital output code will be 0000 0000. Two on-chip diodes are tied to each analog input (see block diagram) which will forward conduct
for analog input voltages one diode drop below ground or one diode drop greater than the VCC supply. Be careful, during testing at low VCC levels (4.5V), as high
level analog inputs (5V) can cause this input diode to conduct–especially at elevated temperatures, and cause errors for analog inputs near full-scale. The spec
allows 50 mV forward bias of either diode. This means that as long as the analog VIN does not exceed the supply voltage by more than 50 mV, the output code will
be correct. To achieve an absolute 0 VDC to 5 VDC input voltage range will therefore require a minimum supply voltage of 4.950 VDC over temperature variations,
initial tolerance and loading.
Note 5: Accuracy is guaranteed at fCLK = 640 kHz. At higher clock frequencies accuracy can degrade. For lower clock frequencies, the duty cycle limits can be
extended so long as the minimum clock high time interval or minimum clock low time interval is no less than 275 ns.
Note 6: With an asynchronous start pulse, up to 8 clock periods may be required before the internal clock phases are proper to start the conversion process. The
start request is internally latched, see Figure 4 and section 2.0.
www.national.com 4
ADC0801/ADC0802/ADC0803/ADC0804/ADC0805
AC Electrical Characteristics (Continued)
Note 7: The CS input is assumed to bracket the WR strobe input and therefore timing is dependent on the WR pulse width. An arbitrarily wide pulse width will hold
the converter in a reset mode and the start of conversion is initiated by the low to high transition of the WR pulse (see timing diagrams).
Note 8: None of these A/Ds requires a zero adjust (see section 2.5.1). To obtain zero code at other analog input voltages see section 2.5 and Figure 7.
Note 9: The VREF/2 pin is the center point of a two-resistor divider connected from VCC to ground. In all versions of the ADC0801, ADC0802, ADC0803, and
ADC0805, and in the ADC0804LCJ, each resistor is typically 16 kΩ. In all versions of the ADC0804 except the ADC0804LCJ, each resistor is typically 2.2 kΩ.
Note 10: Human body model, 100 pF discharged through a 1.5 kΩ resistor.
DS005671-38
DS005671-40
DS005671-39
fCLK vs. Clock Capacitor Full-Scale Error vs Effect of Unadjusted Offset Error
Conversion Time vs. VREF/2 Voltage
DS005671-41
DS005671-42 DS005671-43
DS005671-44 DS005671-46
DS005671-45
5 www.national.com
ADC0801/ADC0802/ADC0803/ADC0804/ADC0805
TRI-STATE Test Circuits and Waveforms
t1H t1H, CL =10 pF
DS005671-48
DS005671-47
tr =20 ns
DS005671-50
DS005671-49 tr =20 ns
Timing Diagrams (All timing is measured from the 50% voltage points)
DS005671-51
www.national.com 6
ADC0801/ADC0802/ADC0803/ADC0804/ADC0805
Timing Diagrams (All timing is measured from the 50% voltage points) (Continued)
DS005671-52
Note: Read strobe must occur 8 clock periods (8/fCLK) after assertion of interrupt to guarantee reset of INTR .
Typical Applications
6800 Interface Ratiometeric with Full-Scale Adjust
DS005671-53
DS005671-54
7 www.national.com
ADC0801/ADC0802/ADC0803/ADC0804/ADC0805
Typical Applications (Continued)
DS005671-56
DS005671-55
DS005671-58
DS005671-57
www.national.com 8
ADC0801/ADC0802/ADC0803/ADC0804/ADC0805
Typical Applications (Continued)
DS005671-60
For:
VIN(+) > VIN(−)
Output=FFHEX
For:
VIN(+) < VIN(−)
DS005671-59 Output=00HEX
VREF/2=256 mV
DS005671-61
VREF/2=128 mV
1 LSB=1 mV
VDAC≤VIN≤(VDAC+256 mV)
0 ≤ VDAC < 2.5V
9 www.national.com
ADC0801/ADC0802/ADC0803/ADC0804/ADC0805
Typical Applications (Continued)
DS005671-62
DS005671-64
DS005671-63
www.national.com 10
ADC0801/ADC0802/ADC0803/ADC0804/ADC0805
Typical Applications (Continued)
DS005671-65
DS005671-68
DS005671-67
*VIN(−)=0.15 VCC
15% of VCC≤VXDR≤85% of VCC
DS005671-69
11 www.national.com
ADC0801/ADC0802/ADC0803/ADC0804/ADC0805
Typical Applications (Continued)
DS005671-70
DS005671-71
*Beckman Instruments #694-3-R10K resistor array
DS005671-72
www.national.com 12
ADC0801/ADC0802/ADC0803/ADC0804/ADC0805
Typical Applications (Continued)
DS005671-34
DS005671-33
DS005671-9
DS005671-35
13 www.national.com
ADC0801/ADC0802/ADC0803/ADC0804/ADC0805
Typical Applications (Continued)
DS005671-36
DS005671-37
*LM389 transistors
A, B, C, D = LM324A quad op amp
www.national.com 14
ADC0801/ADC0802/ADC0803/ADC0804/ADC0805
Typical Applications (Continued)
DS005671-73
DS005671-74
DS005671-75
fC =20 Hz
Uses Chebyshev implementation for steeper roll-off unity-gain, 2nd order,
low-pass filter
Adding a separate filter for each channel increases system response time
if an analog multiplexer is used
Output Buffers with A/D Data Enabled Increasing Bus Drive and/or Reducing Time on Bus
DS005671-77
DS005671-76
*Allows output data to set-up at falling edge of CS
*A/D output data is updated 1 CLK period prior to assertion of INTR
15 www.national.com
ADC0801/ADC0802/ADC0803/ADC0804/ADC0805
Typical Applications (Continued)
DS005671-78
Note 11: Oversample whenever possible [keep fs > 2f(−60)] to eliminate input frequency folding (aliasing) and to allow for the skirt response of the filter.
Note 12: Consider the amplitude errors which are introduced within the passband of the filter.
DS005671-79
DS005671-80
Functional Description D−1, D, and D+1. For the perfect A/D, not only will
center-value (A−1, A, A+1, . . . . ) analog inputs produce
the correct output digital codes, but also each riser (the
1.0 UNDERSTANDING A/D ERROR SPECS
transitions between adjacent output codes) will be located
A perfect A/D transfer characteristic (staircase waveform) is ± 1⁄2 LSB away from each center-value. As shown, the risers
shown in Figure 1. The horizontal scale is analog input are ideal and have no width. Correct digital output codes will
voltage and the particular points labeled are in steps of 1 be provided for a range of analog input voltages that extend
LSB (19.53 mV with 2.5V tied to the VREF/2 pin). The digital
output codes that correspond to these inputs are shown as
www.national.com 16
ADC0801/ADC0802/ADC0803/ADC0804/ADC0805
Functional Description (Continued) Next to each transfer function is shown the corresponding
error plot. Many people may be more familiar with error plots
± 1⁄2 LSB from the ideal center-values. Each tread (the range than transfer functions. The analog input voltage to the A/D
of analog input voltage that provides the same digital output is provided by either a linear ramp or by the discrete output
code) is therefore 1 LSB wide. steps of a high resolution DAC. Notice that the error is
Figure 2 shows a worst case error plot for the ADC0801. All continuously displayed and includes the quantization uncer-
center-valued inputs are guaranteed to produce the correct tainty of the A/D. For example the error at point 1 of Figure 1
output codes and the adjacent risers are guaranteed to be is +1⁄2 LSB because the digital code appeared 1⁄2 LSB in
no closer to the center-value points than ± 1⁄4 LSB. In other advance of the center-value of the tread. The error plots
words, if we apply an analog input equal to the center-value always have a constant negative slope and the abrupt up-
± 1⁄4 LSB, we guarantee that the A/D will produce the correct side steps are always 1 LSB in magnitude.
digital code. The maximum range of the position of the code
transition is indicated by the horizontal arrow and it is guar-
anteed to be no more than 1⁄2 LSB.
The error curve of Figure 3 shows a worst case error plot for
the ADC0802. Here we guarantee that if we apply an analog
input equal to the LSB analog voltage center-value the A/D
will produce the correct digital code.
DS005671-81
DS005671-82
DS005671-83
DS005671-84
17 www.national.com
ADC0801/ADC0802/ADC0803/ADC0804/ADC0805
Functional Description (Continued)
DS005671-85
DS005671-86
www.national.com 18
ADC0801/ADC0802/ADC0803/ADC0804/ADC0805
Functional Description (Continued)
DS005671-13
19 www.national.com
ADC0801/ADC0802/ADC0803/ADC0804/ADC0805
Functional Description (Continued)
www.national.com 20
ADC0801/ADC0802/ADC0803/ADC0804/ADC0805
Functional Description (Continued) Notice that the reference voltage for the IC is either 1⁄2 of the
voltage applied to the VCC supply pin, or is equal to the
wire. A 100Ω series resistor can be used to isolate this voltage that is externally forced at the VREF/2 pin. This allows
capacitor — both the R and C are placed outside the feed- for a ratiometric voltage reference using the VCC supply, a 5
back loop — from the output of an op amp, if used. VDC reference voltage can be used for the VCC supply or a
voltage less than 2.5 VDC can be applied to the VREF/2 input
2.3.4 Noise for increased application flexibility. The internal gain to the
The leads to the analog inputs (pins 6 and 7) should be kept VREF/2 input is 2, making the full-scale differential input
as short as possible to minimize input noise coupling. Both voltage twice the voltage at pin 9.
noise and undesired digital clock coupling to these inputs An example of the use of an adjusted reference voltage is to
can cause system errors. The source resistance for these accommodate a reduced span — or dynamic voltage range
inputs should, in general, be kept below 5 kΩ. Larger values of the analog input voltage. If the analog input voltage were
of source resistance can cause undesired system noise to range from 0.5 VDC to 3.5 VDC, instead of 0V to 5 VDC, the
pickup. Input bypass capacitors, placed from the analog span would be 3V as shown in Figure 7. With 0.5 VDC
inputs to ground, will eliminate system noise pickup but can applied to the VIN(−) pin to absorb the offset, the reference
create analog scale errors as these capacitors will average voltage can be made equal to 1⁄2 of the 3V span or 1.5 VDC.
the transient input switching currents of the A/D (see section The A/D now will encode the VIN(+) signal from 0.5V to 3.5 V
2.3.1.). This scale error depends on both a large source with the 0.5V input corresponding to zero and the 3.5 VDC
resistance and the use of an input bypass capacitor. This input corresponding to full-scale. The full 8 bits of resolution
error can be eliminated by doing a full-scale adjustment of are therefore applied over this reduced analog input voltage
the A/D (adjust VREF/2 for a proper full-scale reading — see range.
section 2.5.2 on Full-Scale Adjustment) with the source re-
sistance and input bypass capacitor in place. 2.4.2 Reference Accuracy Requirements
The converter can be operated in a ratiometric mode or an
2.4 Reference Voltage
absolute mode. In ratiometric converter applications, the
2.4.1 Span Adjust magnitude of the reference voltage is a factor in both the
output of the source transducer and the output of the A/D
For maximum applications flexibility, these A/Ds have been converter and therefore cancels out in the final digital output
designed to accommodate a 5 VDC, 2.5 VDC or an adjusted code. The ADC0805 is specified particularly for use in ratio-
voltage reference. This has been achieved in the design of metric applications with no adjustments required. In absolute
the IC as shown in Figure 6. conversion applications, both the initial value and the tem-
perature stability of the reference voltage are important fac-
tors in the accuracy of the A/D converter. For VREF/2 volt-
ages of 2.4 VDC nominal value, initial errors of ± 10 mVDC will
cause conversion errors of ± 1 LSB due to the gain of 2 of the
VREF/2 input. In reduced span applications, the initial value
and the stability of the VREF/2 input voltage become even
more important. For example, if the span is reduced to 2.5V,
the analog input LSB voltage value is correspondingly re-
duced from 20 mV (5V span) to 10 mV and 1 LSB at the
VREF/2 input becomes 5 mV. As can be seen, this reduces
the allowed initial tolerance of the reference voltage and
requires correspondingly less absolute change with tem-
perature variations. Note that spans smaller than 2.5V place
even tighter requirements on the initial accuracy and stability
of the reference source.
In general, the magnitude of the reference voltage will re-
quire an initial adjustment. Errors due to an improper value
of reference voltage appear as full-scale errors in the A/D
transfer function. IC voltage regulators may be used for
references if the ambient temperature changes are not ex-
cessive. The LM336B 2.5V IC reference diode (from Na-
tional Semiconductor) has a temperature stability of 1.8 mV
typ (6 mV max) over 0˚C≤TA≤+70˚C. Other temperature
DS005671-15
FIGURE 6. The VREFERENCE Design on the IC range parts are also available.
21 www.national.com
ADC0801/ADC0802/ADC0803/ADC0804/ADC0805
Functional Description (Continued)
DS005671-87
DS005671-88
www.national.com 22
ADC0801/ADC0802/ADC0803/ADC0804/ADC0805
Functional Description (Continued) (low power Schottky such as the DM74LS240 series is rec-
ommended) or special higher drive current products which
are designed as bus drivers. High current bipolar bus drivers
with PNP inputs are recommended.
23 www.national.com
ADC0801/ADC0802/ADC0803/ADC0804/ADC0805
Functional Description (Continued) For a higher speed test system, or to obtain plotted data, a
digital-to-analog converter is needed for the test set-up. An
accurate 10-bit DAC can serve as the precision voltage
source for the A/D. Errors of the A/D under test can be
expressed as either analog voltages or differences in 2
digital words.
A basic A/D tester that uses a DAC and provides the error as
an analog output voltage is shown in Figure 8. The 2 op
amps can be eliminated if a lab DVM with a numerical
subtraction feature is available to read the difference volt-
age, “A–C”, directly. The analog input voltage can be sup-
plied by a low frequency ramp generator and an X-Y plotter
can be used to provide analog error (Y axis) versus analog
input (X axis).
For operation with a microprocessor or a computer-based
test system, it is more convenient to present the errors
digitally. This can be done with the circuit of Figure 11, where
the output code transitions can be detected as the 10-bit
DAC is incremented. This provides 1⁄4 LSB steps for the 8-bit
A/D under test. If the results of this test are automatically
plotted with the analog input on the X axis and the error (in
LSB’s) as the Y axis, a useful transfer function of the A/D
under test results. For acceptance testing, the plot is not
necessary and the testing speed can be increased by estab-
DS005671-18 lishing internal limits on the allowed error for each code.
FIGURE 9. Basic A/D Tester
4.0 MICROPROCESSOR INTERFACING
To dicuss the interface with 8080A and 6800 microproces-
sors, a common sample subroutine structure is used. The
microprocessor starts the A/D, reads and stores the results
of 16 successive conversions, then returns to the user’s
program. The 16 data bytes are stored in 16 successive
memory locations. All Data and Addresses will be given in
hexadecimal form. Software and hardware details are pro-
vided separately for each type of microprocessor.
www.national.com 24
ADC0801/ADC0802/ADC0803/ADC0804/ADC0805
Functional Description (Continued)
DS005671-89
DS005671-90
OUTPUT VOLTAGE
FRACTIONAL BINARY VALUE FOR CENTER VALUES
HEX BINARY WITH
VREF/2=2.560 VDC
MS GROUP LS GROUP VMS VLS
GROUP GROUP
(Note 15) (Note 15)
F 1 1 1 1 15/16 15/256 4.800 0.300
E 1 1 1 0 7/8 7/128 4.480 0.280
D 1 1 0 1 13/16 13/256 4.160 0.260
C 1 1 0 0 3/4 3/64 3.840 0.240
B 1 0 1 1 11/16 11/256 3.520 0.220
A 1 0 1 0 5/8 5/128 3.200 0.200
9 1 0 0 1 9/16 9/256 2.880 0.180
8 1 0 0 0 1/2 1/32 2.560 0.160
7 0 1 1 1 7/16 7/256 2.240 0.140
6 0 1 1 0 3/8 3/128 1.920 0.120
5 0 1 0 1 5/16 2/256 1.600 0.100
4 0 1 0 0 1/4 1/64 1.280 0.080
3 0 0 1 1 3/16 3/256 0.960 0.060
2 0 0 1 0 1/8 1/128 0.640 0.040
1 0 0 0 1 1/16 1/256 0.320 0.020
0 0 0 0 0 0 0
Note 15: Display Output=VMS Group + VLS Group
25 www.national.com
ADC0801/ADC0802/ADC0803/ADC0804/ADC0805
Functional Description (Continued)
DS005671-20
Note 16: *Pin numbers for the DP8228 system controller, others are INS8080A.
Note 17: Pin 23 of the INS8228 must be tied to +12V through a 1 kΩ resistor to generate the RST 7
instruction when an interrupt is acknowledged as required by the accompanying sample program.
www.national.com 26
ADC0801/ADC0802/ADC0803/ADC0804/ADC0805
Functional Description (Continued)
DS005671-99
Note 18: The stack pointer must be dimensioned because a RST 7 instruction pushes the PC onto the stack.
Note 19: All address used were arbitrarily chosen.
The standard control bus signals of the 8080 CS, RD and It is important to note that in systems where the A/D con-
WR) can be directly wired to the digital control inputs of the verter is 1-of-8 or less I/O mapped devices, no address
A/D and the bus timing requirements are met to allow both decoding circuitry is necessary. Each of the 8 address bits
starting the converter and outputting the data onto the data (A0 to A7) can be directly used as CS inputs — one for each
bus. A bus driver should be used for larger microprocessor I/O device.
systems where the data bus leaves the PC board and/or
must drive capacitive loads larger than 100 pF. 4.1.2 INS8048 Interface
The INS8048 interface technique with the ADC0801 series
4.1.1 Sample 8080A CPU Interfacing Circuitry and (see Figure 13) is simpler than the 8080A CPU interface.
Program There are 24 I/O lines and three test input lines in the 8048.
The following sample program and associated hardware With these extra I/O lines available, one of the I/O lines (bit
shown in Figure 12 may be used to input data from the 0 of port 1) is used as the chip select signal to the A/D, thus
converter to the INS8080A CPU chip set (comprised of the eliminating the use of an external address decoder. Bus
INS8080A microprocessor, the INS8228 system controller control signals RD, WR and INT of the 8048 are tied directly
and the INS8224 clock generator). For simplicity, the A/D is to the A/D. The 16 converted data words are stored at
controlled as an I/O device, specifically an 8-bit bi-directional on-chip RAM locations from 20 to 2F (Hex). The RD and WR
port located at an arbitrarily chosen port address, E0. The signals are generated by reading from and writing into a
TRI-STATE output capability of the A/D eliminates the need dummy address, respectively. A sample interface program is
for a peripheral interface device, however address decoding shown below.
is still required to generate the appropriate CS for the con-
verter.
27 www.national.com
ADC0801/ADC0802/ADC0803/ADC0804/ADC0805
Functional Description (Continued)
DS005671-21
DS005671-A0
www.national.com 28
ADC0801/ADC0802/ADC0803/ADC0804/ADC0805
Functional Description (Continued) already memory mapped in the M6800 system and no CS
decoding is necessary. Also notice that the A/D output data
A15) during I/O input instructions. For example, MUX chan- lines are connected to the microprocessor bus under pro-
nel selection for the A/D can be accomplished with this gram control through the PIA and therefore the A/D RD pin
operating mode. can be grounded.
A sample interface program equivalent to the previous one is
4.3 Interfacing 6800 Microprocessor Derivatives shown below Figure 16. The PIA Data and Control Registers
(6502, etc.) of Port B are located at HEX addresses 8006 and 8007,
The control bus for the 6800 microprocessor derivatives respectively.
does not use the RD and WR strobe signals. Instead it
employs a single R/W line and additional timing, if needed, 5.0 GENERAL APPLICATIONS
can be derived fom the φ2 clock. All I/O devices are memory The following applications show some interesting uses for
mapped in the 6800 system, and a special signal, VMA, the A/D. The fact that one particular microprocessor is used
indicates that the current address is valid. Figure 15 shows is not meant to be restrictive. Each of these application
an interface schematic where the A/D is memory mapped in circuits would have its counterpart using any microprocessor
the 6800 system. For simplicity, the CS decoding is shown that is desired.
using 1⁄2 DM8092. Note that in many 6800 systems, an
already decoded 4/5 line is brought out to the common bus 5.1 Multiple ADC0801 Series to MC6800 CPU Interface
at pin 21. This can be tied directly to the CS pin of the A/D,
To transfer analog data from several channels to a single
provided that no other devices are addressed at HX ADDR:
microprocessor system, a multiple converter scheme pre-
4XXX or 5XXX.
sents several advantages over the conventional multiplexer
The following subroutine performs essentially the same func- single-converter approach. With the ADC0801 series, the
tion as in the case of the 8080A interface and it can be called differential inputs allow individual span adjustment for each
from anywhere in the user’s program. channel. Furthermore, all analog input channels are sensed
In Figure 16 the ADC0801 series is interfaced to the M6800 simultaneously, which essentially divides the microproces-
microprocessor through (the arbitrarily chosen) Port B of the sor’s total system servicing time by the number of channels,
MC6820 or MC6821 Peripheral Interface Adapter, (PIA). since all conversions occur simultaneously. This scheme is
Here the CS pin of the A/D is grounded since the PIA is shown in Figure 17.
DS005671-24
29 www.national.com
ADC0801/ADC0802/ADC0803/ADC0804/ADC0805
Functional Description (Continued)
DS005671-A1
Note 22: In order for the microprocessor to service subroutines and interrupts, the stack pointer must be dimensioned in the user’s program.
DS005671-25
www.national.com 30
ADC0801/ADC0802/ADC0803/ADC0804/ADC0805
Functional Description (Continued)
DS005671-A2
The following schematic and sample subroutine (DATA IN) CPU, starts all the converters simultaneously and waits for
may be used to interface (up to) 8 ADC0801’s directly to the the interrupt signal. Upon receiving the interrupt, it reads the
MC6800 CPU. This scheme can easily be extended to allow converters (from HEX addresses 5000 through 5007) and
the interface of more converters. In this configuration the stores the data successively at (arbitrarily chosen) HEX
converters are (arbitrarily) located at HEX address 5000 in addresses 0200 to 0207, before returning to the user’s pro-
the MC6800 memory space. To save components, the clock gram. All CPU registers then recover the original data they
signal is derived from just one RC pair on the first converter. had before servicing DATA IN.
This output drives the other A/Ds.
All the converters are started simultaneously with a STORE 5.2 Auto-Zeroed Differential Transducer Amplifier
instruction at HEX address 5000. Note that any other HEX and A/D Converter
address of the form 5XXX will be decoded by the circuit, The differential inputs of the ADC0801 series eliminate the
pulling all the CS inputs low. This can easily be avoided by need to perform a differential to single ended conversion for
using a more definitive address decoding scheme. All the a differential transducer. Thus, one op amp can be elimi-
interrupts are ORed together to insure that all A/Ds have nated since the differential to single ended conversion is
completed their conversion before the microprocessor is provided by the differential input of the ADC0801 series. In
interrupted. general, a transducer preamp is required to take advantage
The subroutine, DATA IN, may be called from anywhere in of the full A/D converter input dynamic range.
the user’s program. Once called, this routine initializes the
31 www.national.com
ADC0801/ADC0802/ADC0803/ADC0804/ADC0805
Functional Description (Continued)
DS005671-26
www.national.com 32
ADC0801/ADC0802/ADC0803/ADC0804/ADC0805
Functional Description (Continued)
DS005671-A3
DS005671-A4
Note 25: In order for the microprocessor to service subroutines and interrupts, the stack pointer must be dimensioned in the user’s program.
For amplification of DC input signals, a major system error is where IX is the current through resistor RX. All of the offset
the input offset voltage of the amplifiers used for the preamp. error terms can be cancelled by making ± IXRX = VOS1 +
Figure 18 is a gain of 100 differential preamp whose offset VOS3 − VOS2. This is the principle of this auto-zeroing
voltage errors will be cancelled by a zeroing subroutine scheme.
which is performed by the INS8080A microprocessor sys- The INS8080A uses the 3 I/O ports of an INS8255 Progra-
tem. The total allowable input offset voltage error for this mable Peripheral Interface (PPI) to control the auto zeroing
preamp is only 50 µV for 1⁄4 LSB error. This would obviously and input data from the ADC0801 as shown in Figure 19.
require very precise amplifiers. The expression for the differ- The PPI is programmed for basic I/O operation (mode 0) with
ential output voltage of the preamp is: Port A being an input port and Ports B and C being output
ports. Two bits of Port C are used to alternately open or close
the 2 switches at the input of the preamp. Switch SW1 is
closed to force the preamp’s differential input to be zero
during the zeroing subroutine and then opened and SW2 is
then closed for conversion of the actual differential input
signal. Using 2 switches in this manner eliminates concern
for the ON resistance of the switches as they must conduct
only the input bias current of the input amplifiers.
Output Port B is used as a successive approximation regis-
ter by the 8080 and the binary scaled resistors in series with
each output bit create a D/A converter. During the zeroing
subroutine, the voltage at Vx increases or decreases as
required to make the differential output voltage equal to zero.
This is accomplished by ensuring that the voltage at the
output of A1 is approximately 2.5V so that a logic “1” (5V) on
33 www.national.com
ADC0801/ADC0802/ADC0803/ADC0804/ADC0805
Functional Description (Continued) the ADC0801. It is important that the voltage levels that drive
the auto-zero resistors be constant. Also, for symmetry, a
any output of Port B will source current into node VX thus logic swing of 0V to 5V is convenient. To achieve this, a
raising the voltage at VX and making the output differential CMOS buffer is used for the logic output signals of Port B
more negative. Conversely, a logic “0” (0V) will pull current and this CMOS package is powered with a stable 5V source.
out of node VX and decrease the voltage, causing the differ- Buffer amplifier A1 is necessary so that it can source or sink
ential output to become more positive. For the resistor val- the D/A output current.
ues shown, VX can move ± 12 mV with a resolution of 50 µV,
which will null the offset error term to 1⁄4 LSB of full-scale for
DS005671-91
www.national.com 34
ADC0801/ADC0802/ADC0803/ADC0804/ADC0805
Functional Description (Continued)
DS005671-92
35 www.national.com
ADC0801/ADC0802/ADC0803/ADC0804/ADC0805
Functional Description (Continued)
DS005671-28
www.national.com 36
ADC0801/ADC0802/ADC0803/ADC0804/ADC0805
Functional Description (Continued)
DS005671-A5
37 www.national.com
ADC0801/ADC0802/ADC0803/ADC0804/ADC0805
Functional Description (Continued) HEX PORT ADDRESS PERIPHERAL
04 A/D 4
HEX PORT ADDRESS PERIPHERAL 05 A/D 5
00 MM74C374 8-bit flip-flop 06 A/D 6
01 A/D 1 07 A/D 7
02 A/D 2 This port address also serves as the A/D identifying word in
03 A/D 3 the program.
DS005671-29
www.national.com 38
ADC0801/ADC0802/ADC0803/ADC0804/ADC0805
Functional Description (Continued)
DS005671-A6
39 www.national.com
ADC0801/ADC0802/ADC0803/ADC0804/ADC0805
Physical Dimensions inches (millimeters) unless otherwise noted
SO Package (M)
Order Number ADC0802LCWM or ADC0804LCWM
NS Package Number M20B
www.national.com 40
ADC0801/ADC0802/ADC0803/ADC0804/ADC0805 8-Bit µP Compatible A/D Converters
Notes
National does not assume any responsibility for use of any circuitry described, no circuit patent licenses are implied and National reserves the right at any time without notice to change said circuitry and specifications.
Features
• Compatible with MCS-51® Products
• 4K Bytes of In-System Programmable (ISP) Flash Memory
– Endurance: 1000 Write/Erase Cycles
• 4.0V to 5.5V Operating Range
• Fully Static Operation: 0 Hz to 33 MHz
• Three-level Program Memory Lock
• 128 x 8-bit Internal RAM
• 32 Programmable I/O Lines
• Two 16-bit Timer/Counters
•
•
Six Interrupt Sources
Full Duplex UART Serial Channel
8-bit
•
•
Low-power Idle and Power-down Modes
Interrupt Recovery from Power-down Mode
Microcontroller
• Watchdog Timer
• Dual Data Pointer with 4K Bytes
• Power-off Flag
• Fast Programming Time In-System
• Flexible ISP Programming (Byte and Page Mode)
Programmable
Description Flash
The AT89S51 is a low-power, high-performance CMOS 8-bit microcontroller with 4K
bytes of in-system programmable Flash memory. The device is manufactured using
Atmel’s high-density nonvolatile memory technology and is compatible with the indus-
try-standard 80C51 instruction set and pinout. The on-chip Flash allows the program
AT89S51
memory to be reprogrammed in-system or by a conventional nonvolatile memory pro-
grammer. By combining a versatile 8-bit CPU with in-system programmable Flash on a
monolithic chip, the Atmel AT89S51 is a powerful microcontroller which provides a
highly-flexible and cost-effective solution to many embedded control applications.
The AT89S51 provides the following standard features: 4K bytes of Flash, 128 bytes of
RAM, 32 I/O lines, Watchdog timer, two data pointers, two 16-bit timer/counters, a five-
vector two-level interrupt architecture, a full duplex serial port, on-chip oscillator, and
clock circuitry. In addition, the AT89S51 is designed with static logic for operation
down to zero frequency and supports two software selectable power saving modes.
The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port, and
interrupt system to continue functioning. The Power-down mode saves the RAM con-
tents but freezes the oscillator, disabling all other chip functions until the next external
interrupt or hardware reset.
Rev. 2487A–10/01
1
Pin Configurations
PDIP PLCC
P0.0 (AD0)
P0.1 (AD1)
P0.2 (AD2)
P0.3 (AD3)
P1.0 1 40 VCC
VCC
P1.4
P1.3
P1.2
P1.1
P1.0
NC
P1.1 2 39 P0.0 (AD0)
P1.2 3 38 P0.1 (AD1)
6
5
4
3
2
1
44
43
42
41
40
P1.3 4 37 P0.2 (AD2)
P1.4 5 36 P0.3 (AD3) (MOSI) P1.5 7 39 P0.4 (AD4)
(MOSI) P1.5 6 35 P0.4 (AD4) (MISO) P1.6 8 38 P0.5 (AD5)
(MISO) P1.6 7 34 P0.5 (AD5) (SCK) P1.7 9 37 P0.6 (AD6)
(SCK) P1.7 8 33 P0.6 (AD6) RST 10 36 P0.7 (AD7)
RST 9 32 P0.7 (AD7) (RXD) P3.0 11 35 EA/VPP
(RXD) P3.0 10 31 EA/VPP NC 12 34 NC
(TXD) P3.1 11 30 ALE/PROG (TXD) P3.1 13 33 ALE/PROG
(INT0) P3.2 12 29 PSEN (INT0) P3.2 14 32 PSEN
(INT1) P3.3 13 28 P2.7 (A15) (INT1) P3.3 15 31 P2.7 (A15)
(T0) P3.4 14 27 P2.6 (A14) (T0) P3.4 16 30 P2.6 (A14)
(T1) P3.5 15 26 P2.5 (A13) (T1) P3.5 17 29 P2.5 (A13)
18
19
20
21
22
23
24
25
26
27
28
(WR) P3.6 16 25 P2.4 (A12)
(RD) P3.7 17 24 P2.3 (A11)
(WR) P3.6
(RD) P3.7
XTAL2
XTAL1
GND
NC
(A8) P2.0
(A9) P2.1
(A10) P2.2
(A11) P2.3
(A12) P2.4
XTAL2 18 23 P2.2 (A10)
XTAL1 19 22 P2.1 (A9)
GND 20 21 P2.0 (A8)
TQFP
P0.0 (AD0)
P0.1 (AD1)
P0.2 (AD2)
P0.3 (AD3)
VCC
P1.4
P1.3
P1.2
P1.1
P1.0
NC
44
43
42
41
40
39
38
37
36
35
34
2 AT89S51
2487A–10/01
AT89S51
Block Diagram
P0.0 - P0.7 P2.0 - P2.7
VCC
PORT 0 DRIVERS PORT 2 DRIVERS
GND
PROGRAM
B STACK ADDRESS
REGISTER ACC POINTER REGISTER
BUFFER
TMP2 TMP1
PC
ALU INCREMENTER
PROGRAM
PSW COUNTER
PSEN
ALE/PROG TIMING INSTRUCTION
AND REGISTER DUAL DPTR
EA / VPP CONTROL
RST
OSC
PORT 3 DRIVERS PORT 1 DRIVERS
3
2487A–10/01
Pin Description
GND Ground.
Port 0 Port 0 is an 8-bit open drain bidirectional I/O port. As an output port, each pin can sink eight
TTL inputs. When 1s are written to port 0 pins, the pins can be used as high-impedance
inputs.
Port 0 can also be configured to be the multiplexed low-order address/data bus during
accesses to external program and data memory. In this mode, P0 has internal pull-ups.
Port 0 also receives the code bytes during Flash programming and outputs the code bytes
during program verification. External pull-ups are required during program verification.
Port 1 Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 1 output buffers can
sink/source four TTL inputs. When 1s are written to Port 1 pins, they are pulled high by the
internal pull-ups and can be used as inputs. As inputs, Port 1 pins that are externally being
pulled low will source current (IIL) because of the internal pull-ups.
Port 1 also receives the low-order address bytes during Flash programming and verification.
Port 2 Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 2 output buffers can
sink/source four TTL inputs. When 1s are written to Port 2 pins, they are pulled high by the
internal pull-ups and can be used as inputs. As inputs, Port 2 pins that are externally being
pulled low will source current (IIL) because of the internal pull-ups.
Port 2 emits the high-order address byte during fetches from external program memory and
during accesses to external data memory that use 16-bit addresses (MOVX @ DPTR). In this
application, Port 2 uses strong internal pull-ups when emitting 1s. During accesses to external
data memory that use 8-bit addresses (MOVX @ RI), Port 2 emits the contents of the P2 Spe-
cial Function Register.
Port 2 also receives the high-order address bits and some control signals during Flash pro-
gramming and verification.
Port 3 Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 3 output buffers can
sink/source four TTL inputs. When 1s are written to Port 3 pins, they are pulled high by the
internal pull-ups and can be used as inputs. As inputs, Port 3 pins that are externally being
pulled low will source current (IIL) because of the pull-ups.
Port 3 receives some control signals for Flash programming and verification.
Port 3 also serves the functions of various special features of the AT89S51, as shown in the
following table.
4 AT89S51
2487A–10/01
AT89S51
RST Reset input. A high on this pin for two machine cycles while the oscillator is running resets the
device. This pin drives High for 98 oscillator periods after the Watchdog times out. The DIS-
RTO bit in SFR AUXR (address 8EH) can be used to disable this feature. In the default state
of bit DISRTO, the RESET HIGH out feature is enabled.
ALE/PROG Address Latch Enable (ALE) is an output pulse for latching the low byte of the address during
accesses to external memory. This pin is also the program pulse input (PROG) during Flash
programming.
In normal operation, ALE is emitted at a constant rate of 1/6 the oscillator frequency and may
be used for external timing or clocking purposes. Note, however, that one ALE pulse is
skipped during each access to external data memory.
If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit set,
ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is weakly pulled
high. Setting the ALE-disable bit has no effect if the microcontroller is in external execution
mode.
PSEN Program Store Enable (PSEN) is the read strobe to external program memory.
When the AT89S51 is executing code from external program memory, PSEN is activated
twice each machine cycle, except that two PSEN activations are skipped during each access
to external data memory.
EA/VPP External Access Enable. EA must be strapped to GND in order to enable the device to fetch
code from external program memory locations starting at 0000H up to FFFFH. Note, however,
that if lock bit 1 is programmed, EA will be internally latched on reset.
EA should be strapped to VCC for internal program executions.
This pin also receives the 12-volt programming enable voltage (V PP ) during Flash
programming.
XTAL1 Input to the inverting oscillator amplifier and input to the internal clock operating circuit.
5
2487A–10/01
Special A map of the on-chip memory area called the Special Function Register (SFR) space is shown
Function in Table 1.
Registers Note that not all of the addresses are occupied, and unoccupied addresses may not be imple-
mented on the chip. Read accesses to these addresses will in general return random data,
and write accesses will have an indeterminate effect.
0F8H 0FFH
B
0F0H 0F7H
00000000
0E8H 0EFH
ACC
0E0H 0E7H
00000000
0D8H 0DFH
PSW
0D0H 0D7H
00000000
0C8H 0CFH
0C0H 0C7H
IP
0B8H 0BFH
XX000000
P3
0B0H 0B7H
11111111
IE
0A8H 0AFH
0X000000
P2 AUXR1 WDTRST
0A0H 0A7H
11111111 XXXXXXX0 XXXXXXXX
SCON SBUF
98H 9FH
00000000 XXXXXXXX
P1
90H 97H
11111111
6 AT89S51
2487A–10/01
AT89S51
User software should not write 1s to these unlisted locations, since they may be used in future
products to invoke new features. In that case, the reset or inactive values of the new bits will
always be 0.
Interrupt Registers: The individual interrupt enable bits are in the IE register. Two priorities
can be set for each of the five interrupt sources in the IP register.
Dual Data Pointer Registers: To facilitate accessing both internal and external data memory,
two banks of 16-bit Data Pointer Registers are provided: DP0 at SFR address locations 82H-
83H and DP1 at 84H-85H. Bit DPS = 0 in SFR AUXR1 selects DP0 and DPS = 1 selects DP1.
The user should always initialize the DPS bit to the appropriate value before accessing the
respective Data Pointer Register.
7
2487A–10/01
Power Off Flag: The Power Off Flag (POF) is located at bit 4 (PCON.4) in the PCON SFR.
POF is set to “1” during power up. It can be set and rest under software control and is not
affected by reset.
Memory MCS-51 devices have a separate address space for Program and Data Memory. Up to 64K
bytes each of external Program and Data Memory can be addressed.
Organization
Program Memory If the EA pin is connected to GND, all program fetches are directed to external memory.
On the AT89S51, if EA is connected to VCC, program fetches to addresses 0000H through
FFFH are directed to internal memory and fetches to addresses 1000H through FFFFH are
directed to external memory.
Data Memory The AT89S51 implements 128 bytes of on-chip RAM. The 128 bytes are accessible via direct
and indirect addressing modes. Stack operations are examples of indirect addressing, so the
128 bytes of data RAM are available as stack space.
Watchdog The WDT is intended as a recovery method in situations where the CPU may be subjected to
software upsets. The WDT consists of a 14-bit counter and the Watchdog Timer Reset
Timer
(WDTRST) SFR. The WDT is defaulted to disable from exiting reset. To enable the WDT, a
(One-time user must write 01EH and 0E1H in sequence to the WDTRST register (SFR location 0A6H).
Enabled with When the WDT is enabled, it will increment every machine cycle while the oscillator is running.
The WDT timeout period is dependent on the external clock frequency. There is no way to dis-
Reset-out) able the WDT except through reset (either hardware reset or WDT overflow reset). When
WDT overflows, it will drive an output RESET HIGH pulse at the RST pin.
Using the WDT To enable the WDT, a user must write 01EH and 0E1H in sequence to the WDTRST register
(SFR location 0A6H). When the WDT is enabled, the user needs to service it by writing 01EH
and 0E1H to WDTRST to avoid a WDT overflow. The 14-bit counter overflows when it reaches
16383 (3FFFH), and this will reset the device. When the WDT is enabled, it will increment
every machine cycle while the oscillator is running. This means the user must reset the WDT
at least every 16383 machine cycles. To reset the WDT the user must write 01EH and 0E1H
to WDTRST. WDTRST is a write-only register. The WDT counter cannot be read or written.
When WDT overflows, it will generate an output RESET pulse at the RST pin. The RESET
pulse duration is 98xTOSC, where TOSC=1/FOSC. To make the best use of the WDT, it
8 AT89S51
2487A–10/01
AT89S51
should be serviced in those sections of code that will periodically be executed within the time
required to prevent a WDT reset.
WDT During In Power-down mode the oscillator stops, which means the WDT also stops. While in Power-
down mode, the user does not need to service the WDT. There are two methods of exiting
Power-down
Power-down mode: by a hardware reset or via a level-activated external interrupt, which is
and Idle enabled prior to entering Power-down mode. When Power-down is exited with hardware reset,
servicing the WDT should occur as it normally does whenever the AT89S51 is reset. Exiting
Power-down with an interrupt is significantly different. The interrupt is held low long enough for
the oscillator to stabilize. When the interrupt is brought high, the interrupt is serviced. To pre-
vent the WDT from resetting the device while the interrupt pin is held low, the WDT is not
started until the interrupt is pulled high. It is suggested that the WDT be reset during the inter-
rupt service for the interrupt used to exit Power-down mode.
To ensure that the WDT does not overflow within a few states of exiting Power-down, it is best
to reset the WDT just before entering Power-down mode.
Before going into the IDLE mode, the WDIDLE bit in SFR AUXR is used to determine whether
the WDT continues to count if enabled. The WDT keeps counting during IDLE (WDIDLE bit =
0) as the default state. To prevent the WDT from resetting the AT89S51 while in IDLE mode,
the user should always set up a timer that will periodically exit IDLE, service the WDT, and
reenter IDLE mode.
With WDIDLE bit enabled, the WDT will stop to count in IDLE mode and resumes the count
upon exit from IDLE.
UART The UART in the AT89S51 operates the same way as the UART in the AT89C51. For further
information on the UART operation, refer to the ATMEL Web site (http://www.atmel.com).
From the home page, select ‘Products’, then ‘8051-Architecture Flash Microcontroller’, then
‘Product Overview’.
Timer 0 and 1 Timer 0 and Timer 1 in the AT89S51 operate the same way as Timer 0 and Timer 1 in the
AT89C51. For further information on the timers’ operation, refer to the ATMEL Web site
(http://www.atmel.com). From the home page, select ‘Products’, then ‘8051-Architecture Flash
Microcontroller’, then ‘Product Overview’.
Interrupts The AT89S51 has a total of five interrupt vectors: two external interrupts (INT0 and INT1), two
timer interrupts (Timers 0 and 1), and the serial port interrupt. These interrupts are all shown in
Figure 1.
Each of these interrupt sources can be individually enabled or disabled by setting or clearing a
bit in Special Function Register IE. IE also contains a global disable bit, EA, which disables all
interrupts at once.
Note that Table 4 shows that bit position IE.6 is unimplemented. In the AT89S51, bit position
IE.5 is also unimplemented. User software should not write 1s to these bit positions, since they
may be used in future AT89 products.
The Timer 0 and Timer 1 flags, TF0 and TF1, are set at S5P2 of the cycle in which the timers
overflow. The values are then polled by the circuitry in the next cycle
9
2487A–10/01
.
0
INT0 IE0
1
TF0
0
INT1 IE1
1
TF1
TI
RI
10 AT89S51
2487A–10/01
AT89S51
Oscillator XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier that can be
Characteristics configured for use as an on-chip oscillator, as shown in Figure 2. Either a quartz crystal or
ceramic resonator may be used. To drive the device from an external clock source, XTAL2
should be left unconnected while XTAL1 is driven, as shown in Figure 3. There are no require-
ments on the duty cycle of the external clock signal, since the input to the internal clocking
circuitry is through a divide-by-two flip-flop, but minimum and maximum voltage high and low
time specifications must be observed.
C1
XTAL1
GND
NC XTAL2
EXTERNAL
OSCILLATOR XTAL1
SIGNAL
GND
Idle Mode In idle mode, the CPU puts itself to sleep while all the on-chip peripherals remain active. The
mode is invoked by software. The content of the on-chip RAM and all the special function
registers remain unchanged during this mode. The idle mode can be terminated by any
enabled interrupt or by a hardware reset.
Note that when idle mode is terminated by a hardware reset, the device normally resumes pro-
gram execution from where it left off, up to two machine cycles before the internal reset
algorithm takes control. On-chip hardware inhibits access to internal RAM in this event, but
access to the port pins is not inhibited. To eliminate the possibility of an unexpected write to a
port pin when idle mode is terminated by a reset, the instruction following the one that invokes
idle mode should not write to a port pin or to external memory.
Power-down In the Power-down mode, the oscillator is stopped, and the instruction that invokes Power-
Mode down is the last instruction executed. The on-chip RAM and Special Function Registers retain
their values until the Power-down mode is terminated. Exit from Power-down mode can be ini-
tiated either by a hardware reset or by activation of an enabled external interrupt into INT0 or
INT1. Reset redefines the SFRs but does not change the on-chip RAM. The reset should not
be activated before VCC is restored to its normal operating level and must be held active long
enough to allow the oscillator to restart and stabilize.
11
2487A–10/01
Table 5. Status of External Pins During Idle and Power-down Modes
Mode Program Memory ALE PSEN PORT0 PORT1 PORT2 PORT3
Idle Internal 1 1 Data Data Data Data
Idle External 1 1 Float Data Address Data
Power-down Internal 0 0 Data Data Data Data
Power-down External 0 0 Float Data Data Data
Program The AT89S51 has three lock bits that can be left unprogrammed (U) or can be programmed
Memory Lock (P) to obtain the additional features listed in the following table.
When lock bit 1 is programmed, the logic level at the EA pin is sampled and latched during
reset. If the device is powered up without a reset, the latch initializes to a random value and
holds that value until reset is activated. The latched value of EA must agree with the current
logic level at that pin in order for the device to function properly.
Programming The AT89S51 is shipped with the on-chip Flash memory array ready to be programmed. The
programming interface needs a high-voltage (12-volt) program enable signal and is compati-
the Flash –
ble with conventional third-party Flash or EPROM programmers.
Parallel Mode
The AT89S51 code memory array is programmed byte-by-byte.
Programming Algorithm: Before programming the AT89S51, the address, data, and control
signals should be set up according to the Flash programming mode table and Figures 13 and
14. To program the AT89S51, take the following steps:
1. Input the desired memory location on the address lines.
2. Input the appropriate data byte on the data lines.
3. Activate the correct combination of control signals.
4. Raise EA/VPP to 12V.
5. Pulse ALE/PROG once to program a byte in the Flash array or the lock bits. The byte-
write cycle is self-timed and typically takes no more than 50 µs. Repeat steps 1
through 5, changing the address and data for the entire array or until the end of the
object file is reached.
Data Polling: The AT89S51 features Data Polling to indicate the end of a byte write cycle.
During a write cycle, an attempted read of the last byte written will result in the complement of
the written data on P0.7. Once the write cycle has been completed, true data is valid on all out-
puts, and the next cycle may begin. Data Polling may begin any time after a write cycle has
been initiated.
12 AT89S51
2487A–10/01
AT89S51
Ready/Busy: The progress of byte programming can also be monitored by the RDY/BSY out-
put signal. P3.0 is pulled low after ALE goes high during programming to indicate BUSY. P3.0
is pulled high again when programming is done to indicate READY.
Program Verify: If lock bits LB1 and LB2 have not been programmed, the programmed code
data can be read back via the address and data lines for verification. The status of the individ-
ual lock bits can be verified directly by reading them back.
Reading the Signature Bytes: The signature bytes are read by the same procedure as a nor-
mal verification of locations 000H, 100H, and 200H, except that P3.6 and P3.7 must be pulled
to a logic low. The values returned are as follows.
(000H) = 1EH indicates manufactured by Atmel
(100H) = 51H indicates 89S51
(200H) = 06H
Chip Erase: In the parallel programming mode, a chip erase operation is initiated by using the
proper combination of control signals and by pulsing ALE/PROG low for a duration of 200 ns -
500 ns.
In the serial programming mode, a chip erase operation is initiated by issuing the Chip Erase
instruction. In this mode, chip erase is self-timed and takes about 500 ms.
During chip erase, a serial read from any address location will return 00H at the data output.
Programming The Code memory array can be programmed using the serial ISP interface while RST is
pulled to VCC. The serial interface consists of pins SCK, MOSI (input) and MISO (output). After
the Flash –
RST is set high, the Programming Enable instruction needs to be executed first before other
Serial Mode operations can be executed. Before a reprogramming sequence can occur, a Chip Erase
operation is required.
The Chip Erase operation turns the content of every memory location in the Code array into
FFH.
Either an external system clock can be supplied at pin XTAL1 or a crystal needs to be con-
nected across pins XTAL1 and XTAL2. The maximum serial clock (SCK) frequency should be
less than 1/16 of the crystal frequency. With a 33 MHz oscillator clock, the maximum SCK fre-
quency is 2 MHz.
Serial To program and verify the AT89S51 in the serial programming mode, the following sequence
Programming is recommended:
Algorithm 1. Power-up sequence:
Apply power between VCC and GND pins.
Set RST pin to “H”.
If a crystal is not connected across pins XTAL1 and XTAL2, apply a 3 MHz to 33 MHz
clock to XTAL1 pin and wait for at least 10 milliseconds.
2. Enable serial programming by sending the Programming Enable serial instruction to
pin MOSI/P1.5. The frequency of the shift clock supplied at pin SCK/P1.7 needs to be
less than the CPU clock at XTAL1 divided by 16.
3. The Code array is programmed one byte at a time in either the Byte or Page mode.
The write cycle is self-timed and typically takes less than 0.5 ms at 5V.
4. Any memory location can be verified by using the Read instruction that returns the con-
tent at the selected address at serial output MISO/P1.6.
5. At the end of a programming session, RST can be set low to commence normal device
operation.
13
2487A–10/01
Power-off sequence (if needed):
Set XTAL1 to “L” (if a crystal is not used).
Set RST to “L”.
Turn VCC power off.
Data Polling: The Data Polling feature is also available in the serial mode. In this mode, dur-
ing a write cycle an attempted read of the last byte written will result in the complement of the
MSB of the serial output byte on MISO.
Serial The Instruction Set for Serial Programming follows a 4-byte protocol and is shown in Table 8
Programming on page 18.
Instruction Set
Programming Every code byte in the Flash array can be programmed by using the appropriate combination
Interface – of control signals. The write operation cycle is self-timed and once initiated, will automatically
time itself to completion.
Parallel Mode
All major programming vendors offer worldwide support for the Atmel microcontroller series.
Please contact your local programming vendor for the appropriate software revision.
(3)
Write Lock Bit 2 5V H L 12V H H H L L X X X
(3)
Write Lock Bit 3 5V H L 12V H L H H L X X X
P0.2,
Read Lock Bits
5V H L H H H H L H L P0.3, X X
1, 2, 3
P0.4
(1)
Chip Erase 5V H L 12V H L H L L X X X
14 AT89S51
2487A–10/01
AT89S51
3-33 MHz
RDY/
P3.0
BSY
GND PSEN
XTAL 2 EA
3-33 MHz
GND PSEN
15
2487A–10/01
Flash Programming and Verification Characteristics (Parallel Mode)
TA = 20°C to 30°C, VCC = 4.5 to 5.5V
Symbol Parameter Min Max Units
tEHSH tEHQZ
tELQV
P2.7
(ENABLE)
tGHBL
P3.0
(RDY/BSY) BUSY READY
tWC
16 AT89S51
2487A–10/01
AT89S51
INSTRUCTION
INPUT P1.5/MOSI
DATA OUTPUT P1.6/MISO
CLOCK IN P1.7/SCK
XTAL2
3-33 MHz
GND
7 6 5 4 3 2 1 0
17
2487A–10/01
Table 8. Serial Programming Instruction Set
Instruction
Format
Instruction Byte 1 Byte 2 Byte 3 Byte 4 Operation
Programming Enable 1010 1100 0101 0011 xxxx xxxx xxxx xxxx Enable Serial Programming
0110 1001 while RST is high
(Output)
Chip Erase 1010 1100 100x xxxx xxxx xxxx xxxx xxxx Chip Erase Flash memory
array
Read Program Memory 0010 0000 xxxx Read data from Program
A11
A1
A8
A10
A9
A5
A3
A6
A4
A2
A0
D7
A7
D6
D5
D4
D3
D0
D2
D1
(Byte Mode) memory in the byte mode
Write Program Memory 0100 0000 xxxx Write data to Program
A1
D7
D6
A5
D5
D3
D0
A3
D4
D1
A11
A6
A2
A0
D2
A7
A4
A8
A10
A9
(Byte Mode) memory in the byte mode
Write Lock Bits(2)
B2
B1
1010 1100 1110 00 xxxx xxxx xxxx xxxx Write Lock bits. See Note (2).
Read Lock Bits 0010 0100 xxxx xxxx xxxx xxxx xx xx Read back current status of
LB1
LB2
LB3
the lock bits (a programmed
lock bit reads back as a “1”)
Read Signature Bytes(1) 0010 1000 xxx xxx xxxx Signature Byte Read Signature Byte
A5
A4
A3
A2
A1
A0
Read Program Memory 0011 0000 xxxx Byte 0 Byte 1... Read data from Program
A11
A8
A10
A9
A8
A10
A9
After Reset signal is high, SCK should be low for at least 64 system clocks before it goes high to clock in the enable data
bytes. No pulsing of Reset signal is necessary. SCK should be no faster than 1/16 of the system clock at XTAL1.
For Page Read/Write, the data always starts from byte 0 to 255. After the command byte and upper address byte are
latched, each byte thereafter is treated as data until all 256 bytes are shifted in/out. Then the next instruction will be ready to
be decoded.
18 AT89S51
2487A–10/01
AT89S51
Serial Programming Characteristics
MOSI
tOVSH tSHOX tSLSH
SCK
tSHSL
MISO
tSLIV
Table 9. Serial Programming Characteristics, TA = -40° C to 85° C, VCC = 4.0 - 5.5V (Unless Otherwise Noted)
Symbol Parameter Min Typ Max Units
1/tCLCL Oscillator Frequency 0 33 MHz
tCLCL Oscillator Period 30 ns
tSHSL SCK Pulse Width High 8 tCLCL ns
tSLSH SCK Pulse Width Low 8 tCLCL ns
tOVSH MOSI Setup to SCK High tCLCL ns
tSHOX MOSI Hold after SCK High 2 tCLCL ns
tSLIV SCK Low to MISO Valid 10 16 32 ns
tERASE Chip Erase Instruction Cycle Time 500 ms
tSWC Serial Byte Write Cycle Time 64 tCLCL + 400 µs
19
2487A–10/01
Absolute Maximum Ratings*
Operating Temperature.................................. -55°C to +125°C *NOTICE: Stresses beyond those listed under “Absolute
Maximum Ratings” may cause permanent dam-
Storage Temperature ..................................... -65°C to +150°C age to the device. This is a stress rating only and
functional operation of the device at these or any
Voltage on Any Pin other conditions beyond those indicated in the
with Respect to Ground .....................................-1.0V to +7.0V operational sections of this specification is not
implied. Exposure to absolute maximum rating
Maximum Operating Voltage ............................................ 6.6V conditions for extended periods may affect
device reliability.
DC Output Current...................................................... 15.0 mA
DC Characteristics
The values shown in this table are valid for TA = -40°C to 85°C and VCC = 4.0V to 5.5V, unless otherwise noted.
Symbol Parameter Condition Min Max Units
VIL Input Low Voltage (Except EA) -0.5 0.2 VCC-0.1 V
VIL1 Input Low Voltage (EA) -0.5 0.2 VCC-0.3 V
VIH Input High Voltage (Except XTAL1, RST) 0.2 VCC+0.9 VCC+0.5 V
VIH1 Input High Voltage (XTAL1, RST) 0.7 VCC VCC+0.5 V
Output Low Voltage(1) (Ports 0.45 V
VOL 1,2,3) IOL = 1.6 mA
(1)
Output Low Voltage 0.45 V
VOL1 (Port 0, ALE, PSEN) IOL = 3.2 mA
IOH = -60 µA, VCC = 5V ± 10% 2.4 V
IOH = -25 µA 0.75 VCC V
Output High Voltage
VOH (Ports 1,2,3, ALE, PSEN) IOH = -10 µA 0.9 VCC V
IOH = -800 µA, VCC = 5V ± 10% 2.4 V
IOH = -300 µA 0.75 VCC V
Output High Voltage
VOH1 (Port 0 in External Bus Mode) IOH = -80 µA 0.9 VCC V
Logical 0 Input Current (Ports -50 µA
IIL 1,2,3) VIN = 0.45V
Logical 1 to 0 Transition Current -650 µA
ITL (Ports 1,2,3) VIN = 2V, VCC = 5V ± 10%
Input Leakage Current (Port 0, ±10 µA
ILI EA) 0.45 < VIN < VCC
RRST Reset Pulldown Resistor 50 300 KΩ
CIO Pin Capacitance Test Freq. = 1 MHz, TA = 25°C 10 pF
Active Mode, 12 MHz 25 mA
Power Supply Current Idle Mode, 12 MHz 6.5 mA
(2)
ICC Power-down Mode VCC = 5.5V 50 µA
Notes: 1. Under steady state (non-transient) conditions, IOL must be externally limited as follows:
Maximum IOL per port pin: 10 mA
Maximum IOL per 8-bit port:
Port 0: 26 mA Ports 1, 2, 3: 15 mA
Maximum total IOL for all output pins: 71 mA
If IOL exceeds the test condition, VOL may exceed the related specification. Pins are not guaranteed to sink current greater
than the listed test conditions.
2. Minimum VCC for Power-down is 2V.
20 AT89S51
2487A–10/01
AT89S51
AC Characteristics
Under operating conditions, load capacitance for Port 0, ALE/PROG, and PSEN = 100 pF; load capacitance for all other
outputs = 80 pF.
21
2487A–10/01
External Program Memory Read Cycle
tLHLL
ALE
tPLPH
tAVLL tLLIV
tLLPL
PSEN tPLIV
tPXAV
tPLAZ
tPXIZ
tLLAX
tPXIX
PORT 0 A0 - A7 INSTR IN A0 - A7
tAVIV
PSEN
tLLDV
tRLRH
tLLWL
RD tLLAX
tRLDV tRHDZ
tAVLL
tRLAZ
tRHDX
tAVWL
tAVDV
PORT 2 P2.0 - P2.7 OR A8 - A15 FROM DPH A8 - A15 FROM PCH
22 AT89S51
2487A–10/01
AT89S51
PSEN
tLLWL tWLWH
WR tLLAX
tAVLL tQVWX tWHQX
tQVWH
tAVWL
23
2487A–10/01
Serial Port Timing: Shift Register Mode Test Conditions
The values in this table are valid for VCC = 4.0V to 5.5V and Load Capacitance = 80 pF.
12 MHz Osc Variable Oscillator
Symbol Parameter Min Max Min Max Units
tXLXL Serial Port Clock Cycle Time 1.0 12tCLCL µs
tQVXH Output Data Setup to Clock Rising Edge 700 10tCLCL-133 ns
tXHQX Output Data Hold After Clock Rising Edge 50 2tCLCL-80 ns
tXHDX Input Data Hold After Clock Rising Edge 0 0 ns
tXHDV Clock Rising Edge to Input Data Valid 700 10tCLCL-133 ns
Note: 1. AC Inputs during testing are driven at VCC - 0.5V for a logic 1 and 0.45V for a logic 0. Timing measurements are made at VIH
min. for a logic 1 and VIL max. for a logic 0.
Float Waveforms(1)
V LOAD+ 0.1V V OL - 0.1V
Note: 1. For timing purposes, a port pin is no longer floating when a 100 mV change from load voltage occurs. A port pin begins to
float when a 100 mV change from the loaded VOH/VOL level occurs.
24 AT89S51
2487A–10/01
AT89S51
Ordering Information
Speed Power
(MHz) Supply Ordering Code Package Operation Range
24 4.0V to 5.5V AT89S51-24AC 44A Commercial
AT89S51-24JC 44J (0° C to 70° C)
AT89S51-24PC 40P6
AT89S51-24AI 44A Industrial
AT89S51-24JI 44J (-40° C to 85° C)
AT89S51-24PI 40P6
33 4.5V to 5.5V AT89S51-33AC 44A Commercial
AT89S51-33JC 44J (0° C to 70° C)
AT89S51-33PC 40P6
= Preliminary Availability
Package Type
44A 44-lead, Thin Plastic Gull Wing Quad Flatpack (TQFP)
44J 44-lead, Plastic J-leaded Chip Carrier (PLCC)
40P6 40-pin, 0.600" Wide, Plastic Dual Inline Package (PDIP)
25
2487A–10/01
Packaging Information
44A, 44-lead, Thin (1.0 mm) Plastic Gull Wing Quad 44J, 44-lead, Plastic J-leaded Chip Carrier (PLCC)
Flat Package (TQFP) Dimensions in Inches and (Millimeters)
Dimensions in Millimeters and (Inches)*
.656(16.7) .630(16.0)
SQ
.650(16.5) .590(15.0)
0.45(0.018) .032(.813) .021(.533)
0.80(0.031) BSC 0.30(0.012) .695(17.7)
.026(.660) SQ .013(.330)
.685(17.4)
0.75(0.030) 0.15(0.006)
0.45(0.018) 0.05(0.002)
2.07(52.6)
2.04(51.8) PIN
1
.566(14.4)
.530(13.5)
.090(2.29)
1.900(48.26) REF MAX
.220(5.59) .005(.127)
MAX MIN
SEATING
PLANE
.065(1.65)
.161(4.09) .015(.381)
.125(3.18)
.022(.559)
.065(1.65) .014(.356)
.110(2.79) .041(1.04)
.090(2.29)
.630(16.0)
.590(15.0)
0 REF
.012(.305) 15
.008(.203)
.690(17.5)
.610(15.5)
26 AT89S51
2487A–10/01
Atmel Headquarters Atmel Product Operations
Corporate Headquarters Atmel Colorado Springs
2325 Orchard Parkway 1150 E. Cheyenne Mtn. Blvd.
San Jose, CA 95131 Colorado Springs, CO 80906
TEL (408) 441-0311 TEL (719) 576-3300
FAX (408) 487-2600 FAX (719) 540-1759
Europe Atmel Grenoble
Atmel SarL Avenue de Rochepleine
Route des Arsenaux 41 BP 123
Casa Postale 80 38521 Saint-Egreve Cedex, France
CH-1705 Fribourg TEL (33) 4-7658-3000
Switzerland FAX (33) 4-7658-3480
TEL (41) 26-426-5555
FAX (41) 26-426-5500 Atmel Heilbronn
Theresienstrasse 2
Asia POB 3535
Atmel Asia, Ltd. D-74025 Heilbronn, Germany
Room 1219 TEL (49) 71 31 67 25 94
Chinachem Golden Plaza FAX (49) 71 31 67 24 23
77 Mody Road Tsimhatsui
East Kowloon Atmel Nantes
Hong Kong La Chantrerie
TEL (852) 2721-9778 BP 70602
FAX (852) 2722-1369 44306 Nantes Cedex 3, France
TEL (33) 0 2 40 18 18 18
Japan FAX (33) 0 2 40 18 19 60
Atmel Japan K.K.
9F, Tonetsu Shinkawa Bldg. Atmel Rousset
1-24-8 Shinkawa Zone Industrielle
Chuo-ku, Tokyo 104-0033 13106 Rousset Cedex, France
Japan TEL (33) 4-4253-6000
TEL (81) 3-3523-3551 FAX (33) 4-4253-6001
FAX (81) 3-3523-7581
Atmel Smart Card ICs
Scottish Enterprise Technology Park
East Kilbride, Scotland G75 0QR
TEL (44) 1355-357-000
FAX (44) 1355-242-743
e-mail
literature@atmel.com
Web Site
http://www.atmel.com
2487A–10/01/xM
XR-2206
Monolithic
...the analog plus company TM Function Generator
June 1997-3
FEATURES APPLICATIONS
Waveform Generation
Low-Sine Wave Distortion, 0.5%, Typical
Excellent Temperature Stability, 20ppm/°C, Typ. Sweep Generation
Wide Sweep Range, 2000:1, Typical AM/FM Generation
Low-Supply Sensitivity, 0.01%V, Typ.
V/F Conversion
Linear Amplitude Modulation
FSK Generation
TTL Compatible FSK Controls
Wide Supply Range, 10V to 26V Phase-Locked Loops (VCO)
GENERAL DESCRIPTION
The XR-2206 is a monolithic function generator The circuit is ideally suited for communications,
integrated circuit capable of producing high quality sine, instrumentation, and function generator applications
square, triangle, ramp, and pulse waveforms of requiring sinusoidal tone, AM, FM, or FSK generation. It
high-stability and accuracy. The output waveforms can be has a typical drift specification of 20ppm/°C. The oscillator
both amplitude and frequency modulated by an external frequency can be linearly swept over a 2000:1 frequency
voltage. Frequency of operation can be selected range with an external control voltage, while maintaining
externally over a range of 0.01Hz to more than 1MHz. low distortion.
ORDERING INFORMATION
Operating
Part No. Package Temperature Range
XR-2206M 16 Lead 300 Mil CDIP -55°C to +125°C
XR-2206P 16 Lead 300 Mil PDIP –40°C to +85°C
XR-2206CP 16 Lead 300 Mil PDIP 0°C to +70°C
XR-2206D 16 Lead 300 Mil JEDEC SOIC 0°C to +70°C
Rev. 1.03
1972
EXAR Corporation, 48720 Kato Road, Fremont, CA 94538 (510) 668-7000 (510) 668-7017
1
XR-2206
TR1 7
Timing
Resistors Current Multiplier
8 Switches And Sine
TR2 +1 2 STO
Shaper
FSKI 9
AMSI 1 3 MO
WAVEA1 13
WAVEA2 14
SYMA1 15
SYMA2 16
Rev. 1.03
2
XR-2206
PIN DESCRIPTION
Pin # Symbol Type Description
1 AMSI I Amplitude Modulating Signal Input.
2 STO O Sine or Triangle Wave Output.
3 MO O Multiplier Output.
4 VCC Positive Power Supply.
5 TC1 I Timing Capacitor Input.
6 TC2 I Timing Capacitor Input.
7 TR1 O Timing Resistor 1 Output.
8 TR2 O Timing Resistor 2 Output.
9 FSKI I Frequency Shift Keying Input.
10 BIAS O Internal Voltage Reference.
11 SYNCO O Sync Output. This output is a open collector and needs a pull up resistor to VCC.
12 GND Ground pin.
13 WAVEA1 I Wave Form Adjust Input 1.
14 WAVEA2 I Wave Form Adjust Input 2.
15 SYMA1 I Wave Symetry Adjust 1.
16 SYMA2 I Wave Symetry Adjust 2.
Rev. 1.03
3
XR-2206
DC ELECTRICAL CHARACTERISTICS
Test Conditions: Test Circuit of Figure 2 Vcc = 12V, TA = 25°C, C = 0.01F, R1 = 100k, R2 = 10k, R3 = 25k
Unless Otherwise Specified. S1 open for triangle, closed for sine wave.
XR-2206M/P XR-2206CP/D
Parameters Min. Typ. Max. Min. Typ. Max. Units Conditions
General Characteristics
Single Supply Voltage 10 26 10 26 V
Split-Supply Voltage +5 +13 +5 +13 V
Supply Current 12 17 14 20 mA R1 10k
Oscillator Section
Max. Operating Frequency 0.5 1 0.5 1 MHz C = 1000pF, R1 = 1k
Lowest Practical Frequency 0.01 0.01 Hz C = 50F, R1 = 2M
Frequency Accuracy +1 +4 +2 % of fo fo = 1/R1C
Temperature Stability +10 +50 +20 ppm/°C 0°C TA 70°C
Frequency R1 = R2 = 20k
Sine Wave Amplitude Stability2 4800 4800 ppm/°C
Supply Sensitivity 0.01 0.1 0.01 %/V VLOW = 10V, VHIGH = 20V,
R1 = R2 = 20k
Sweep Range 1000:1 2000:1 2000:1 fH = fL fH @ R1 = 1k
fL @ R1 = 2M
Sweep Linearity
10:1 Sweep 2 2 % fL = 1kHz, fH = 10kHz
1000:1 Sweep 8 8 % fL = 100Hz, fH = 100kHz
FM Distortion 0.1 0.1 % +10% Deviation
Recommended Timing Components
Timing Capacitor: C 0.001 100 0.001 100 F Figure 5
Timing Resistors: R1 & R2 1 2000 1 2000 k
Triangle Sine Wave Output1 Figure 3
Triangle Amplitude 160 160 mV/k Figure 2, S1 Open
Sine Wave Amplitude 40 60 80 60 mV/k Figure 2, S1 Closed
Max. Output Swing 6 6 Vp-p
Output Impedance 600 600
Triangle Linearity 1 1 %
Amplitude Stability 0.5 0.5 dB For 1000:1 Sweep
Sine Wave Distortion
Without Adjustment 2.5 2.5 % R1 = 30k
With Adjustment 0.4 1.0 0.5 1.5 % See Figure 7 and Figure 8
Notes
1 Output amplitude is directly proportional to the resistance, R , on Pin 3. See Figure 3.
3
2 For maximum amplitude stability, R should be a positive temperature coefficient resistor.
3
Bold face parameters are covered by production test and guaranteed over operating temperature range.
Rev. 1.03
4
XR-2206
DC ELECTRICAL CHARACTERISTICS (CONT’D)
XR-2206M/P XR-2206CP/D
Parameters Min. Typ. Max. Min. Typ. Max. Units Conditions
Amplitude Modulation
Input Impedance 50 100 50 100 k
Modulation Range 100 100 %
Carrier Suppression 55 55 dB
Linearity 2 2 % For 95% modulation
Square-Wave Output
Amplitude 12 12 Vp-p Measured at Pin 11.
Rise Time 250 250 ns CL = 10pF
Fall Time 50 50 ns CL = 10pF
Saturation Voltage 0.2 0.4 0.2 0.6 V IL = 2mA
Leakage Current 0.1 20 0.1 100 A VCC = 26V
FSK Keying Level (Pin 9) 0.8 1.4 2.4 0.8 1.4 2.4 V See section on circuit controls
Reference Bypass Voltage 2.9 3.1 3.3 2.5 3 3.5 V Measured at Pin 10.
Notes
1 Output amplitude is directly proportional to the resistance, R , on Pin 3. See Figure 3.
3
2 For maximum amplitude stability, R should be a positive temperature coefficient resistor.
3
Bold face parameters are covered by production test and guaranteed over operating temperature range.
SYSTEM DESCRIPTION
The XR-2206 is comprised of four functional blocks; a terminals to ground. With two timing pins, two discrete
voltage-controlled oscillator (VCO), an analog multiplier output frequencies can be independently produced for
and sine-shaper; a unity gain buffer amplifier; and a set of FSK generation applications by using the FSK input
current switches. control pin. This input controls the current switches which
The VCO produces an output frequency proportional to select one of the timing resistor currents, and routes it to
an input current, which is set by a resistor from the timing the VCO.
Rev. 1.03
5
XR-2206
VCC
1mF
4
1 Symmetry Adjust
16
5
Mult. 25K
S1 = Open For Triangle
C And 15
VCO = Closed For Sinewave
Sine 14
6 Shaper
S1
13 THD Adjust
9
FSK Input 500
R1 7 Current Triangle Or
2 Sine Wave
R2 8 Switches +1
Output
11 Square Wave
Output
10 12 3 XR-2206
R3 10K
25K
1mF
+ VCC
1mF
VCC
5.1K 5.1K
6
ÎÎÎÎÎÎÎÎÎÎ
ÎÎÎÎÎÎÎÎÎÎ
26
Triangle 70°C Max.
ÎÎÎÎÎÎÎÎÎÎ
Package
Peak Output Voltage (Volts)
5 Dissipation
ÎÎÎÎÎÎÎÎÎÎ
22
1KW
ÎÎÎÎÎÎÎÎÎÎ
4
Sinewave
2KW
ICC (mA)
ÎÎÎÎÎÎÎÎÎÎ
3 18
ÎÎÎÎÎÎÎÎÎÎ 10KW
ÎÎÎÎÎÎÎÎÎÎ
2
14
ÎÎÎÎÎÎÎÎÎÎ
1 30KW
ÎÎÎÎÎÎÎÎÎÎ
0 20 40 60
R3 in (KW)
80 100
10
8 12 16 20
VCC (V)
24 28
Rev. 1.03
6
XR-2206
10M
ÁÁÁÁÁÁ ÎÎÎÎÎÎÎÎÎÎÎ
ÁÁÁÁÁÁ ÎÎÎÎÎÎÎÎÎÎÎ
MAXIMUM TIMING R
ÎÎÎÎÎÎÎÎÎÎÎ
ÁÁÁÁÁ
1M
ÎÎÎÎÎÎÎÎÎÎÎ
Timing Resistor ( W )
ÁÁÁÁÁ
1.0
NORMAL RANGE
ÎÎÎÎÎÎÎÎÎÎÎ
ÎÎÎÎÎÎÎÎÎÎÎ
100K
ÁÁÁÁÁ ÎÎÎÎÎÎÎÎÎÎÎ
ÁÁÁÁÁ ÎÎÎÎÎÎÎÎÎÎÎ
TYPICAL VALUE 0.5
10K
ÁÁÁÁÁ ÎÎÎÎÎÎÎÎÎÎÎ
1K
ÁÁÁÁÁ
10-2
MINIMUM TIMING R
ÎÎÎÎÎÎÎÎÎÎÎÎ
ÎÎÎÎÎÎÎÎÎÎÎÎ
5
ÁÁÁÁÁÁÁ
5
ÎÎÎÎÎÎÎÎÎÎÎÎ
ÁÁÁÁÁÁÁ ÁÁÁ
ÎÎÎÎÎÎÎÎÎÎÎÎ
4
ÁÁÁÁÁÁÁ
4
ÁÁÁÁ
ÎÎÎÎÎÎÎÎÎÎÎÎ
C = 0.01mF R=3KW
Trimmed For Minimum
Distortion (%)
ÎÎÎÎÎÎÎÎÎÎÎÎ ÁÁÁÁ
Distortion At 30 KW
Distortion (%)
3 RL=10KW
3
ÎÎÎÎÎÎÎÎÎÎÎÎ
ÎÎÎÎÎÎÎÎÎÎÎÎ
2 2
ÎÎÎÎÎÎÎÎÎÎÎÎ
ÎÎÎÎÎÎÎÎÎÎÎÎ
1 1
ÎÎÎÎÎÎÎÎÎÎÎÎ
ÎÎÎÎÎÎÎÎÎÎÎÎ
0
1.0 10
Timing R K(W)
100 103
0
10 100 1K 10K
Frequency (Hz)
100K 1M
Rev. 1.03
7
XR-2206
C=0.01F
2
R=1M
R=2K
Frequency Drift (%)
1
R=200K R=10K
R=200K
0
R=10K IC IT
Pin 7
R=2K R=1M Rc or 8
-1 Sweep
Input +
R=1K VC IB
- +
-2 3V
R=1K R
ÁÁ
-
12
-3
-50 -25 0 25 50 75 100 125
Figure 9. Frequency Drift versus Figure 10. Circuit Connection for Frequency Sweep.
Temperature.
VCC
1F
4
1 16
5
Mult. S1 Closed For Sinewave
C 15
VCO And
Sine 14
6 Shaper S1
13 200
9
7 Current
2 Triangle Or
8 Switches +1 Sine Wave Output
2M R1 1K
11 Square Wave
Output
R 10 12 3 XR-2206
R3 10K
+ 50K
1F
+ VCC
10F
VCC
5.1K 5.1K
Figure 11. Circuit tor Sine Wave Generation without External Adjustment.
(See Figure 3 for Choice of R3)
Rev. 1.03
8
XR-2206
VCC
1F
4 Symmetry Adjust
1 16
5
Mult. 25K RB
C And 15 S1 Closed For Sinewave
1 VCO
F= Sine 14
RC 6 Shaper S1
13 RA
9
500
7 Current 2 Triangle Or
2M R1 8 Switches +1 Sine Wave Output
1K
11 Square Wave
Output
R 10 12 3 XR-2206
R3 10K
+ 50K
1F
+ VCC
10F
VCC
5.1K 5.1K
Figure 12. Circuit for Sine Wave Generation with Minimum Harmonic Distortion.
(R3 Determines Output Swing - See Figure 3)
VCC
1F
4
1 16
5
Mult. 15
>2V F1 C VCO And 14
Sine
F2 6 Shaper
<1V
13 200
9
FSK Input
R1 7 Current 2
R2 8 Switches +1 FSK Output
11
F1=1/R1C
F2=1/R2C 10 12 3 XR-2206
R3
+ 50K
1F
+
10F
VCC
5.1K 5.1K
Rev. 1.03
9
XR-2206
VCC
1F f 2 1
C R1 R2
4
1 R1
5 16 Duty Cycle =
R1 R2
Mult.
C VCO And 15
Sine 14
6
Shaper
9 13
R1 7 Current
R2 2 Sawtooth Output
8 Switches +1
11
Pulse Output
10 12 3 XR-2206
R3 5.1K
+ 24K
1F
+ VCC
10F
VCC
5.1K 5.1K
The XR-2206 can be operated with two separate timing Sine Wave Generation
resistors, R1 and R2, connected to the timing Pin 7 and 8,
respectively, as shown in Figure 13. Depending on the Without External Adjustment
polarity of the logic signal at Pin 9, either one or the other
of these timing resistors is activated. If Pin 9 is Figure 11 shows the circuit connection for generating a
open-circuited or connected to a bias voltage 2V, only sinusoidal output from the XR-2206. The potentiometer,
R1 is activated. Similarly, if the voltage level at Pin 9 is R1 at Pin 7, provides the desired frequency tuning. The
1V, only R2 is activated. Thus, the output frequency can maximum output swing is greater than V+/2, and the
be keyed between two levels. f1 and f2, as: typical distortion (THD) is < 2.5%. If lower sine wave
distortion is desired, additional adjustments can be
f1 = 1/R1C and f2 = 1/R2C
provided as described in the following section.
For split-supply operation, the keying voltage at Pin 9 is The circuit of Figure 11 can be converted to split-supply
referenced to V-. operation, simply by replacing all ground connections
with V-. For split-supply operation, R3 can be directly
Output DC Level Control connected to ground.
Rev. 1.03
10
XR-2206
With External Adjustment: PRINCIPLES OF OPERATION
Description of Controls
The harmonic content of sinusoidal output can be
reduced to -0.5% by additional adjustments as shown in Frequency of Operation:
Figure 12. The potentiometer, RA, adjusts the
The frequency of oscillation, fo, is determined by the
sine-shaping resistor, and RB provides the fine
external timing capacitor, C, across Pin 5 and 6, and by
adjustment for the waveform symmetry. The adjustment
the timing resistor, R, connected to either Pin 7 or 8. The
procedure is as follows:
frequency is given as:
1. Set RB at midpoint and adjust RA for minimum
distortion.
f 0 + 1 Hz
RC
2. With RA set as above, adjust RB to further reduce
distortion.
and can be adjusted by varying either R or C. The
recommended values of R, for a given frequency range,
as shown in Figure 5. Temperature stability is optimum
Triangle Wave Generation
for 4k < R < 200k. Recommended values of C are from
1000pF to 100F.
The circuits of Figure 11 and Figure 12 can be converted
to triangle wave generation, by simply open-circuiting Pin Frequency Sweep and Modulation:
13 and 14 (i.e., S1 open). Amplitude of the triangle is Frequency of oscillation is proportional to the total timing
approximately twice the sine wave output. current, IT, drawn from Pin 7 or 8:
320I T (mA)
f+ Hz
FSK Generation C(F)
Figure 13 shows the circuit connection for sinusoidal FSK Timing terminals (Pin 7 or 8) are low-impedance points,
signal operation. Mark and space frequencies can be and are internally biased at +3V, with respect to Pin 12.
independently adjusted by the choice of timing resistors, Frequency varies linearly with IT, over a wide range of
R1 and R2; the output is phase-continuous during current values, from 1A to 3mA. The frequency can be
transitions. The keying signal is applied to Pin 9. The controlled by applying a control voltage, VC, to the
circuit can be converted to split-supply operation by activated timing pin as shown in Figure 10. The frequency
simply replacing ground with V-. of oscillation is related to VC as:
Rev. 1.03
11
XR-2206
Output Amplitude:
Maximum output amplitude is inversely proportional to at Pin 1 is approximately 100k. Output amplitude varies
the external resistor, R3, connected to Pin 3 (see linearly with the applied voltage at Pin 1, for values of dc
Figure 3). For sine wave output, amplitude is bias at this pin, within 14 volts of VCC/2 as shown in
approximately 60mV peak per k of R3; for triangle, the Figure 6. As this bias level approaches VCC/2, the phase
peak amplitude is approximately 160mV peak per k of of the output signal is reversed, and the amplitude goes
R3. Thus, for example, R3 = 50k would produce through zero. This property is suitable for phase-shift
approximately 13V sinusoidal output amplitude. keying and suppressed-carrier AM generation. Total
dynamic range of amplitude modulation is approximately
55dB.
Amplitude Modulation:
CAUTION: AM control must be used in conjunction with a
Output amplitude can be modulated by applying a dc bias well-regulated supply, since the output amplitude now becomes
and a modulating signal to Pin 1. The internal impedance a function of VCC.
VR VCC 11 15 V2 5 14 16 6 13 1 3 2
VCC
7
6
5
8
10
VCC
VR
V1
4
VR
Int’nI.
Reg. V1
VR
V2
12
9
Rev. 1.03
12
XR-2206
16 9
1 8
D E1
Base A1
Plane A
Seating L
Plane
e c
B B1 α
INCHES MILLIMETERS
SYMBOL MIN MAX MIN MAX
Rev. 1.03
13
XR-2206
16 9
E1
1 8
D E
A2
Seating A
Plane L C
A1 α
B
e B1 eA
eB
INCHES MILLIMETERS
SYMBOL MIN MAX MIN MAX
Rev. 1.03
14
XR-2206
16 9
E H
1
8
C
A
Seating
Plane α
e B
A1
INCHES MILLIMETERS
SYMBOL MIN MAX MIN MAX
α 0° 8° 0° 8°
Note: The control dimension is the millimeter column
Rev. 1.03
15
XR-2206
NOTICE
EXAR Corporation reserves the right to make changes to the products contained in this publication in order to im-
prove design, performance or reliability. EXAR Corporation assumes no responsibility for the use of any circuits de-
scribed herein, conveys no license under any patent or other right, and makes no representation that the circuits are
free of patent infringement. Charts and schedules contained here in are only for illustration purposes and may vary
depending upon a user’s specific application. While the information in this publication has been carefully checked;
no responsibility, however, is assumed for inaccuracies.
EXAR Corporation does not recommend the use of any of its products in life support applications where the failure or
malfunction of the product can reasonably be expected to cause failure of the life support system or to significantly
affect its safety or effectiveness. Products are not authorized for use in such applications unless EXAR Corporation
receives, in writing, assurances to its satisfaction that: (a) the risk of injury or damage has been minimized; (b) the
user assumes all such risks; (c) potential liability of EXAR Corporation is adequately protected under the circum-
stances.
Rev. 1.03
16
XR-2211
FSK Demodulator/
...the analog plus company TM Tone Decoder
June 1997-3
FEATURES APPLICATIONS
GENERAL DESCRIPTION
The XR-2211 is a monolithic phase-locked loop (PLL) quadrature phase detector which provides carrier
system especially designed for data communications detection, and an FSK voltage comparator which provides
applications. It is particularly suited for FSK modem FSK demodulation. External components are used to
applications. It operates over a wide supply voltage range independently set center frequency, bandwidth, and output
of 4.5 to 20V and a wide frequency range of 0.01Hz to delay. An internal voltage reference proportional to the
300kHz. It can accommodate analog signals between power supply is provided at an output pin.
10mV and 3V, and can interface with conventional DTL,
TTL, and ECL logic families. The circuit consists of a basic The XR-2211 is available in 14 pin packages specified for
PLL for tracking an input signal within the pass band, a military and industrial temperature ranges.
ORDERING INFORMATION
Operating
Part No. Package Temperature Range
XR-2211M 14 Pin CDIP (0.300”) -55°C to +125°C
XR-2211N 14 Pin CDIP (0.300”) -40°C to +85°C
XR-2211P 14 Pin PDIP (0.300”) -40°C to +85°C
XR-2211ID 14 Lead SOIC (Jedec, 0.150”) -40°C to +85°C
Rev. 3.01
1992
EXAR Corporation, 48720 Kato Road, Fremont, CA 94538 (510) 668-7000 FAX (510) 668-7017
1
XR-2211
BLOCK DIAGRAM
VCC GND NC
1 4 9
TIM C1 14 Lock
Detect
Comparator
VCO 6 LDOQ
TIM C2 13 Quad
-Det 5 LDOQN
TIM R 12
Internal
VREF 10 VREF
FSK Comp 7 DO
Reference
COMP I 8
Rev. 3.01
2
XR-2211
PIN CONFIGURATION
PIN DESCRIPTION
Pin # Symbol Type Description
1 VCC Positive Power Supply.
2 INP I Receive Analog Input.
3 LDF O Lock Detect Filter.
4 GND Ground Pin.
5 LDOQN O Lock Detect Output Not. This output will be low if the VCO is in the capture range.
6 LDOQ O Lock Detect Output. This output will be high if the VCO is in the capture range.
7 DO O Data Output. Decoded FSK output.
8 COMP I I FSK Comparator Input.
9 NC Not Connected.
10 VREF O Internal Voltage Reference. The value of VREF is VCC/2 - 650mV.
11 LDO O Loop Detect Output. This output provides the result of the quadrature phase detection.
12 TIM R I Timing Resistor Input. This pin connects to the timing resistor of the VCO.
13 TIM C2 I Timing Capacitor Input. The timing capacitor connects between this pin and pin 14.
14 TIM C1 I Timing Capacitor Input. The timing capacitor connects between this pin and pin 13.
Rev. 3.01
3
XR-2211
ELECTRICAL CHARACTERISTICS
Test Conditions: VCC = 12V, TA = +25°C, RO = 30KW, CO = 0.033mF, unless otherwise specified.
Notes
Parameters are guaranteed over the recommended operating conditions, but are not 100% tested in production.
Bold face parameters are covered by production test and guaranteed over operating temperature range.
Rev. 3.01
4
XR-2211
DC ELECTRICAL CHARACTERISTICS (CONT’D)
Test Conditions: VCC = 12V, TA = +25°C, RO = 30KW, CO = 0.033mF, unless otherwise specified.
Notes
Parameters are guaranteed over the recommended operating conditions, but are not 100% tested in production.
Bold face parameters are covered by production test and guaranteed over operating temperature range.
SYSTEM DESCRIPTION
The main PLL within the XR-2211 is constructed from an (internally connected). When in lock, these frequencies
input preamplifier, analog multiplier used as a phase are fIN+ fVCO (2 times fIN when in lock) and fIN - fVCO (0Hz
detector and a precision voltage controlled oscillator when lock). By adding a capacitor to the phase detector
(VCO). The preamplifier is used as a limiter such that output, the 2 times fIN component is reduced, leaving a
input signals above typically 10mV rms are amplified to a DC voltage that represents the phase difference between
constant high level signal. The multiplying-type phase the two frequencies. This closes the loop and allows the
detector acts as a digital exclusive or gate. Its output VCO to track the input frequency.
(unfiltered) produces sum and difference frequencies of
the input and the VCO output. The VCO is actually a The FSK comparator is used to determine if the VCO is
current controlled oscillator with its normal input current driven above or below the center frequency (FSK
(fO) set by a resistor (R0) to ground and its driving current comparator). This will produce both active high and
with a resistor (R1) from the phase detector. active low outputs to indicate when the main PLL is in lock
The output of the phase detector produces sum and (quadrature phase detector and lock detector
difference of the input and the VCO frequencies comparator).
Rev. 3.01
5
XR-2211
PRINCIPLES OF OPERATION
Signal Input (Pin 2): Signal is AC coupled to this 10 must be bypassed to ground with a 0.1mF capacitor for
terminal. The internal impedance at pin 2 is 20KW. proper operation of the circuit.
Recommended input signal level is in the range of 10mV
rms to 3V rms. Loop Phase Detector Output (Pin 11): This terminal
provides a high impedance output for the loop phase
Quadrature Phase Detector Output (Pin 3): This is the detector. The PLL loop filter is formed by R1 and C1
connected to pin 11 (see Figure 3.) With no input signal, or
high impedance output of quadrature phase detector and
with no phase error within the PLL, the DC level at pin 11 is
is internally connected to the input of lock detect voltage
very nearly equal to VREF. The peak to peak voltage swing
comparator. In tone detection applications, pin 3 is
available at the phase detector output is equal to 2 x VREF.
connected to ground through a parallel combination of RD
and CD (see Figure 3) to eliminate the chatter at lock VCO Control Input (Pin 12): VCO free-running
detect outputs. If the tone detect section is not used, pin 3 frequency is determined by external timing resistor, R0,
can be left open. connected from this terminal to ground. The VCO
free-running frequency, fO, is:
Lock Detect Output, Q (Pin 6): The output at pin 6 is at
“low” state when the PLL is out of lock and goes to “high”
state when the PLL is locked. It is an open collector type fO 1 Hz
R 0·C 0
output and requires a pull-up resistor, RL, to VCC for
proper operation. At “low” state, it can sink up to 5mA of
load current. where C0 is the timing capacitor across pins 13 and 14.
For optimum temperature stability, R0 must be in the
range of 10KW to 100KW (see Figure 9.)
Lock Detect Complement, (Pin 5): The output at pin 5 is
the logic complement of the lock detect output at pin 6. This terminal is a low impedance point, and is internally
This output is also an open collector type stage which can biased at a DC level equal to VREF. The maximum timing
sink 5mA of load current at low or “on” state. current drawn from pin 12 must be limited to < 3mA for
proper operation of the circuit.
FSK Data Output (Pin 7): This output is an open collector
logic stage which requires a pull-up resistor, RL, to VCC for VCO Timing Capacitor (Pins 13 and 14): VCO
proper operation. It can sink 5mA of load current. When frequency is inversely proportional to the external timing
decoding FSK signals, FSK data output is at “high” or “off” capacitor, C0, connected across these terminals (see
state for low input frequency, and at “low” or “on” state for Figure 6.) C0 must be non-polar, and in the range of
high input frequency. If no input signal is present, the logic 200pF to 10mF.
state at pin 7 is indeterminate.
VCO Frequency Adjustment: VCO can be fine-tuned by
connecting a potentiometer, RX, in series with R0 at pin 12
FSK Comparator Input (Pin 8): This is the high
(see Figure 10.)
impedance input to the FSK voltage comparator.
Normally, an FSK post-detection or data filter is VCO Free-Running Frequency, fO: XR-2211 does not
connected between this terminal and the PLL phase have a separate VCO output terminal. Instead, the VCO
detector output (pin 11). This data filter is formed by RF outputs are internally connected to the phase detector
and CF (see Figure 3.) The threshold voltage of the sections of the circuit. For set-up or adjustment purposes,
comparator is set by the internal reference voltage, VREF, the VCO free-running frequency can be tuned by using
available at pin 10. the generalized circuit in Figure 3, and applying an
alternating bit pattern of O’s and 1’s at the known mark
Reference Voltage, VREF (Pin 10): This pin is internally and space frequencies. By adjusting R0, the VCO can
biased at the reference voltage level, VREF: VREF = VCC /2 then be tuned to obtain a 50% duty cycle on the FSK
- 650mV. The DC voltage level at this pin forms an internal output (pin 7). This will ensure that the VCO fO value is
reference for the voltage levels at pins 5, 8, 11 and 12. Pin accurately referenced to the mark and space frequencies.
Rev. 3.01
6
XR-2211
ÎÎÎÎÎÎ Loop
ÎÎ
ÎÎÎÎÎ
Data
ÎÎÎÎÎÎ
Filter Filter FSK
Output
ÎÎÎÎÎÎ ÎÎÎÎÎ
φ Det
FSK
Comp
ÎÎÎ ÎÎÎ φ
ÎÎÎ ÎÎÎ
Input
Preamp
VCO
ÎÎÎÎÎÎ ÎÎ
φ
ÎÎÎÎÎÎ ÎÎ
ÎÎÎ
ÎÎÎÎÎÎ ÎÎ
φ Det Lock Detect
Outputs
VCC
RB
Rl
Loop 11 RF 8
Phase 7
+
Detect C1 CF
FSK
Comp.
R1 10
2 12 Internal
Input VCO Reference
Signal 0.1mF
0.1mF
14 13 R0
C0 6
+ LDOQ
Quad
Phase LDOQN
Detect 5
3 Lock
Detect
Comp.
RD CD
Rev. 3.01
7
XR-2211
DESIGN EQUATIONS
(All resistance in W, all frequency in Hz and all capacitance in farads, unless otherwise specified)
(See Figure 3 for definition of components)
1. VCO Center Frequency, fO:
fO + 1
R 0·C 0
+ C 1·R PP (seconds)
where:
R PP + ǒRR)·RR Ǔ
1
1 F
+ Ǹǒ 1250·C 0
R 1·C 1
Ǔ
Note: For derivation/explanation of this equation, please see TAN-011.
5. Loop-tracking
f
bandwidth, "+ f
0
f + R 0
f0 R1
Tracking
Bandwidth
Df Df
fLL f1 fO f2 fLH
Rev. 3.01
8
XR-2211
6. FSK Data filter time constant, tF:
RB · RF
tF + ·C (seconds)
( R B ) R F) F
7. Loop phase detector conversion gain, Kd: (Kd is the differential DC voltage across pin 10 and pin11, per unit of
phase error at phase detector input):
Kd + ƪ
V REF · R 1 volt
10, 000·p radian
ƫ
Note: For derivation/explanation of this equation, please see TAN-011.
8. VCO conversion gain, Ko: (Ko is the amount of change in VCO frequency, per unit of DC voltage change at pin 11):
K0 + –2p
V REF ·C 0 · R 1
+ ǒradianvolt
ńsecond
Ǔ
9. The filter transfer function:
1 F
1 ƫ
11. Peak detector current IA:
V REF
IA + (V REF in volts and I A in amps)
20, 000
Rev. 3.01
9
XR-2211
APPLICATIONS INFORMATION
FSK Decoding
Figure 10 shows the basic circuit connection for FSK decoding. With reference to Figure 3 and Figure 10, the functions
of external components are defined as follows: R0 and C0 set the PLL center frequency, R1 sets the system bandwidth,
and C1 sets the loop filter time constant and the loop damping factor. CF and RF form a one-pole post-detection filter for
the FSK data output. The resistor RB from pin 7 to pin 8 introduces positive feedback across the FSK comparator to
facilitate rapid transition between output logic states.
Design Instructions:
The circuit of Figure 10 can be tailored for any FSK decoding application by the choice of five key circuit components: R0,
R1, C0, C1 and CF. For a given set of FSK mark and space frequencies, fO and f1, these parameters can be calculated as
follows:
(All resistance in W’s, all frequency in Hz and all capacitance in farads, unless otherwise specified)
a) Calculate PLL center frequency, fO:
f O + ǸF 1·F 2
b) Choose value of timing resistor R0, to be in the range of 10KW to 100KW. This choice is arbitrary. The recommended
value is R0 = 20KW. The final value of R0 is normally fine-tuned with the series potentiometer, RX.
RX
RO + RO )
2
CO + 1
R0 · f0
d) Calculate R1 to give the desired tracking bandwidth (See design equation 5).
R 0·f 0
R1 + ·2
(f 1–f 2)
Rev. 3.01
10
XR-2211
f) The input to the XR-2211 may sometimes be too sensitive to noise conditions on the input line. Figure 4 illustrates
a method of de-sensitizing the XR-2211 from such noisy line conditions by the use of a resistor, Rx, connected
from pin 2 to ground. The value of Rx is chosen by the equation and the desired minimum signal threshold level.
VCC
To Phase
Detector
ÎÎ
Input Va Vb
2
Rx 20K 20K
ÎÎ
ÎÎ
VREF 10
(R F ) R 1)·R B
R sum +
( R 1 ) R F ) R B)
Rev. 3.01
11
XR-2211
ÎÎÎÎÎÎÎÎÎÎÎ
ÎÎÎÎÎÎÎÎÎÎÎ
20 1.0
ÎÎÎÎÎÎÎÎÎÎÎ R0=5KW
ÎÎÎÎÎÎÎÎÎÎÎ
Supply vs. Current (mA)
15
ÎÎÎÎÎÎÎÎÎÎÎ
R0=10KW
ÎÎÎÎÎÎÎÎÎÎÎ
R0=5KΩ
C0( mF)
ÎÎÎÎÎÎÎÎÎÎÎ
10 0.1 R0=20KW
R0=10KΩ
ÎÎÎÎÎÎÎÎÎÎÎ R0=40KW
5
ÎÎÎÎÎÎÎÎÎÎÎ
ÎÎÎÎÎÎÎÎÎÎÎ
R0>100K R0=80KW
ÎÎÎÎÎÎÎÎÎÎÎ
R0=160KW
0
0.01
4 6 8 10 12 14 16 18 20 22 24 100 1000 10000
fO(HZ)
Supply Voltage, V+ (Volts)
Figure 5. Typical Supply Current vs. V+ Figure 6. VCO Frequency vs. Timing Resistor
ÎÎÎÎÎÎÎÎÎÎÎÎ
(Logic Outputs Open Circuited)
ÎÎÎÎÎÎÎÎÎÎÎÎ
1,000
ÎÎÎÎÎÎÎÎÎÎÎÎ
C0=0.001mF
1.02
ÎÎÎÎÎÎÎÎÎÎÎÎ
fO = 1kHz 5
1
ÎÎÎÎÎÎÎÎÎÎÎÎ
RF = 10R0
Normalized Frequency
1.01 5
C0=0.0033mF
ÎÎÎÎÎÎÎÎÎÎÎÎ
4 2
3
R0(KW )
ÎÎÎÎÎÎÎÎÎÎÎÎ
1.00
100 4
ÎÎÎÎÎÎÎÎÎÎÎÎ
C0=0.01mF 3
0.99
C0=0.1mF
ÎÎÎÎÎÎÎÎÎÎÎÎ
Curve R0
2 1 5K
ÎÎÎÎÎÎÎÎÎÎÎÎ
0.98 2 10K
C0=0.0331mF 3 30K
ÎÎÎÎÎÎÎÎÎÎÎÎ
1 4 100K
C0=0.33mF 0.97 5 300K
10 4 6 8 10 12 14 16 18 20 22 24
0 1000 10000
V+ (Volts)
fO(Hz)
Figure 7. VCO Frequency vs. Timing Capacitor Figure 8. Typical fO vs. Power Supply
Characteristics
Normalized Frequency Drift (% of f O)
+1.0
1MΩ
R0=10K
+0.5
500K
R0=50K
0
50K
R0=500K 10K
-0.5
V+ = 12V
R0=1MΩ R1 = 10 R0
fO = 1 kHz
-1.0
-50 -25 0 25 50 75 100 125
Temperature (°C)
Figure 9. Typical Center Frequency Drift vs. Temperature
Rev. 3.01
12
XR-2211
Design Example:
1200 Baud FSK demodulator with mark and space frequencies of 1200/2200.
Step 2: Calculate R0 : R0 =10K with a potentiometer of 10K. (See design instructions (b))
ǒ Ǔ
(b) R T + 10 ) 10 + 15K
2
(c) C O + 1 + 39nF
15000·1624
Step 9: Calculate CF :
CF + 0.25 + 1nF
ǒ R SUM·Baud Rate Ǔ
Rev. 3.01
13
XR-2211
VCC
RB
RL
1.8m 5% 5.1K
Loop 11 RF 178K 8 5%
Phase 7
Detect C1 5% CF Data
2.7nF 1nF 10% FSK Output
5% R1 Comp.
35.2K 10
2 12 1% Internal
Input VCO 0.1µF Reference
Signal R0
0.1µF
14 13 20K
1%
CO
27nF 5% VCO
Fine
Rx Tune
20K
6
+ LDOQ
Quad
Phase LDOQN
Detect 5
Lock
Detect
Comp.
Figure 10. Circuit Connection for FSK Decoding of Caller Identification Signals
(Bell 202 Format)
VCC
RB
RL
Loop 11 RF 8 5.1k
Phase 7
+
Detect C1 CF
FSK
Comp.
R1 10
2 12 Internal
Input VCO Reference
Signal 0.1µF
0.1µF 14 13 R0
C0
Rx
6 LDOQ
Quad
Phase
Detect 3 5 LDOQN
Lock
Detect
RD Comp.
CD
Between 400K and 600K
Rev. 3.01
14
XR-2211
VCC
Loop 11 8
Phase 7
+
Detect C1
220pF FSK
5% R1 Comp.
200K 10
2 12 1% Internal
VCO 0.1µF Reference
0.1µF R0
14 13 VCC
20K
Tone C0 5% 1%
Input 50nF
VCO
Rx Fine
5K Tune RL2 RL3
5.1K 5.1K
6 LDOQ
+
Quad Logic Output
Phase
Detect 3 5 LDOQN
Lock
Detect
CD Comp.
RD
470K 80nF
Rev. 3.01
15
XR-2211
Design Instructions:
The circuit of Figure 12 can be optimized for any tone detection application by the choice of the 5 key circuit components:
R0, R1, C0, C1 and CD. For a given input, the tone frequency, fS, these parameters are calculated as follows:
(All resistance in W’s, all frequency in Hz and all capacitance in farads, unless otherwise specified)
a) Choose value of timing resistor R0 to be in the range of 10KW to 50KW. This choice is dictated by the max./min.
current that the internal voltage reference can deliver. The recommended value is R0 = 20KW. The final value of R0
is normally fine-tuned with the series potentiometer, RX.
b) Calculate value of C0 from design equation (1) or from Figure 7 fS = fO:
CO + 1
R 0·fs
R 0·f 0·2
R1 +
Df
Note: The total detection bandwidth covers the frequency range of fO +Df
d) Calculate value of C1 for a given loop damping factor:
Normally, j = 0.5 is recommended.
1250·C 0
C1 +
R 1·j 2
Increasing C1 improves the out-of-band signal rejection, but increases the PLL capture time.
e) Calculate value of the filter capacitor CD . To avoid chatter at the logic output, with RD = 470KW, CD must be:
C D § 16 C in mF
Df
Design Examples:
C0 + 1 + 1 + 50nF
R 0·f S 20, 000·1, 000
Rev. 3.01
16
XR-2211
c) Calculate R1 to set the bandwidth +Df (See design equation 5):
Note: The total detection bandwidth covers the frequency range of fO +f
d) Calculate value of C0 for a given loop damping factor:
Normally, j = 0.5 is recommended.
1250·C 0
+ 1250·50·10 2 + 6.25pF
–9
C1 +
R 1· 2 400, 000·0.5
Increasing C1 improves the out-of-band signal rejection, but increases the PLL capture time.
e) Calculate value of the filter capacitor CD . To avoid chatter at the logic output, with RD = 470KW, CD must be:
C D + 16 w 16 w 80nF
f 200
VCC
VCC
RF
0.1µF
100K 4
Loop 11 8 3
7 + 1
Phase + CF 2
Detect C1 Demodulated
FSK 11 LM324 Output
Comp
.
R1 10
2 12 Internal
VCO 0.1µF Reference
FM 0.1µF 14 R0
13
Input
C0 6
+ LDOQ
Quad
Phase LDOQN
Detect 5
Lock
Detect
Comp.
Rev. 3.01
17
XR-2211
Linear FM Detection
XR-2211 can be used as a linear FM detector for a wide The FM detector gain, i.e., the output voltage change per
range of analog communications and telemetry unit of FM deviation can be given as:
applications. The recommended circuit connection for
this application is shown in Figure 13. The demodulated
R 1·V REF
output is taken from the loop phase detector output (pin V OUT
100·R 0
11), through a post-detection filter made up of RF and CF,
and an external buffer amplifier. This buffer amplifier is
necessary because of the high impedance output at pin where VR is the internal reference voltage (VREF = VCC /2
11. Normally, a non-inverting unity gain op amp can be - 650mV). For the choice of external components R1, R0,
used as a buffer amplifier, as shown in Figure 13. CD, C1 and CF, see the section on design equations.
V+
1 REF
20K Voltage
Output Input Lock
2 Detect
10
B Filter
From 3
10K 10K VCO 6
B’
Lock Detect
20K
Outputs
5
2K 2K
8
A Timing A’ 11
Capacitor A FSK
From Loop Comparator
13 C0 14 VCO Detector Input 7
B B’ A’ Output
FSK
Data
Output
12
R0 Timing 8K
4 Resistor
Ground
Voltage Controlled Loop Phase Detector FSK Comparator
Oscillator
Rev. 3.01
18
XR-2211
14 8
1 7
D E1
Base A1
Plane A
Seating L
Plane
e c
B B1 α
INCHES MILLIMETERS
SYMBOL MIN MAX MIN MAX
Rev. 3.01
19
XR-2211
14 8
E1
1 7
D E
A2
Seating A
Plane L C
A1 α
B
e B1 eA
eB
INCHES MILLIMETERS
SYMBOL MIN MAX MIN MAX
α 0° 15° 0° 15°
Note: The control dimension is the inch column
Rev. 3.01
20
XR-2211
14 8
E H
1
7
C
A
Seating
Plane α
A1
e B
INCHES MILLIMETERS
SYMBOL MIN MAX MIN MAX
A 0.053 0.069 1.35 1.75
A1 0.004 0.010 0.10 0.25
B 0.013 0.020 0.33 0.51
C 0.007 0.010 0.19 0.25
D 0.337 0.344 8.55 8.75
E 0.150 0.157 3.80 4.00
e 0.050 BSC 1.27 BSC
H 0.228 0.244 5.80 6.20
L 0.016 0.050 0.40 1.27
α 0° 8° 0° 8°
Note: The control dimension is the millimeter column
Rev. 3.01
21
XR-2211
Notes
Rev. 3.01
22
XR-2211
Notes
Rev. 3.01
23
XR-2211
NOTICE
EXAR Corporation reserves the right to make changes to the products contained in this publication in order to im-
prove design, performance or reliability. EXAR Corporation assumes no responsibility for the use of any circuits de-
scribed herein, conveys no license under any patent or other right, and makes no representation that the circuits are
free of patent infringement. Charts and schedules contained here in are only for illustration purposes and may vary
depending upon a user’s specific application. While the information in this publication has been carefully checked;
no responsibility, however, is assumed for inaccuracies.
EXAR Corporation does not recommend the use of any of its products in life support applications where the failure or
malfunction of the product can reasonably be expected to cause failure of the life support system or to significantly
affect its safety or effectiveness. Products are not authorized for use in such applications unless EXAR Corporation
receives, in writing, assurances to its satisfaction that: (a) the risk of injury or damage has been minimized; (b) the
user assumes all such risks; (c) potential liability of EXAR Corporation is adequately protected under the circum-
stances.
Rev. 3.01
24
L293D
L293DD
ORDERING NUMBERS:
DESCRIPTION
The Device is a monolithic integrated high volt- L293DD L293D
age, high current four channel driver designed to
accept standard DTL or TTL logic levels and drive
inductive loads (such as relays solenoides, DC
and stepping motors) and switching power tran-
sistors.
To simplify use as two bridges each pair of chan-
nels is equipped with an enable input. A separate The L293D is assembled in a 16 lead plastic
supply input is provided for the logic, allowing op- packaage which has 4 center pins connected to-
eration at a lower voltage and internal clamp di- gether and used for heatsinking
odes are included. The L293DD is assembled in a 20 lead surface
This device is suitable for use in switching appli- mount which has 8 center pins connected to-
cations at frequencies up to 5 kHz. gether and used for heatsinking.
BLOCK DIAGRAM
SO(12+4+4) Powerdip(12+2+2)
THERMAL DATA
Symbol Decription DIP SO Unit
Rth j-pins Thermal Resistance Junction-pins max. – 14 °C/W
Rth j-amb Thermal Resistance junction-ambient max. 80 50 (*) °C/W
Rth j-case Thermal Resistance Junction-case max. 14 –
(*) With 6sq. cm on board heatsink.
2/7
L293D - L293DD
3/7
L293D - L293DD
Figure 2: Junction to ambient thermal resistance vs. area on board heatsink (SO12+4+4 package)
4/7
L293D - L293DD
mm inch
DIM.
MIN. TYP. MAX. MIN. TYP. MAX.
a1 0.51 0.020
b 0.50 0.020
D 20.0 0.787
E 8.80 0.346
e 2.54 0.100
e3 17.78 0.700
F 7.10 0.280
I 5.10 0.201
L 3.30 0.130
Z 1.27 0.050
5/7
L293D - L293DD
A 2.65 0.104
a2 2.45 0.096
C 0.5 0.020
c1 45 1.772
e 1.27 0.050
e3 11.43 0.450
M 0.75 0.030
S 8° (max.)
6/7
L293D - L293DD
Information furnished is believed to be accurate and reliable. However, SGS-THOMSON Microelectronics assumes no responsibility for the
consequences of use of such information nor for any infringement of patents or other rights of third parties which may result from its use. No
license is granted by implication or otherwise under any patent or patent rights of SGS-THOMSON Microelectronics. Specification mentioned
in this publication are subject to change without notice. This publication supersedes and replaces all information previously supplied.
SGS-THOMSON Microelectronics products are not authorized for use as criticalcomponents in life support devices or systems without express
written approval of SGS-THOMSON Microelectronics.
1996 SGS-THOMSON Microelectronics – Printed in Italy – All Rights Reserved
SGS-THOMSON Microelectronics GROUP OF COMPANIES
Australia - Brazil - Canada - China - France - Germany - Hong Kong - Italy - Japan - Korea - Malaysia - Malta - Morocco - The Netherlands -
Singapore - Spain - Sweden - Switzerland - Taiwan - Thailand - United Kingdom - U.S.A.
7/7
MAX232, MAX232I
DUAL EIA-232 DRIVERS/RECEIVERS
SLLS047I – FEBRUARY 1989 – REVISED OCTOBER 2002
description/ordering information
The MAX232 is a dual driver/receiver that includes a capacitive voltage generator to supply EIA-232 voltage
levels from a single 5-V supply. Each receiver converts EIA-232 inputs to 5-V TTL/CMOS levels. These
receivers have a typical threshold of 1.3 V and a typical hysteresis of 0.5 V, and can accept ±30-V inputs. Each
driver converts TTL/CMOS input levels into EIA-232 levels. The driver, receiver, and voltage-generator
functions are available as cells in the Texas Instruments LinASIC library.
ORDERING INFORMATION
ORDERABLE TOP-SIDE
TA PACKAGE†
PART NUMBER MARKING
PDIP (N) Tube MAX232N MAX232N
Tube MAX232D
SOIC (D) MAX232
Tape and reel MAX232DR
0°C to 70°C
Tube MAX232DW
SOIC (DW) MAX232
Tape and reel MAX232DWR
SOP (NS) Tape and reel MAX232NSR MAX232
PDIP (N) Tube MAX232IN MAX232IN
Tube MAX232ID
SOIC (D) MAX232I
–40°C to 85°C Tape and reel MAX232IDR
Tube MAX232IDW
SOIC (DW) MAX232I
Tape and reel MAX232IDWR
† Package drawings, standard packing quantities, thermal data, symbolization, and PCB design
guidelines are available at www.ti.com/sc/package.
Please be aware that an important notice concerning availability, standard warranty, and use in critical applications of
Texas Instruments semiconductor products and disclaimers thereto appears at the end of this data sheet.
Function Tables
EACH DRIVER
INPUT OUTPUT
TIN TOUT
L H
H L
H = high level, L = low
level
EACH RECEIVER
INPUT OUTPUT
RIN ROUT
L H
H L
H = high level, L = low
level
10 7
T2IN T2OUT
12 13
R1OUT R1IN
9 8
R2OUT R2IN
absolute maximum ratings over operating free-air temperature range (unless otherwise noted)†
Input supply voltage range, VCC (see Note 1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . –0.3 V to 6 V
Positive output supply voltage range, VS+ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . VCC – 0.3 V to 15 V
Negative output supply voltage range, VS– . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . –0.3 V to –15 V
Input voltage range, VI: Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . –0.3 V to VCC + 0.3 V
Receiver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ±30 V
Output voltage range, VO: T1OUT, T2OUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . VS– – 0.3 V to VS+ + 0.3 V
R1OUT, R2OUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . –0.3 V to VCC + 0.3 V
Short-circuit duration: T1OUT, T2OUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Unlimited
Package thermal impedance, θJA (see Note 2): D package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73°C/W
DW package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57°C/W
N package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67°C/W
NS package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64°C/W
Lead temperature 1,6 mm (1/16 inch) from case for 10 seconds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260°C
Storage temperature range, Tstg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . –65°C to 150°C
† Stresses beyond those listed under “absolute maximum ratings” may cause permanent damage to the device. These are stress ratings only, and
functional operation of the device at these or any other conditions beyond those indicated under “recommended operating conditions” is not
implied. Exposure to absolute-maximum-rated conditions for extended periods may affect device reliability.
NOTE 1: All voltage values are with respect to network ground terminal.
2. The package thermal impedance is calculated in accordance with JESD 51-7.
electrical characteristics over recommended ranges of supply voltage and operating free-air
temperature (unless otherwise noted) (see Note 3 and Figure 4)
PARAMETER TEST CONDITIONS MIN TYP‡ MAX UNIT
VCC = 5.5 V, All outputs open,
ICC Supply current 8 10 mA
TA = 25°C
‡ All typical values are at VCC = 5 V and TA = 25°C.
NOTE 3: Test conditions are C1–C4 = 1 µF at VCC = 5 V ± 0.5 V.
DRIVER SECTION
electrical characteristics over recommended ranges of supply voltage and operating free-air
temperature range (see Note 3)
PARAMETER TEST CONDITIONS MIN TYP† MAX UNIT
VOH High-level output voltage T1OUT, T2OUT RL = 3 kΩ to GND 5 7 V
VOL Low-level output voltage‡ T1OUT, T2OUT RL = 3 kΩ to GND –7 –5 V
ro Output resistance T1OUT, T2OUT VS+ = VS– = 0, VO = ±2 V 300 Ω
IOS§ Short-circuit output current T1OUT, T2OUT VCC = 5.5 V, VO = 0 ±10 mA
IIS Short-circuit input current T1IN, T2IN VI = 0 200 µA
† All typical values are at VCC = 5 V, TA = 25°C.
‡ The algebraic convention, in which the least positive (most negative) value is designated minimum, is used in this data sheet for logic voltage
levels only.
§ Not more than one output should be shorted at a time.
NOTE 3: Test conditions are C1–C4 = 1 µF at VCC = 5 V ± 0.5 V.
RECEIVER SECTION
electrical characteristics over recommended ranges of supply voltage and operating free-air
temperature range (see Note 3)
PARAMETER TEST CONDITIONS MIN TYP† MAX UNIT
VOH High-level output voltage R1OUT, R2OUT IOH = –1 mA 3.5 V
VOL Low-level output voltage‡ R1OUT, R2OUT IOL = 3.2 mA 0.4 V
Receiver positive-going input
VIT+ R1IN, R2IN VCC = 5 V, TA = 25°C 1.7 2.4 V
threshold voltage
Receiver negative-going input
VIT– R1IN, R2IN VCC = 5 V, TA = 25°C 0.8 1.2 V
threshold voltage
Vhys Input hysteresis voltage R1IN, R2IN VCC = 5 V 0.2 0.5 1 V
ri Receiver input resistance R1IN, R2IN VCC = 5, TA = 25°C 3 5 7 kΩ
† All typical values are at VCC = 5 V, TA = 25°C.
‡ The algebraic convention, in which the least positive (most negative) value is designated minimum, is used in this data sheet for logic voltage
levels only.
NOTE 3: Test conditions are C1–C4 = 1 µF at VCC = 5 V ± 0.5 V.
R1OUT RL = 1.3 kΩ
R1IN
or
or
Pulse R2OUT See Note C
R2IN
Generator
(see Note A)
CL = 50 pF
(see Note B)
TEST CIRCUIT
≤10 ns ≤10 ns
3V
90% 90%
Input 50% 50%
10% 10%
0V
500 ns
tPLH
tPHL
VOH
Output 1.5 V 1.5 V
VOL
WAVEFORMS
NOTES: A. The pulse generator has the following characteristics: ZO = 50 Ω, duty cycle ≤ 50%.
B. CL includes probe and jig capacitance.
C. All diodes are 1N3064 or equivalent.
Figure 1. Receiver Test Circuit and Waveforms for tPHL and tPLH Measurements
TEST CIRCUIT
≤10 ns ≤10 ns
3V
90% 90%
Input 50% 50%
10% 10%
0V
5 µs
tPLH
tPHL
90% VOH
90%
Output
10% 10%
VOL
tTHL tTLH
+
0.8 (V – V ) 0.8 (V – V )
OH OL OL OH
SR or
t t
TLH THL
WAVEFORMS
NOTES: A. The pulse generator has the following characteristics: ZO = 50 Ω, duty cycle ≤ 50%.
B. CL includes probe and jig capacitance.
Figure 2. Driver Test Circuit and Waveforms for tPHL and tPLH Measurements (5-µs Input)
Pulse
Generator EIA-232 Output
(see Note A)
3 kΩ CL = 2.5 nF
TEST CIRCUIT
≤10 ns ≤10 ns
Input
90% 90%
10% 1.5 V 1.5 V 10%
20 µs
tTLH
tTHL
VOH
3V 3V
Output
–3 V –3 V
VOL
SR +t 6 V
or t
THL TLH
WAVEFORMS
NOTE A: The pulse generator has the following characteristics: ZO = 50 Ω, duty cycle ≤ 50%.
Figure 3. Test Circuit and Waveforms for tTHL and tTLH Measurements (20-µs Input)
APPLICATION INFORMATION
5V
+
CBYPASS = 1 µF
–
16
C3† 1 µF
VCC
1 2
C1+ 8.5 V
C1 1 µF 3 VS+
C1–
4 6
VS– –8.5 V
C2+
C2 1 µF 5 C4 1 µF
C2– +
11 14
EIA-232 Output
From CMOS or TTL
10 7
EIA-232 Output
12 13
EIA-232 Input
To CMOS or TTL
9 8
EIA-232 Input
0V
15
GND
† C3 can be connected to VCC or GND.
Texas Instruments Incorporated and its subsidiaries (TI) reserve the right to make corrections, modifications,
enhancements, improvements, and other changes to its products and services at any time and to discontinue
any product or service without notice. Customers should obtain the latest relevant information before placing
orders and should verify that such information is current and complete. All products are sold subject to TI’s terms
and conditions of sale supplied at the time of order acknowledgment.
TI warrants performance of its hardware products to the specifications applicable at the time of sale in
accordance with TI’s standard warranty. Testing and other quality control techniques are used to the extent TI
deems necessary to support this warranty. Except where mandated by government requirements, testing of all
parameters of each product is not necessarily performed.
TI assumes no liability for applications assistance or customer product design. Customers are responsible for
their products and applications using TI components. To minimize the risks associated with customer products
and applications, customers should provide adequate design and operating safeguards.
TI does not warrant or represent that any license, either express or implied, is granted under any TI patent right,
copyright, mask work right, or other TI intellectual property right relating to any combination, machine, or process
in which TI products or services are used. Information published by TI regarding third–party products or services
does not constitute a license from TI to use such products or services or a warranty or endorsement thereof.
Use of such information may require a license from a third party under the patents or other intellectual property
of the third party, or a license from TI under the patents or other intellectual property of TI.
Reproduction of information in TI data books or data sheets is permissible only if reproduction is without
alteration and is accompanied by all associated warranties, conditions, limitations, and notices. Reproduction
of this information with alteration is an unfair and deceptive business practice. TI is not responsible or liable for
such altered documentation.
Resale of TI products or services with statements different from or beyond the parameters stated by TI for that
product or service voids all express and any implied warranties for the associated TI product or service and
is an unfair and deceptive business practice. TI is not responsible or liable for any such statements.
Mailing Address:
Texas Instruments
Post Office Box 655303
Dallas, Texas 75265
www.datasheetcatalog.com