Alat Pengukur Kecepatan Dengan Mikrokontroler.

ABSTRAK
Salah satu teori fisika yang sering dipraktekkan adalah teori gerak lurus
beraturan. Uji coba pengukuran yang dilakukan di laboratorium fisika masih
menggunakan cara yang konvensional, yaitu dengan menggunakan stopwatch
sebagai alat untuk mengukur waktu tempuh dari objek yang bergerak lurus
beraturan.
Pada tugas akhir ini dirancang dan direalisasikan suatu alat pengukur
kecepatan menggunakan gelombang ultrasonik dengan mikrokontroler. Alat ukur
ini terbagi dalam tiga bagian yaitu bagian pemancar, bagian penerima dan bagian
pengolah data berupa mikrokontroler yang kemudian akan menampilkan
kecepatan dari suatu sasaran/objek yang bergerak lurus beraturan dalam satuan
cm/s.
Dari hasil percobaan dan pengujian yang dilakukan, alat pengukur
kecepatan dengan mikrokontroler ini memberikan kesalahan rata-rata terendah
sebesar 0.5% pada kecepatan sasaran/objek 40 cm/s.

i

ABSTRACT
One of physic teory that is often be practiced are the teory of straight
movement. The measurement in physic laboratory are still use a conventional

method, using a stopwatch to measure the time of a object which move in straight
line.
In this final project will design and realized a device which measure the
velocity using a ultrasonic wave with microcontroller. This dev
ice divided into three section that are transmitter section, receiver section
and data proccessing section which will showing a velocity from the object who
move straight on cm/s.
From the experiment, the result are the device which measure the velocity
with microcontroller give a minimum error 0.50% with the velocity 40 cm/s.

ii

DAFTAR ISI

ABSTRAK ................................................................................................................... i
ABSTRACT ................................................................................................................. ii
KATA PENGANTAR ...................................................................................................iii
DAFTAR ISI ................................................................................................................ v
DAFTAR GAMBAR ...............................................................................................


viii

DAFTAR TABEL ....................................................................................................

ix

BAB I

PENDAHULUAN ....................................................................................... 1

1.1

Latar Belakang ............................................................................................. 1
1.2

Identifikasi Masalah ............................................................ 1

1.3

Tujuan ................................................................................... 2


1.4

Pembatasan Masalah ........................................................... 2

1.5

Sistematika Penulisan .......................................................... 2

BAB II

LANDASAN TEORI .................................................................................... 3

2.1

Mikrokontroler AT89C2051 ....................................................................... 3
2.1.1

Mode Pengalamatan ....................................................................... 6
2.1.1.1


Pengalamatan Langsung (Direct Addresing)...................... 6

2.1.1.2

Pengalamatan Tak Langsung (Indirect Addresing) .......... 6

2.1.1.3

Instruksi-Instruksi Register .............................................. 7

2.1.1.4

Instruksi-Instruksi Register Khusus.................................. 7

v

2.1.2

2.1.1.5


Konstanta Segera (Immediate Constants) ........................ 8

2.1.1.6

Pengalamatan Terindeks (Indexed Addresing)................. 8

Instruksi-Instruksi Dalam AT89C2051 ............................................ 8

2.1.3 Pewaktu CPU .................................................................................. 14
2.2

Seven Segment ............................................................................................14
2.2.1

Cara Kerja Seven Segment ..............................................................14

2.3

Gelombang Ultrasonik ................................................................................16


2.4

Transduser ultrasonik ..................................................................................17

2.5

BAB III

2.4.1

Transduser Mekanik .......................................................................18

2.4.2

Transduser Elektromekanik .......................................................... 18

Efek Doppler .............................................................................................. 22

PERANCANGAN DAN REALISASI ..................................................... 24


3.1

Pendahuluan .............................................................................................. 24

3.2

Rancangan Perangkat Keras Sistem ......................................................... 25

3.3

Transduser Ultrasonik ............................................................................... 26

3.4

Rangkaian Pemancar.................................................................................. 27

3.5

Rangkaian Penerima ................................................................................. 29


3.6

Rangkaian Sistem Mikrokontroler AT89C2051........................................ 31

3.7

Rangkaian Catu Daya .............................................................................. 33

3.8

Diagram Alir ............................................................................................ 34
3.8.1

3.9

Penjelasan Diagram Alir ............................................................... 35

Pengukuran Selang Waktu .......................................................................36


vi

BAB IV

PERCOBAAN DAN PENGUKURAN ...................................................38

4.1

Percobaan Dan Pengukuran .....................................................................38

4.2

Pembahasan ............................................................................................. 41

BAB V KESIMPULAN DAN SARAN ………….................................................42
5.1

Kesimpulan ………………………………….............…........................42

5.2


Saran ………………………………........................……........................42

DAFTAR PUSTAKA ..............................................................................................44

LAMPIRAN A


Foto Alat Pengukur Kecepatan Dengan Mikrokontroler .......................A-1

LAMPIRAN B


Skema Rangkaian Alat Pengukur Kecepatan Dengan Mikrokontroler B-1

LAMPIRAN C


Listing Program ....................................................................................C-1


LAMPIRAN D


Datasheet Komponen ............................................................................D-1

vii

DAFTAR GAMBAR

Gambar 2.1 Diagram Blok AT89C2051......................................................................… 4
Gambar 2.2 Konfigurasi Pin AT89C2051 ........................................................….......... 5
Gambar 2.3 Hubungan Kekristal ...................................................................................14
Gambar 2.4 Clock Eksternal ……………………………………………………..........14
Gambar 2.5 Penampil Seven Segment ………………………………………...............15
Gambar 2.6 Transduser Kumparan Bergerak.................................................................19
Gambar 2.7 Transduser Elektrostatik ……………………………...............….............20
Gambar 2.8 Transduser Piezoelektrik ………………...................................................21
Gambar 2.9 Permukaan Gelombang Yang Dipancarkan Sumber Bergerak ….............23
Gambar 3.1 Diagram Blok Sistem ……………………………………………............24
Gambar 3.2 Skematik Diagram Pengukuran Transduser Ultrasonik ...........................26
Gambar 3.3 Diagram Blok Rangkaian Pemancar .........................................................27
Gambar 3.4 Rangkaian Pemancar Ultrasonik ...............................................................28
Gambar 3.5 Diagram Blok Rangkaian Penerima ..........................................................29
Gambar 3.6 Rangkaian Penerima Ultrasonik ………………………………................29
Gambar 3.7 Rangkaian Sistem Mikrokontroler AT89C2051 .....................…..............31
Gambar 3.8 Rangkaian Power Supply .................................................................….....33
Gambar 3.9 Pengukuran Selang Waktu ........................................................................39
Gambar 4.1 Grafik Prosentase Error Rata-Rata Untuk Tiap Kecepatan ......................40

viii

DAFTAR TABEL

Tabel 2.1 Daftar Instruksi Aritmatika Mikrokontroler AT89C2051 ..............................9
Tabel 2.2 Daftar Instruksi Logik Mikrokontroler AT89C2051 .....................................11
Tabel 2.3 Instruksi-Instruksi Lompatan ………….........................................................13
Tabel 2.4 Instruksi-Instruksi Lompatan ………………………………..…...................13
Tabel 2.5 Tampilan Angka Pada Seven Segment …………………………..................15
Tabel 4.3 Perbandingan Hasil Pengukuran Alat Ukur ……………………….............. 38

ix

Foto 1 : Bagian Atas dari Alat

Foto 2 : Bagian Depan dari Alat

A-1

Foto 3 : Bagian Dalam dari Alat

A-2

MCUV. ASM
; - - Di s p l a y
Di s Da t
PS1
PS2
PS3
PS4
dg1
dg2
dg3
dg4

Po r t
EQU
BI T
BI T
BI T
BI T
EQU
EQU
EQU
EQU

& RAMs - - ;
P1
P3 . 0
P3 . 1
P3 . 2
P3 . 3
08h
09h
0 Ah
0 Bh

APa r 2
APa r 1
SPa r 2
SPa r 1
MPa r 2
MPa r 1
DPa r 2
DPa r 1

EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU

0 Ch
0 Dh
0 Eh
0 Fh
10h
11h
12h
13h

RBa k 2
RBa k 1

EQU 1 4 h
EQU 1 5 h

J 1_2
J 1_1
J 2_2
J 2_1

EQU
EQU
EQU
EQU

16h
17h
18h
19h

p 5 0 ms
EQU 2 0 h
FLAG
EQU 2 1 h
Sd h 5
BI T FLAG. 0
; - - Ot h e r s Po r t & RAMs - - ;
SOu t
BI T P3 . 4
SI n
BI T P3 . 5
Bu t t o n BI T P3 . 7
;-----------------------------------------------------------------------------or g 00h
j mp mu l a i
o r g 0 Bh
j mp T0 _ Ve c t
;-----------------------------------------------------------------------------mu l a i :
; - - I n i s i a l i s a s i Va r & Po r t
mo v SP, # 2 2 h
mo v Di s Da t , # 0 FFh
s e t b PS1
s e t b PS2
s e t b PS3
s e t b PS4
s e t b SOu t
s e t b SI n
mo v d g 4 , # 1 0 h
mo v d g 3 , # 1 0 h
mo v d g 2 , # 1 0 h
mo v d g 1 , # 1 0 h
; - - I n i s i a l i s a s i Ti me r
mo v TMOD, # 5 1 h
c l r TR1
c l r TR0
c l r ET1
c l r ET0
ul a ng:
Pa g e 1

MCUV. ASM
; - - - Te mb a k a n Pe r t a ma
mo v TH0 , # 0 0 h
mo v TL0 , # 0 0 h
mo v TH1 , # 0 0 h
mo v TL1 , # 0 0 h
c l r TF0
s e t b TR1
s e t b TR0
mo v b , # 4 0
a mb i l _ f r e k :
c p l SOu t
nop
nop
nop
nop
nop
nop
nop
nop
nop
d j n z b , a mb i l _ f r e k
;--t unggu:
mo v a , TL1
j nz da pa t
j n b TF0 , t u n g g u
c l r TR1
c l r TR0
j mp u l a n g
da pa t :
c l r TR0
c l r TR1
; - - - Si mp a n J a r a k - 1
mo v J 1 _ 2 , TH0
mo v J 1 _ 1 , TL0

;
;
;
;
;
;
;
;

; - - - Tu n g g u 5 0 0 ms
c l r Sd h 5
mo v TH0 , # 0 3 Ch
mo v TL0 , # 0 B0 h
mo v p 5 0 ms , # 1 0
s e t b TR0
s e t b ET0
s e t b EA
d l y 5 0 0 ms :
c a l l s h o w7 s
j n b Sd h 5 , d l y 5 0 0 ms
mo v R0 , # 1 0
d l y 5 0 0 ms _ 1 :
mo v R1 , # 1 0 0
d l y 5 0 0 ms _ 2 :
mo v R2 , # 2 4 5
d j n z R2 , $
d j n z R1 , d l y 5 0 0 ms _ 2
d j n z R0 , d l y 5 0 0 ms _ 1

; 1

( R0 = x )

; x

( R1 = y )

;
;
;
;

y * x ( R2 = z )
2*z *y*x
2*y*x
2*x

; - - - Te mb a k a n Ke d u a
mo v TH0 , # 0 0 h
mo v TL0 , # 0 0 h
mo v TH1 , # 0 0 h
mo v TL1 , # 0 0 h
c l r TF0
s e t b TR1
s e t b TR0
Pa g e 2

MCUV. ASM
mo v b , # 4 0
a mb i l _ f r e k 2 :
c p l SOu t
nop
nop
nop
nop
nop
nop
nop
nop
nop
d j n z b , a mb i l _ f r e k 2
;--t unggu2:
mo v a , TL1
j nz da pa t 2
j n b TF0 , t u n g g u 2
c l r TR1
c l r TR0
j mp u l a n g
da pa t 2:
c l r TR0
c l r TR1
; - - - Hi t u n g J a r a k - 2
mo v d p h , TH0
mo v d p l , TL0
mo v DPa r 2 , # 0
mo v DPa r 1 , # 1 2 5
c a l l di v_i nt
mo v
mo v
cal l
mo v
mo v

MPa r 2 ,
MPa r 1 ,
mu l _ i
J 2_2,
J 2_1,

#0
#2
nt
dph
dpl

; - - - Hi t u n g J a r a k - 1
mo v d p h , J 1 _ 2
mo v d p l , J 1 _ 1
mo v DPa r 2 , # 0
mo v DPa r 1 , # 1 2 5
c a l l di v_i nt
mo v
mo v
cal l
mo v
mo v

MPa r 2 ,
MPa r 1 ,
mu l _ i
J 1_2,
J 1_1,

#0
#2
nt
dph
dpl

; - - Ce k Ma n a Ya n g Be s a r
mo v a , J 2 _ 2
cl r c
s ubb a , J 1_2
j c J 2 _ Le b i h _ Ke c i l
j n z J 2 _ Le b i h _ Be s a r
mo v a , J 2 _ 1
cl r c
s ubb a , J 1_1
j c J 2 _ Le b i h _ Ke c i l
j n z J 2 _ Le b i h _ Be s a r
; - - J a r a k Sa ma , V = c m/ s
Pa g e 3

MCUV. ASM
mo v
mo v
mo v
mo v
j mp

dg4, #0
dg3, #0
dg2, #0
dg1, #0
ul a ng

J 2 _ Le b i h _ Ke c i l :
mo v d p h , J 1 _ 2
mo v d p l , J 1 _ 1
mo v SPa r 2 , J 2 _ 2
mo v SPa r 1 , J 2 _ 1
c a l l s ubb_i nt
j mp Ub a h _ Ke De s i ma l
J 2 _ Le b i h _ Be s a r :
mo v d p h , J 2 _ 2
mo v d p l , J 2 _ 1
mo v SPa r 2 , J 1 _ 2
mo v SPa r 1 , J 1 _ 1
c a l l s ubb_i nt
Ub a h _ Ke De s i ma l :
; - - Ka l i 2 Du l u
mo v MPa r 2 , # 0
mo v MPa r 1 , # 2
c a l l mu l _ i n t
; - - Ya n g a k a n d i t a mp i l k a n
mo v RBa k 2 , d p h
; Rb - Rs - Pl - St
mo v RBa k 1 , d p l
; Amb i l Ri b u a n
mo v DPa r 2 , # 0 0 3 h
mo v DPa r 1 , # 0 E8 h
c a l l di v_i nt
mo v d g 4 , d p l
; Amb i l r a t u s a n
mo v MPa r 2 , # 0 0 3 h
mo v MPa r 1 , # 0 E8 h
c a l l mu l _ i n t
mo v SPa r 2 , d p h
mo v SPa r 1 , d p l
mo v d p h , RBa k 2
mo v d p l , RBa k 1
c a l l s ubb_i nt
mo v RBa k 2 , d p h
mo v RBa k 1 , d p l
mo v DPa r 2 , # 0
mo v DPa r 1 , # 1 0 0
c a l l di v_i nt
mo v d g 3 , d p l
; Amb i l Pu l u h a n
mo v MPa r 2 , # 0
mo v MPa r 1 , # 1 0 0
c a l l mu l _ i n t
mo v SPa r 2 , d p h
mo v SPa r 1 , d p l
mo v d p h , RBa k 2
mo v d p l , RBa k 1
c a l l s ubb_i nt
mo v RBa k 2 , d p h
mo v RBa k 1 , d p l

; Rb - Rs - Pl - St / 1 0 0 0 = Rb
; Ge t

; Rb * 1 0 0 0

; Rb - Rs - Pl - St - Rb * 1 0 0 0 = Rs - Pl - St
; Rs - Pl - St

; Rs - Pl - St / 1 0 0 = Rs
; Ge t

; Rs * 1 0 0

; Rs - Pl - St - Rs * 1 0 0 = Pl - St
; Pl - St
Pa g e 4

MCUV. ASM
mo v DPa r 2 , # 0
mo v DPa r 1 , # 1 0
c a l l di v_i nt
mo v d g 2 , d p l
; Amb i l Sa t u a n
mo v MPa r 2 , # 0
mo v MPa r 1 , # 1 0
c a l l mu l _ i n t
mo v SPa r 2 , d p h
mo v SPa r 1 , d p l
mo v d p h , RBa k 2
mo v d p l , RBa k 1
c a l l s ubb_i nt
mo v d g 1 , d p l

; Pl - St / 1 0 = Pl
; Ge t

; Pl * 1 0

; Pl - St - Pl * 1 0 = St
; Ge t

j mp u l a n g
;-----------------------------------------------------------------------------T0 _ Ve c t :
pus h ps w
c l r TR0
mo v TH0 , # 0 3 Ch
mo v TL0 , # 0 B0 h
s e t b TR0
d j n z p 5 0 ms , T0 _ Ve c t _ En d
c l r TR0
c l r ET0
c l r EA
s e t b Sd h 5
T0 _ Ve c t _ En d :
pop ps w
r et i
;-----------------------------------------------------------------------------dl y_ke y:
; - - De l a y Sa mp a i To mb o l Di l e p a s
pus h 0h
pus h 1h
dk_ul a ng:
mo v R0 , # 2 0 0
dl y_ke y_:
c a l l s h o w7 s
d j n z R0 , d l y _ k e y _
j n b Bu t t o n , d k _ u l a n g
pop 1h
pop 0h
r et
;-----------------------------------------------------------------------------s h o w7 s :
; - - Ta mp i l k a n An g k a Ke Di s p l a y
pus h a c c
pus h 0h
mo v d p t r , # d b 7 s
; - - Sh o w Di g i t - 4
mo v a , d g 4
mo v c a , @a +d p t r
mo v Di s Da t , a
c l r PS4
c a l l dl y7s
s e t b PS4
; - - Sh o w Di g i t - 3
Pa g e 5

MCUV. ASM
mo v a , d g 3
mo v c a , @a +d p t
mo v Di s Da t , a
c l r PS3
c a l l dl y7s
s e t b PS3
; - - Sh o w Di g i t
mo v a , d g 2
mo v c a , @a +d p t
mo v Di s Da t , a
c l r PS2
c a l l dl y7s
s e t b PS2
; - - Sh o w Di g i t
mo v a , d g 1
mo v c a , @a +d p t
mo v Di s Da t , a
c l r PS1
c a l l dl y7s
s e t b PS1
pop 0h
pop a c c
r et

r

-2
r

-1
r

dl y7s :
; - - De l a y Ta h a n
mo v R0 , # 1 0 0
d j n z R0 , $
r et
db7s :
; - - Da t a Ba s e Ko mb i n a s i Se g me n
;
- gf e dc ba
db 11000000b ; 0
db 11111001b ; 1
db 10100100b ; 2
db 10110000b ; 3
db 10011001b ; 4
db 10010010b ; 5
db 10000010b ; 6
db 11111000b ; 7
db 10000000b ; 8
db 10010000b ; 9
db 10001000b ; A
db 10000011b ; B
db 11000110b ; C
db 10100001b ; D
db 10000110b ; E
db 10001110b ; F
d b 1 1 1 1 1 1 1 1 b ; Bl a n k ( 1 7 )
;-------------------------------------------------------------------------------;
a dd_i nt :
; [ DPH: DPL] + [ APa r 2 : APa r 1 ] - > [ DPH: DPL]
pus h a c c
mo v a , APa r 1
a dd a , dpl
mo v d p l , a
mo v a , APa r 2
a ddc a , dph
mo v d p h , a
pop a c c
r et
;-------------------------------------------------------------------------------;
s ubb_i nt :
Pa g e 6

MCUV. ASM
; [ DPH: DPL] - [ SPa r 2 : SPa r 1 ] - > [ DPH: DPL]
pus h a c c
cl r c
mo v a , d p l
s u b b a , SPa r 1
mo v d p l , a
mo v a , d p h
s u b b a , SPa r 2
mo v d p h , a
pop a c c
r et
;-------------------------------------------------------------------------------;
mu l _ i n t :
; [ DPH: DPL] X [ MPa r 2 : MPa r 1 ] - > [ DPH: DPL]
pus h a c c
pus h b
mo v a , d p l
mo v b , MPa r 1
mu l a b
xc h a , dpl
pus h b
mo v b , MPa r 2
mu l a b
pop b
a dd a , b
xc h a , dph
mo v b , MPa r 1
mu l a b
a dd a , dph
mo v d p h , a
pop b
pop a c c
r et
;-------------------------------------------------------------------------------;
di v_i nt :
; [ DPH: DPL] / [ DPa r 2 : DPa r 1 ] - > [ DPH: DPL]
pus h a c c
pus h b
pus h 2h
pus h 3h
pus h 4h
mo v r 2 , # 1 6
cl r a
mo v r 3 , a
mo v r 4 , a
di _l oop:
mo v a , d p l
a dd a , a c c
mo v d p l , a
mo v a , d p h
rlc a
mo v d p h , a
mo v a , r 3
rlc a
mo v r 3 , a
mo v a , r 4
rlc a
mo v r 4 , a
mo v a , r 3
s u b b a , DPa r 1
mo v b , a
mo v a , r 4
Pa g e 7

MCUV. ASM
s u b b a , DPa r 2
j c d i _ s ma l l e r
mo v r 4 , a
mo v r 3 , b
or l dpl , #1
d i _ s ma l l e r :
dj nz r 2, di _l oop
pop 4h
pop 3h
pop 2h
pop b
pop a c c
r et
e nd

Pa g e 8

Features
• Compatible with MCS-51™ Products
• 2K Bytes of Reprogrammable Flash Memory












– Endurance: 1,000 Write/Erase Cycles
2.7V to 6V Operating Range
Fully Static Operation: 0 Hz to 24 MHz
Two-level Program Memory Lock
128 x 8-bit Internal RAM
15 Programmable I/O Lines
Two 16-bit Timer/Counters
Six Interrupt Sources
Programmable Serial UART Channel
Direct LED Drive Outputs
On-chip Analog Comparator
Low-power Idle and Power-down Modes

Description
The AT89C2051 is a low-voltage, high-performance CMOS 8-bit microcomputer with
2K bytes of Flash programmable and erasable read only memory (PEROM). The
device is manufactured using Atmel’s high-density nonvolatile memory technology
and is compatible with the industry-standard MCS-51 instruction set. By combining a
versatile 8-bit CPU with Flash on a monolithic chip, the Atmel AT89C2051 is a powerful microcomputer which provides a highly-flexible and cost-effective solution to many
embedded control applications.

8-bit
Microcontroller
with 2K Bytes
Flash
AT89C2051

The AT89C2051 provides the following standard features: 2K bytes of Flash, 128
bytes of RAM, 15 I/O lines, two 16-bit timer/counters, a five vector two-level interrupt
architecture, a full duplex serial port, a precision analog comparator, on-chip oscillator
and clock circuitry. In addition, the AT89C2051 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 contents but freezes the oscillator disabling all other chip functions until the next
hardware reset.

Pin Configuration
PDIP/SOIC
RST/VPP
(RXD) P3.0
(TXD) P3.1
XTAL2
XTAL1
(INT0) P3.2
(INT1) P3.3
(TO) P3.4
(T1) P3.5
GND

1
2
3
4
5
6
7
8
9
10

20
19
18
17
16
15
14
13
12
11

VCC
P1.7
P1.6
P1.5
P1.4
P1.3
P1.2
P1.1 (AIN1)
P1.0 (AIN0)
P3.7

Rev. 0368E–02/00

1

Block Diagram

2

AT89C2051

AT89C2051
Pin Description

Each machine cycle takes 12 oscillator or clock cycles.
XTAL1

VCC

Input to the inverting oscillator amplifier and input to the
internal clock operating circuit.

Supply voltage.
GND

XTAL2

Ground.

Output from the inverting oscillator amplifier.

Port 1
Port 1 is an 8-bit bi-irectional I/O port. Port pins P1.2 to
P1.7 provide internal pullups. P1.0 and P1.1 require external pullups. P1.0 and P1.1 also serve as the positive input
(AIN0) and the negative input (AIN1), respectively, of the
on-chip precision analog comparator. The Port 1 output
buffers can sink 20 mA and can drive LED displays directly.
When 1s are written to Port 1 pins, they can be used as
inputs. When pins P1.2 to P1.7 are used as inputs and are
externally pulled low, they will source current (IIL) because
of the internal pullups.

Oscillator Characteristics

Port 1 also receives code data during Flash programming
and verification.

XTAL1 and XTAL2 are the input and output, respectively,
of an inverting amplifier which can be configured for use as
an on-chip oscillator, as shown in Figure 1. 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 2.
There are no requirements 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.

Port 3

Figure 1. Oscillator Connections

Port 3 pins P3.0 to P3.5, P3.7 are seven bi-irectional I/O
pins with internal pullups. P3.6 is hard-wired as an input to
the output of the on-chip comparator and is not accessible
as a general purpose I/O pin. The Port 3 output buffers can
sink 20 mA. When 1s are written to Port 3 pins they are
pulled high by the internal pullups and can be used as
inputs. As inputs, Port 3 pins that are externally being
pulled low will source current (IIL) because of the pullups.
Port 3 also serves the functions of various special features
of the AT89C2051 as listed below:
Port Pin

Alternate Functions

P3.0

RXD (serial input port)

P3.1

TXD (serial output port)

P3.2

INT0 (external interrupt 0)

P3.3

INT1 (external interrupt 1)

P3.4

T0 (timer 0 external input)

P3.5

T1 (timer 1 external input)

Note:

C1, C2 = 30 pF ± 10 pF for Crystals
= 40 pF ± 10 pF for Ceramic Resonators

Figure 2. External Clock Drive Configuration

Port 3 also receives some control signals for Flash programming and verification.
RST
Reset input. All I/O pins are reset to 1s as soon as RST
goes high. Holding the RST pin high for two machine
cycles while the oscillator is running resets the device.
3

Special Function Registers
A map of the on-chip memory area called the Special Function Register (SFR) space is shown in the table below.

random data, and write accesses will have an indeterminate effect.

Note that not all of the addresses are occupied, and unoccupied addresses may not be implemented on the chip.
Read accesses to these addresses will in general return

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.

Table 1. AT89C2051 SFR Map and Reset Values
0F8H
0F0H

0FFH
B
00000000

0F7H

0E8H
0E0H

0EFH
ACC
00000000

0E7H

0D8H
0D0H

0DFH
PSW
00000000

0D7H

0C8H

0CFH

0C0H

0C7H

0B8H

IP
XXX00000

0BFH

0B0H

P3
11111111

0B7H

0A8H

IE
0XX00000

0AFH

0A0H
98H

SCON
00000000

90H

P1
11111111

88H

TCON
00000000

80H

4

0A7H
SBUF
XXXXXXXX

9FH
97H

TMOD
00000000

TL0
00000000

TL1
00000000

SP
00000111

DPL
00000000

DPH
00000000

AT89C2051

TH0
00000000

TH1
00000000

8FH
PCON
0XXX0000

87H

AT89C2051
Restrictions on Certain Instructions

Program Memory Lock Bits

The AT89C2051 and is an economical and cost-effective
member of Atmel’s growing family of microcontrollers. It
contains 2K bytes of flash program memory. It is fully compati bl e with the MCS-51 arc hitec tur e, and c an be
programmed using the MCS-51 instruction set. However,
there are a few considerations one must keep in mind
when utilizing certain instructions to program this device.

On the chip are two lock bits which can be left unprogrammed (U) or can be programmed (P) to obtain the
additional features listed in the table below:

All the instructions related to jumping or branching should
be restricted such that the destination address falls within
the physical program memory space of the device, which is
2K for the AT89C2051. This should be the responsibility of
the software programmer. For example, LJMP 7E0H
would be a valid instruction for the AT89C2051 (with 2K of
memory), whereas LJMP 900H would not.
1. Branching instructions:
LCALL, LJMP, ACALL, AJMP, SJMP, JMP @A+DPTR
These unconditional branching instructions will execute
correctly as long as the programmer keeps in mind that the
destination branching address must fall within the physical
boundaries of the program memory size (locations 00H to
7FFH for the 89C2051). Violating the physical space limits
may cause unknown program behavior.
CJNE [...], DJNZ [...], JB, JNB, JC, JNC, JBC, JZ, JNZ With
these conditional branching instructions the same rule
above applies. Again, violating the memory boundaries
may cause erratic execution.
For applications involving interrupts the normal interrupt
service routine address locations of the 80C51 family architecture have been preserved.
2. MOVX-related instructions, Data Memory:
The AT89C2051 contains 128 bytes of internal data memory. Thus, in the AT89C2051 the stack depth is limited to
128 bytes, the amount of available RAM. External DATA
memory access is not supported in this device, nor is external PROGRAM memory execution. Therefore, no MOVX
[...] instructions should be included in the program.
A typical 80C51 assembler will still assemble instructions,
even if they are written in violation of the restrictions mentioned above. It is the responsibility of the controller user to
know the physical features and limitations of the device
being used and adjust the instructions used
correspondingly.

Lock Bit Protection Modes(1)
Program Lock Bits
LB1

LB2

1

U

U

No program lock features.

2

P

U

Further programming of the Flash
is disabled.

3

P

P

Same as mode 2, also verify is
disabled.

Note:

Protection Type

1. The Lock Bits can only be erased with the Chip Erase
operation.

Idle Mode
In idle mode, the CPU puts itself to sleep while all the onchip peripherals remain active. The mode is invoked by
software. The content of the on-chip RAM and all the special functions registers remain unchanged during this
mode. The idle mode can be terminated by any enabled
interrupt or by a hardware reset.
P1.0 and P1.1 should be set to “0” if no external pullups are
used, or set to “1” if external pullups are used.
It should be noted that when idle is terminated by a hardware reset, the device normally resumes program
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 is
terminated by reset, the instruction following the one that
invokes Idle should not be one that writes to a port pin or to
external memory.

Power-down Mode
In the power down mode the oscillator is stopped, and the
instruction that invokes power down is the last instruction
executed. The on-chip RAM and Special Function Registers retain their values until the power down mode is
terminated. The only exit from power down is a hardware
reset. 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.
P1.0 and P1.1 should be set to “0” if no external pullups are
used, or set to “1” if external pullups are used.
5

Programming The Flash
The AT89C2051 is shipped with the 2K bytes of on-chip
PEROM code memory array in the erased state (i.e., contents = FFH) and ready to be programmed. The code
memory array is programmed one byte at a time. Once the
array is programmed, to re-program any non-blank byte,
the entire memory array needs to be erased electrically.
Internal Address Counter: The AT89C2051 contains an
internal PEROM address counter which is always reset to
000H on the rising edge of RST and is advanced by applying a positive going pulse to pin XTAL1.
Programming Algorithm: To program the AT89C2051,
the following sequence is recommended.
1. Power-up sequence:
Apply power between VCC and GND pins
Set RST and XTAL1 to GND
2. Set pin RST to “H”
Set pin P3.2 to “H”
3. Apply the appropriate combination of “H” or “L” logic
levels to pins P3.3, P3.4, P3.5, P3.7 to select one of the
programming operations shown in the PEROM Programming Modes table.
To Program and Verify the Array:
4. Apply data for Code byte at location 000H to P1.0 to
P1.7.
5. Raise RST to 12V to enable programming.
6. Pulse P3.2 once to program a byte in the PEROM array
or the lock bits. The byte-write cycle is self-timed and
typically takes 1.2 ms.
7. To verify the programmed data, lower RST from 12V to
logic “H” level and set pins P3.3 to P3.7 to the appropiate
levels. Output data can be read at the port P1 pins.
8. To program a byte at the next address location, pulse
XTAL1 pin once to advance the internal address
counter. Apply new data to the port P1 pins.
9. Repeat steps 5 through 8, changing data and advancing
the address counter for the entire 2K bytes array or until
the end of the object file is reached.
10.Power-off sequence:
set XTAL1 to “L”
set RST to “L”
Turn VCC power off
Data Polling: The AT89C2051 features Data Polling to
indicate the end of a write cycle. During a write cycle, an
attempted read of the last byte written will result in the complement of the written data on P1.7. Once the write cycle
has been completed, true data is valid on all outputs, and

6

AT89C2051

the next cycle may begin. Data Polling may begin any time
after a write cycle has been initiated.
Ready/Busy: The Progress of byte programming can also
be monitored by the RDY/BSY output signal. Pin P3.1 is
pulled low after P3.2 goes High during programming to indicate BUSY. P3.1 is pulled High again when programming is
done to indicate READY.
Program Verify: If lock bits LB1 and LB2 have not been
programmed code data can be read back via the data lines
for verification:
1. Reset the internal address counter to 000H by bringing
RST from “L” to “H”.
2. Apply the appropriate control signals for Read Code data
and read the output data at the port P1 pins.
3. Pulse pin XTAL1 once to advance the internal address
counter.
4. Read the next code data byte at the port P1 pins.
5. Repeat steps 3 and 4 until the entire array is read.
The lock bits cannot be verified directly. Verification of the
lock bits is achieved by observing that their features are
enabled.
Chip Erase: The entire PEROM array (2K bytes) and the
two Lock Bits are erased electrically by using the proper
combination of control signals and by holding P3.2 low for
10 ms. The code array is written with all “1”s in the Chip
Erase operation and must be executed before any nonblank memory byte can be re-programmed.
Reading the Signature Bytes: The signature bytes are
read by the same procedure as a normal verification of
locations 000H, 001H, and 002H, except that P3.5 and
P3.7 must be pulled to a logic low. The values returned are
as follows.
(000H) = 1EH indicates manufactured by Atmel
(001H) = 21H indicates 89C2051

Programming Interface
Every code byte in the Flash array can be written and the
entire array can be erased by using the appropriate combination of control signals. The write operation cycle is selftimed and once initiated, will automatically time itself to
completion.
All major programming vendors offer worldwide support for
the Atmel microcontroller series. Please contact your local
programming vendor for the appropriate software revision.

AT89C2051
Flash Programming Modes
Mode

RST/VPP

Write Code Data

(1)(3)

12V

Read Code Data(1)
Write Lock

H

H

P3.3

P3.4

P3.5

P3.7

L

H

H

H

L

L

H

H

Bit - 1

12V

H

H

H

H

Bit - 2

12V

H

H

L

L

H

L

L

L

L

L

L

L

Chip Erase

Read Signature Byte
Notes:

P3.2/PROG

12V

(2)

H

H

1. The internal PEROM address counter is reset to 000H on the rising edge of RST and is advanced by a positive pulse at
XTAL 1 pin.
2. Chip Erase requires a 10 ms PROG pulse.
3. P3.1 is pulled Low during programming to indicate RDY/BSY.

Figure 3. Programming the Flash Memory

Figure 4. Verifying the Flash Memory

PP

7

Flash Programming and Verification Characteristics
TA = 0°C to 70°C, VCC = 5.0 ± 10%
Symbol

Parameter

Min

Max

Units

VPP

Programming Enable Voltage

11.5

12.5

V

IPP

Programming Enable Current

250

µA

tDVGL

Data Setup to PROG Low

1.0

µs

tGHDX

Data Hold after PROG

1.0

µs

tEHSH

P3.4 (ENABLE) High to VPP

1.0

µs

tSHGL

VPP Setup to PROG Low

10

µs

tGHSL

VPP Hold after PROG

10

µs

tGLGH

PROG Width

1

tELQV

ENABLE Low to Data Valid

tEHQZ

Data Float after ENABLE

tGHBL

110

µs

1.0

µs

1.0

µs

PROG High to BUSY Low

50

ns

tWC

Byte Write Cycle Time

2.0

ms

tBHIH

RDY/BSY\ to Increment Clock Delay

tIHIL
Note:

1.

Increment Clock High
Only used in 12-volt programming mode.

Flash Programming and Verification Waveforms

8

AT89C2051

0

1.0

µs

200

ns

AT89C2051
Absolute Maximum Ratings*
Operating Temperature ................................. -55°C to +125°C

*NOTICE:

Storage Temperature ..................................... -65°C to +150°C
Voltage on Any Pin
with Respect to Ground .....................................-1.0V to +7.0V
Maximum Operating Voltage ............................................ 6.6V

Stresses beyond those listed under “Absolute
Maximum Ratings” may cause permanent damage to the device. This is a stress rating only and
functional operation of the device at these or any
other conditions beyond those indicated in the
operational sections of this specification is not
implied. Exposure to absolute maximum rating
conditions for extended periods may affect device
reliability.

DC Output Current...................................................... 25.0 mA

DC Characteristics
TA = -40°C to 85°C, VCC = 2.0V to 6.0V (unless otherwise noted)
Symbol

Parameter

Condition

VIL

Input Low-voltage

VIH

Input High-voltage

(Except XTAL1, RST)

VIH1

Input High-voltage

(XTAL1, RST)

VOL

Output Low-voltage(1)
(Ports 1, 3)

IOL = 20 mA, VCC = 5V
IOL = 10 mA, VCC = 2.7V

VOH

Output High-voltage
(Ports 1, 3)

IOH = -80 µA, VCC = 5V ± 10%

Min

Max

Units

-0.5

0.2 VCC - 0.1

V

0.2 VCC + 0.9

VCC + 0.5

V

0.7 VCC

VCC + 0.5

V

0.5

V

2.4

V

IOH = -30 µA

0.75 VCC

V

IOH = -12 µA

0.9 VCC

V

IIL

Logical 0 Input Current
(Ports 1, 3)

VIN = 0.45V

-50

µA

ITL

Logical 1 to 0 Transition Current
(Ports 1, 3)

VIN = 2V, VCC = 5V ± 10%

-750

µA

ILI

Input Leakage Current
(Port P1.0, P1.1)

0 < VIN < VCC

±10

µA

VOS

Comparator Input Offset Voltage

VCC = 5V

20

mV

VCM

Comparator Input Common
Mode Voltage

0

VCC

V

RRST

Reset Pull-down Resistor

50

300

KΩ

CIO

Pin Capacitance

Test Freq. = 1 MHz, TA = 25°C

10

pF

ICC

Power Supply Current

Active Mode, 12 MHz, VCC = 6V/3V

15/5.5

mA

Idle Mode, 12 MHz, VCC = 6V/3V
P1.0 & P1.1 = 0V or VCC

5/1

mA

VCC = 6V P1.0 & P1.1 = 0V or VCC

100

µA

Power-down Mode(2)
Notes:

VCC = 3V P1.0 & P1.1 = 0V or VCC
20
µA
1. Under steady state (non-transient) conditions, IOL must be externally limited as follows:
Maximum IOL per port pin: 20 mA
Maximum total IOL for all output pins: 80 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.

9

External Clock Drive Waveforms

External Clock Drive
VCC = 2.7V to 6.0V
Symbol

Parameter

1/tCLCL

Oscillator Frequency

tCLCL

Clock Period

tCHCX

VCC = 4.0V to 6.0V

Min

Max

Min

Max

0

12

0

24

Units
MHz

83.3

41.6

ns

High Time

30

15

ns

tCLCX

Low Time

30

15

ns

tCLCH

Rise Time

20

20

ns

tCHCL

Fall Time

20

20

ns

10

AT89C2051

AT89C2051
()

Serial Port Timing: Shift Register Mode Test Conditions
VCC = 5.0V ± 20%; Load Capacitance = 80 pF
12 MHz Osc
Max

Variable Oscillator

Symbol

Parameter

Min

Min

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-117

ns

tXHDX

Input Data Hold after Clock Rising Edge

0

0

ns

tXHDV

Clock Rising Edge to Input Data Valid

700

Max

10tCLCL-133

Units

ns

Shift Register Mode Timing Waveforms

AC Testing Input/Output Waveforms(1)

Float Waveforms(1)

Note:

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.

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 100 mV change frothe
loaded VOH/VOL level occurs.

11

AT89C2051
TYPICAL ICC - ACTIVE (85°C)
20
Vcc=6.0V

I 15
C
C 10
m
A

Vcc=5.0V
Vcc=3.0V

5

0
0

6

12

18

24

FREQUENCY (MHz)

AT89C2051
TYPICAL ICC - IDLE (85°C)
3
Vcc=6.0V

I
C 2
C

Vcc=5.0V

m 1
A
Vcc=3.0V
0
0

3

6

9

12

FREQUENCY (MHz)

AT89C2051
TYPICAL ICC vs. VOLTAGE- POWER DOWN (85°C)
20

I 15
C
C 10
µ
A

5

0
3.0V

4.0V

5.0V

Vcc VOLTAGE

Notes:

12

1. XTAL1 tied to GND for ICC (power-down)
2. P.1.0 and P1.1 = VCC or GND
3. Lock bits programmed

AT89C2051

6.0V

AT89C2051
Ordering Information
Speed
(MHz)

Power
Supply

12

2.7V to 6.0V

24

4.0V to 6.0V

Ordering Code

Package

Operation Range

AT89C2051-12PC
AT89C2051-12SC

20P3
20S

Commercial
(0°C to 70°C)

AT89C2051-12PI
AT89C2051-12SI

20P3
20S

Industrial
(-40°C to 85°C)

AT89C2051-24PC
AT89C2051-24SC

20P3
20S

Commercial
(0°C to 70°C)

AT89C2051-24PI
AT89C2051-24SI

20P3
20S

Industrial
(-40°C to 85°C)

Package Type
20P3

20-lead, 0.300” Wide, Plastic Dual In-line Package (PDIP)

20S

20-lead, 0.300” Wide, Plastic Gull Wing Small Outline (SOIC)

13

Packaging Information
20P3, 20-lead, 0.300" Wide, Plastic Dual Inline
Package (PDIP)
Dimensions in Inches and (Millimeters)

20S, 20-lead, 0.300" Wide, Plastic Gull WIng Small
Outline (SOIC)
Dimensions in Inches and (Millimeters)

JEDEC STANDARD MS-001 AD
1.060(26.9)
.980(24.9)

0.020 (0.508)
0.013 (0.330)

PIN
1

.280(7.11)
.240(6.10)

0.299 (7.60) 0.420 (10.7)
0.291 (7.39) 0.393 (9.98)
PIN 1

.090(2.29)
MAX

.900(22.86) REF

.050 (1.27) BSC

.210(5.33)
MAX

.005(.127)
MIN

SEATING
PLANE

.110(2.79)
.090(2.29)

.070(1.78)
.045(1.13)

0 REF
15
.430(10.92) MAX

14

0.105 (2.67)
0.092 (2.34)

.022(.559)
.014(.356)

.325(8.26)
.300(7.62)
.014(.356)
.008(.203)

0.513 (13.0)
0.497 (12.6)

.015(.381) MIN

.150(3.81)
.115(2.92)

AT89C2051

0.012 (0.305)
0.003 (0.076)

0
REF
8

0.013 (0.330)
0.009 (0.229)

0.035 (0.889)
0.015 (0.381)

Atmel Headquarters

Atmel Operations

Corporate Headquarters

Atmel Colorado Springs

2325 Orchard Parkway
San Jose, CA 95131
TEL (408) 441-0311
FAX (408) 487-2600

Europe

1150 E. Cheyenne Mtn. Blvd.
Colorado Springs, CO 80906
TEL (719) 576-3300
FAX (719) 540-1759

Atmel Rousset

Atmel U.K., Ltd.
Coliseum Business Centre
Riverside Way
Camberley, Surrey GU15 3YL
England
TEL (44) 1276-686-677
FAX (44) 1276-686-697

Zone Industrielle
13106 Rousset Cedex
France
TEL (33) 4-4253-6000
FAX (33) 4-4253-6001

Asia
Atmel Asia, Ltd.
Room 1219
Chinachem Golden Plaza
77 Mody Road Tsimhatsui
East Kowloon
Hong Kong
TEL (852) 2721-9778
FAX (852) 2722-1369

Japan
Atmel Japan K.K.
9F, Tonetsu Shinkawa Bldg.
1-24-8 Shinkawa
Chuo-ku, Tokyo 104-0033
Japan
TEL (81) 3-3523-3551
FAX (81) 3-3523-7581

Fax-on-Demand
North America:
1-(800) 292-8635
International:
1-(408) 441-0732

e-mail
literature@atmel.com

Web Site
http://www.atmel.com

BBS
1-(408) 436-4309
© Atmel Corporation 2000.
Atmel Corporation makes no warranty for the use of its products, other than those expressly contained in the Company’s standard warranty which is detailed in Atmel’s Terms and Conditions located on the Company’s web site. The Company assumes no responsibility for
any errors which may appear in this document, reserves the right to change devices or specifications detailed herein at any time without
notice, and does not make any commitment to update the information contained herein. No licenses to patents or other intellectual property of Atmel are granted by the Company in connection with the sale of Atmel products, expressly or by implication. Atmel’s products are
not authorized for use as critical components in life suppor t devices or systems.
Marks bearing

®

and/or



are registered trademarks and trademarks of Atmel Corporation.

Terms and product names in this document may be trademarks of others.

Printed on recycled paper.
0368E–02/00/xM

LM358, LM258, LM2904,
LM2904A, LM2904V,
NCV2904
Single Supply Dual
Operational Amplifiers
Utilizing the circuit designs perfected for Quad Operational
Amplifiers, these dual operational amplifiers feature low power drain,
a common mode input voltage range extending to ground/VEE, and
single supply or split supply operation. The LM358 series is
equivalent to one−half of an LM324.
These amplifiers have several distinct advantages over standard
operational amplifier types in single supply applications. They can
operate at supply voltages as low as 3.0 V or as high as 32 V, with
quiescent currents about one−fifth of those associated with the
MC1741 (on a per amplifier basis). The common mode input range
includes the negative supply, thereby eliminating the necessity for
external biasing components in many applications. The output voltage
range also includes the negative power supply voltage.
Features












http://onsemi.com

PDIP−8
N, AN, VN SUFFIX
CASE 626

8
1

SOIC−8
D, VD SUFFIX
CASE 751

8
1

Micro8]
DMR2 SUFFIX
CASE 846A

8

Short Circuit Protected Outputs
True Differential Input Stage
Single Supply Operation: 3.0 V to 32 V
Low Input Bias Currents
Internally Compensated
Common Mode Range Extends to Negative Supply
Single and Split Supply Operation
ESD Clamps on the Inputs Increase Ruggedness of the Device
without Affecting Operation
Pb−Free Packages are Available
NCV Prefix for Automotive and Other Applications Requiring Site
and Control Changes

1

PIN CONNECTIONS
Output A
Inputs A
VEE/Gnd

1

8

2

7

4


+ 5


+
3

6

VCC
Output B
Inputs B

(Top View)

ORDERING INFORMATION
See detailed ordering and shipping information in the package
dimensions section on page 10 of this data sheet.

DEVICE MARKING INFORMATION
See general marking information in the device marking
section on page 11 of this data sheet.

 Semiconductor Components Industries, LLC, 2004

July, 2004 − Rev. 18

1

Publication Order Number:
LM358/D

LM358, LM258, LM2904, LM2904A, LM2904V, NCV2904
3.0 V to VCC(max)

VCC

VCC

1

1

2

2

1.5 V to VCC(max)

1.5 V to VEE(max)
VEE

VEE/Gnd

Single Supply

Split Supplies
Figure 1.

Output

Bias Circuitry
Common to Both
Amplifiers
VCC

Q15
Q16

Q22

Q14
Q13
40 k

Q19
5.0 pF

Q12

Q24
25

Q23

Q20

Q18
Inputs

Q11
Q9
Q21

Q17

Q6
Q2

Q25

Q7

Q5

Q1
Q10

Q8
Q3

Q4

Q26

2.4 k

2.0 k
VEE/Gnd

Figure 2. Representative Schematic Diagram
(One−Half of Circuit Shown)

http://onsemi.com
2

LM358, LM258, LM2904, LM2904A, LM2904V, NCV2904
MAXIMUM RATINGS (TA = +25°C, unless otherwise noted.)
Symbol

Value

VCC
VCC, VEE

32
±16

Input Differential Voltage Range (Note 1)

VIDR

±32

Vdc

Input Common Mode Voltage Range (Note 2)

VICR

−0.3 to 32

Vdc

Output Short Circuit Duration

tSC

Continuous

Junction Temperature

TJ

150

°C

RJA

238

°C/W

Storage Temperature Range

Tstg

−55 to +125

°C

ESD Protection at any Pin
Human Body Model
Machine Model

Vesd

Rating
Power Supply Voltages
Single Supply
Split Supplies

Unit
Vdc

Thermal Resistance, Junction−to−Air (Note 3)

V
2000
200

Operating Ambient Temperature Range

°C

TA
LM258
LM358
LM2904/LM2904A
LM2904V, NCV2904 (Note 4)

−25 to +85
0 to +70
−40 to +105
−40 to +125

Maximum ratings are those values beyond which device damage can occur. Maximum ratings applied to the device are individual stress limit
values (not normal operating conditions) and are not valid simultaneously. If these limits are exceeded, device functional operation is not implied,
damage may occur and reliability may be affected.
1. Split Power Supplies.
2. For Supply Voltages less than 32 V the absolute maximum input voltage is equal to the supply voltage.
3. RJA for Case 846A.
4. NCV2904 is qualified for automotive use.

http://onsemi.com
3

LM358, LM258, LM2904, LM2904A, LM2904V, NCV2904
ELECTRICAL CHARACTERISTICS (VCC = 5.0 V, VEE = GND, TA = 25°C, unless otherwise noted.)
LM258
Characteristic
Input Offset Voltage
VCC = 5.0 V to 30 V, VIC = 0 V to VCC −1.7 V,
VO ] 1.4 V, RS = 0 
TA = 25°C
TA = Thigh (Note 5)
TA = Tlow (Note 5)

Min

Symbol

Typ

LM358
Max

Min

Typ

Max

VIO

Unit
mV





2.0



5.0
7.0
7.0





2.0



7.0
9.0
9.0

VIO/T



7.0





7.0



V/°C

IIO






3.0

−45
−50

30
100
−150
−300






5.0

−45
−50

50
150
−250
−500

nA

IIO/T



10





10



pA/°C

Input Common Mode Voltage Range (Note 6),
VCC = 30 V
VCC = 30 V, TA = Thigh to Tlow

VICR

0



28.3

0



28.3

V

0



28

0



28

Differential Input Voltage Range

VIDR





VCC





VCC

Large Signal Open Loop Voltage Gain
RL = 2.0 k, VCC = 15 V, For Large VO Swing,
TA = Thigh to Tlow (Note 5)

AVOL
50
25

100





25
15

100





CS



−120





−120



dB

Common Mode Rejection
RS ≤ 10 k

CMR

70

85



65

70



dB

Power Supply Rejection

PSR

65

100



65

100



dB

Output Voltage−High Limit
TA = Thigh to Tlow (Note 5)
VCC = 5.0 V, RL = 2.0 k, TA = 25°C
VCC = 30 V, RL = 2.0 k
VCC = 30 V, RL = 10 k

VOH

Output Voltage−Low Limit
VCC = 5.0 V, RL = 10 k,
TA = Thigh to Tlow (Note 5)

Average Temperature Coefficient of Input Offset
Voltage
TA = Thigh to Tlow (Note 5)
Input Offset Current
TA = Thigh to Tlow (Note 5)
Input Bias Current
TA = Thigh to Tlow (Note 5)
Average Temperature Coefficient of Input Offset
Current
TA = Thigh to Tlow (Note 5)

Channel Separation
1.0 kHz ≤ f ≤ 20 kHz, Input Referenced

IIB

V
V/mV

V
3.3
26
27

3.5

28





3.3
26
27

3.5

28





VOL



5.0

20



5.0

20

mV

Output Source Current
VID = +1.0 V, VCC = 15 V

IO+

20

40



20

40



mA

Output Sink Current
VID = −1.0 V, VCC = 15 V
VID = −1.0 V, VO = 200 mV

IO−
10
12

20
50




10
12

20
50




mA
A

Output Short Circuit to Ground (Note 7)

ISC



40

60



40

60

mA

Power Supply Current (Total Device)
TA = Thigh to Tlow (Note 5)
VCC = 30 V, VO = 0 V, RL = ∞
VCC = 5 V, VO = 0 V, RL = ∞

ICC

mA



1.5
0.7

3.0
1.2




1.5
0.7

3.0
1.2

5. LM258: Tlow = −25°C, Thigh = +85°C
LM358: Tlow = 0°C, Thigh = +70°C
LM2904/LM2904A: Tlow = −40°C, Thigh = +105°C
LM2904V & NCV2904: Tlow = −40°C, Thigh = +125°C
NCV2904 is qualified for automotive use.
6. The input common mode voltage or either input signal voltage should not be allowed to go negative by more than 0.3 V. The upper end of
the common mode voltage range is VCC − 1.7 V.
7. Short circuits from the output to VCC can cause excessive heating and eventual destruction. Destructive dissipation can result from
simultaneous shorts on all amplifiers.

http://onsemi.com
4

LM358, LM258, LM2904, LM2904A, LM2904V, NCV2904
ELECTRICAL CHARACTERISTICS (VCC = 5.0 V, VEE = Gnd, TA = 25°C, unless otherwise noted.)
LM2904
Characteristic
Input Offset Voltage
VCC = 5.0 V to 30 V, VIC = 0 V to VCC −1.7 V,
VO ] 1.4 V, RS = 0 
TA = 25°C
TA = Thigh (Note 8)
TA = Tlow (Note 8)

Symbol

Min

Typ

LM2904A
Max

Min

Typ

LM2904V, NCV2904

Max

Min

Typ

Max

VIO

Unit
mV





2.0



7.0
10
10





2.0



7.0
10
10









7.0
13
10

VIO/T



7.0





7.0





7.0



V/°C

IIO






5.0
45
−45
−50

50
200
−250
−500






5.0
45
−45
−50

50
200
−100
−250






5.0
45
−45
−50

50
200
−250
−500

nA

IIO/T



10





10





10



pA/°C

Input Common Mode Voltage Range (Note 9),
VCC = 30 V
VCC = 30 V, TA = Thigh to Tlow

VICR

0



24.3

0



24.3

0



24.3

V

0



24

0



24

0



24

Differential Input Voltage Range

VIDR





VCC





VCC





VCC

Large Signal Open Loop Voltage Gain
RL = 2.0 k, VCC = 15 V, For Large VO Swing,
TA = Thigh to Tlow (Note 8)

AVOL
25
15

100





25
15

100





25
15

100





CS



−120





−120





−120



dB

Common Mode Rejection
RS ≤ 10 k

CMR

50

70



50

70



50

70



dB

Power Supply Rejection

PSR

50

100



50

100



50

100



dB

Output Voltage−High Limit
TA = Thigh to Tlow (Note 8)
VCC = 5.0 V, RL = 2.0 k, TA = 25°C
VCC = 30 V,