Trabajo Oe#4
Trabajo Oe#4
Trabajo Oe#4
SALOME LOAIZA
SANTIAGO ACOSTA
MAURICIO LPEZ
ALEJANDRO CAICEDO
TELECOMUNICACIONES
SENA
MELI
A. El TIMER0
B. PRESCALER
Estos micros disponen de un contador de 8bit como prescaler para el mdulo Timer0. El
prescaler no se puede leer o escribir directamente; su valor se fija con los bits PSA y
T0PS2:T0PS0 (T0CON<3: 0>), los cules determinan el divisor del prescaler y la
prescaler van de 1:2 a 1:256, con incrementos de potencias de 2. Cuando est activo el
mdulo Timer0, todas las instrucciones que escriben en l (ej., CLRF TMR0, MOVWF,
cambiar su asignacin.
C. SEAL DE RELOJ
Con un cristal de 4 MHz tienes un periodo de reloj de 1/4 MHz = 0.25 us
Como cada ciclo mquina son 4 ciclos de reloj, tienes un ciclo mquina de 0.25 us * 4 = 1
us.
La idea es buscar que el timer interrumpa cada cierto tiempo x,y que ese tiempo x sea
divisor exacto de 1 segundo, por ejemplo 25 us, 100 us, 2 ms, 10 ms, etc...
Adems de esto, habr que usar una variable contador que se ir incrementando cada vez
que el timer se desborde, comprobando su valor cada vez que esto sucede y as llevar el
Dispositivos pueden ser operados en doce modos de oscilador distintos. En contraste con las
anteriores micro controladores mejorados PIC18, cuatro de estos modos implican el uso de dos
tipos de oscilador a la vez. Los usuarios pueden programar el FOSC3: FOSC0 Configuracin bits
1. Cristal / Resonador XT
8. INTHS Oscilador interno utilizado como fuente del reloj del micro controlador, HS oscilador
9. INTIO Oscilador interno utilizado como fuente del reloj del micro controlador, EC oscilador
10. INTCKO Oscilador interno utilizado como fuente del reloj del micro controlador, EC
5 Bajo para escribir en el registro; Alto para leer del registro Read/write
Enva datos a los pines de datos cuando se le da un pulso alto a
6 Enable
bajo
7 DB0
8 DB1
9 DB2
10 DB3
8 bit dato de pin
11 DB4
12 DB5
13 DB6
14 DB7
15 Iluminar desde el fondo VCC (5V) Led+
16 Iluminar desde el fondo tierra (0V) Led-
F. PUENTE H
Una vez que hemos explicado el motor de CC, vamos a realizar una prctica para que
En esta prctica, controlaremos un motor de corriente continua mediante el integrado L298, que
Lo primero de todo ser el diseo del circuito del puente H, ya que disponemos del integrado,
pero hay que disear una PCB para poder implementar los diodos de proteccin as como crear el
controladores de motor actan como amplificadores de corriente, ya que toman una seal de
control de baja corriente y proporcionan una seal de corriente ms alta. Esta seal de corriente
L293D contiene dos circuitos integrados del conductor del puente de H. En su modo de
tanto en direccin hacia adelante como en sentido inverso. Las operaciones de motor de dos
motores pueden ser controladas por la lgica de entrada en los pines 2 y 7 y 10 y 15. La lgica de
entrada 00 11 detendr el motor correspondiente. La lgica 01 y 10 la girarn en sentido
Los pins de activacin 1 y 9 (correspondientes a los dos motores) deben ser altos para que los
asociado se activa. Como resultado, las salidas se activan y trabajan en fase con sus entradas. De
forma similar, cuando la entrada de habilitacin es baja, ese controlador est deshabilitado y sus
Features
Wide SingleSupply Range: 2.0 Vdc to 36 Vdc
SplitSupply Range: 1.0 Vdc to 18 Vdc
Very Low Current Drain Independent of Supply Voltage: 0.4 mA
Low Input Bias Current: 25 nA
Low Input Offset Current: 5.0 nA
Low Input Offset Voltage: 5.0 mV (max) LM293/393
Input Common Mode Range to Ground Level
Differential Input Voltage Range Equal to Power Supply Voltage
Output Voltage Compatible with DTL, ECL, TTL, MOS, and CMOS Logic Levels
ESD Clamps on the Inputs Increase the Ruggedness of the Device without Affecting Performance
NCV Prefix for Automotive and Other Applications Requiring Site and Control Changes
PbFree Packages are Available
V
CC + Input - Input Output
R2
2.1 k
Q4
R4 Q5 Q6
Q3 Q14
2.0 k
F1
Q10
Q9 Q16
Q1
Q8 Q12
Q2 Q15
Q11
R1
4.6 k
http://onsemi.com
PDIP8
N SUFFIX
8 CASE 626
1
SOIC8
8 D SUFFIX
CASE 751
1
Micro8
8 DM SUFFIX
1 CASE 846A
PIN CONNECTIONS
Output A 1 8 V
CC
2 7 Output B
Inputs A3 + 6
+
GND 4 5 Inputs B
(Top View)
DEVICE MARKING & ORDERING
INFORMATION
See detailed ordering and shipping information and marking information in the package dimensions section on pages 6 and 7 of this data sheet.
MAXIMUM RATINGS
Rating Symbol Value Unit
V
Power Supply Voltage CC +36 or 18 Vdc
V
Input Differential Voltage Range IDR 36 Vdc
V
Input Common Mode Voltage Range ICR 0.3 to +36 Vdc
I
Output Short CircuittoGround SC Continuous mA
I
Output Sink Current (Note 1) Sink 20
Power Dissipation @ TA = 25C PD 570 mW
1/R
Derate above 25C JA 5.7 mW/C
Operating Ambient Temperature Range TA C
LM293 25 to +85
LM393 0 to +70
LM2903 40 to +105
LM2903V, NCV2903 (Note 2) 40 to +125
T
Maximum Operating Junction Temperature J(max) C
LM393, 2903, LM2903V 150
LM293, NCV2903 150
T
Storage Temperature Range stg 65 to +150 C
V
ESD Protection at any Pin esd V
Human Body Model 2000
Machine Model 200
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. The maximum output current may be as high as 20 mA, independent of the magnitude of V CC, output short circuits to VCC can cause
excessive heating and eventual destruction.
2. NCV2903 is qualified for automotive use.
http://onsemi.com
2
LM393, LM293, LM2903, LM2903V, NCV2903
ELECTRICAL CHARACTERISTICS (VCC = 5.0 Vdc, Tlow TA Thigh, unless otherwise noted.)
LM2903, LM2903V,
LM293, LM393 NCV2903
http://onsemi.com
3
LM393, LM293, LM2903, LM2903V, NCV2903
LM293/393 LM2903
80 80
70 70 T
= -40 C
A
60 60
0 0
0 5.0 10 15 20 0 5.0 10 15 20 25 30 35 40
VCC, SUPPLY VOLTAGE VCC, SUPPLY VOLTAGE
(Vdc) (Vdc)
Figure 2. Input Bias Figure 3. Input Bias
Current versus Current versus
Power Supply Voltage Power Supply Voltage
10 10
Out of Out of
(Vdc)
(Vdc)
Saturation Saturation
VOLTAGE
VOLTAGE
1.0 1.0 TA = +85 C
TA = +125C
,SATURATION
,SATURATION
0.1 0.1
TA = +25 C TA = -55 C TA = +25 C
0.01 0.01 TA = 0 C
VOL
VOL
TA = -40 C
0.001 0.001
0.01 0.1 1.0 10 100 0.010.1 1.0
ISink, OUTPUT SINK CURRENT (mA) ISink, OUTPUT SINK CURRENT (mA)
1.0
TA = -55 C
,SUPPLYCURRENT(mA)
SUPPLYCURRENT(mA)
1.2
0.8 0.4
TA = 0 C
TA = +125C
TA = +25 C 1.0
0.6
TA = +70 C 0.8
0.6
I CC
IC ,
C
0.2
RL =
0.4
0
5.0 10 15 20 25 3035 40 0 5.0 10 15 20 25
VCC, SUPPLY VOLTAGE (Vdc) VCC, SUPPLY VOLTAGE (Vdc
Figure 6. Power Supply Current versus Figure 7. Power Supply Current ver
Power Supply Voltage Power Supply Voltage
http://onsemi.com
4
LM393, LM293, LM2903, LM2903V, NCV2903
APPLICATIONS INFORMATION
The addition of positive
These dual comparators feedback (< 10 mV) is also
feature high gain, wide recommended. It is good
bandwidth characteristics. design practice to ground
This gives the device
oscillation tendencies if the all unused pins.
outputs are capacitively Differential input voltages
coupled to the inputs via may be larger than supply
stray capacitance. This voltage without damaging
oscillation manifests itself the comparator's inputs.
during output transitions Voltages more negative
(VOL to VOH). To alleviate than 0.3 V should not be
this situation, input resistors used.
< 10 k should be used.
R4 R5
Vin
R1 V
8.2 k 220 k 220 k 10 k in(min)
V
in
R1 6.8 k LM393
+V
D1 R2 CC
15 k 10 k
R3
V LM393 V
in CC
D1 prevents input from going
negative by more than 0.6 V.
VO
-VEE
R1 + R2 = R3
- VEE
R3 R5 for small error in zero crossing.
10 Vin(min) 0.4 V peak
for 1% phase
distortion (
).
Figure 9. Zero
Figure 8. Zero Crossing
Crossing Detector
Detector (Split Supply)
(Single
Supply) V
CC
VCC
t R
1.0 M L
-
LM393
+ VC VO
-
V
CC 0.001 F LM393
+
51 k ``ON'' for t tO + t
where: V
ref
V V
51 k CC t = RC n ( V ref
51 k CC
V V
C 0 tO V
ref
-
Figure 10. FreeRunning LM393
SquareWave Oscillator +
R1
V
ref
R2
RS
Figure 11. Time Delay
Generator
V
CC
RS = R1 | | R2
RL
V =V (VCC -Vref) R1
th1 ref + R1 + R2 + RL
MARKING DIAGRAMS
PDIP8 Micro8
N SUFFIX DM SUFFIX
CASE 626 CASE 846A
8 8
8 8
LM393N LM2903N
AWL AWL x93 2903
YYWW YYWW AYW AYW
1 1
1 1
SOIC8
D SUFFIX
CASE 751
8 8 8
LMx93 2903 2903V
ALYW 1 ALYW 1 ALYW *
1
x = 2 or 3
A = Assembly Location
WL, L = Wafer Lot
YY, Y = Year
WW, W = Work Week
*This marking diagram also applies to NCV2903DR2.
http://onsemi.com
6
LM393, LM293, LM2903, LM2903V, NCV2903
ORDERING INFORMATION
Device Package Shipping
LM293D SOIC8 98 Units / Rail
LM293DR2 SOIC8 2500 Units / Reel
LM293DR2G SOIC8
(PbFree)
LM293DMR2 Micro8 4000 Tape and Reel
LM393D SOIC8 98 Units / Rail
LM393DG SOIC8
(PbFree)
LM393DR2 SOIC8 2500 Units / Reel
LM393DR2G SOIC8
(PbFree)
LM393N PDIP8 50 Units / Rail
LM393NG PDIP8
(PbFree)
LM393DMR2 Micro8 4000 Tape and Reel
LM393DMR2G Micro8
(PbFree)
LM2903D SOIC8 98 Units / Reel
LM2903DR2 SOIC8 2500 Units /Reel
LM2903N PDIP8 50 Units / Rail
LM2903DMR2 Micro8 4000 Tape and Reel
LM2903VD SOIC8 98 Units / Reel
LM2903VDG SOIC8
(PbFree)
LM2903VDR2 SOIC8 2500 Units /Reel
LM2903VDR2G SOIC8
(PbFree)
LM2903VN PDIP8 50 Units / Rail
NCV2903DR2 (Note 9) SOIC8 2500 Tape and Reel
NCV2903DR2G (Note 9) SOIC8
(PbFree)
NCV2903DMR2 (Note 9) Micro8 4000 Tape and Reel
http://onsemi.com
7
LM393, LM293, LM2903, LM2903V, NCV2903
PACKAGE DIMENSIONS
PDIP8
N SUFFIX
CASE 62605
ISSUE L
NOTES:
1. DIMENSION L TO
CENTER OF
LEAD WHEN
FORMED
8 5 PARALLEL.
2. PACKAGE CONTOUR
OPTIONAL
B (ROUND OR
SQUARE
1 4 CORNERS).
3. DIMENSIONING
AND
TOLERANCIN
F G PER ANSI
Y14.5M, 1982.
NOTE 2 A
L
T J
SEATING N
PLANE
M
D K
H G
M M
0.13 (0.005) T A
MILLIMETERS INCHES
DIM MIN MAX MIN MAX
A 9.40 10.16 0.370 0.400
B 6.10 6.60 0.240 0.260
C 3.94 4.45 0.155 0.175
D 0.38 0.51 0.015 0.020
F 1.02 1.78 0.040 0.070
G 2.54 BSC 0.100 BSC
H 0.76 1.27 0.030 0.050
J 0.20 0.30 0.008 0.012
K 2.92 3.43 0.115 0.135
L 7.62 BSC 0.300 BSC
M --- 10 --- 10
N 0.76 1.01 0.030 0.040
http://onsemi.com
8
LM393, LM293, LM2903, LM2903V, NCV2903
SOIC8
D SUFFIX
CASE 75107
ISSUE AC
NOTES:
1. DIMENSIONING
X AND
TOLERANCING
A PER ANSI
Y14.5M, 1982.
2. CONTROLLING
8 DIMENSION:
M MILLIMETER.
5 0.25 (0.010) Y M
3. DIMENSION A AND B
DO NOT INCLUDE
B K
MOLD PROTRUSION.
4. MAXIMUM MOLD
S PROTRUSION 0.15
1 (0.006)
4 PER SIDE.
5. DIMENSION D DOES
Y C N NOT INCLUDE
X 45 DAMBAR
PROTRUSION.
G SEATING ALLOWABLE DAMBAR
PLANE PROTRUSION SHALL BE
0.127 (0.005) TOTAL
IN EXCESS OF THE D
0.10 (0.004) DIMENSION AT
M MAXIMUM MATERIAL
Z J CONDITION.
6. 75101 THRU 75106
ARE OBSOLETE.
NEW STANDARD
H D S XS IS 75107.
M
0.25 (0.010)
Z Y
MILLIMETERSINCHES
DIM MIN MAX MIN MAX
A 4.80 5.00 0.189 0.197
B 3.80 4.00 0.150 0.157
C 1.35 1.75 0.053 0.069
D 0.33 0.51 0.013 0.020
G 1.27 BSC 0.050 BSC
H 0.10 0.25 0.004 0.010
J 0.19 0.25 0.007 0.010
K 0.40 1.27 0.016 0.050
0 80 8
M
N 0.25 0.50 0.010 0.020
S 5.80 6.20 0.228 0.244
SOLDERING FOOTPRINT*
1.52
0.060
7.0 4.0
0.275 0.155
0.6 1.270
0.024 0.050
mm
SCALE 6:1inches
9
LM393, LM293, LM2903, LM2903V, NCV2903
PACKAGE DIMENSIONS
Micro8
DM SUFFIX
CASE 846A02
ISSUE F NOTES:
1. DIMENSIONING AND
A TOLERANCING
PER ANSI Y14.5M,
1982.
2. CONTROLLING
DIMENSION:
MILLIMETER.
3. DIMENSION A DOES NOT
K B INCLUDE MOLD FLASH,
PROTRUSIONS OR GATE
BURRS. MOLD FLASH,
PROTRUSIONS OR
GATE BURRS SHALL
NOT EXCEED 0.15
PIN 1 ID (0.006) PER SIDE.
G 4. DIMENSION B DOES NOT
D 8 PL INCLUDE INTERLEAD
FLASH OR PROTRUSION.
M INTERLEAD FLASH OR
0.08 (0.003) PROTRUSION SHALL NOT
T EXCEED 0.25 (0.010)
B PER SIDE.
5. 846A-01 OBSOLETE, NEW
S STANDARD 846A-02.
S
A
S
E
A
T
I
N
G
P
L
A
N
E
0.038 (0.0015) C
H J
MILLIMETERS INCHES
DIM MIN MAX MIN MAX
A 2.90 3.10 0.114 0.122
B 2.90 3.10 0.114 0.122
C --- 1.10 --- 0.043
D 0.25 0.40 0.010 0.016
G 0.65 BSC 0.026 BSC
H 0.05 0.15 0.002 0.006
J 0.13 0.23 0.005 0.009
K 4.75 5.05 0.187 0.199
L 0.40 0.70 0.016 0.028
SOLDERING FOOTPRINT*
1.04 0.38
8X
0.041 0.0158X
0.65
6X mm
*For additional information on our PbFree strategy and soldering details, please download the ON
Semiconductor Soldering and Mounting Techniques Reference Manual, SOLDERRM/D.
ON Semiconductor and are registered trademarks of Semiconductor Components Industries, LLC (SCILLC). SCILLC reserves the right to make changes without further
notice to any products herein. SCILLC makes no warranty, representation or guarantee regarding the suitability of its products for any particular purpose, nor does SCILLC
assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation special,
consequential or incidental damages. Typical parameters which may be provided in SCILLC data sheets and/or specifications can and do vary in different applications and
actual performance may vary over time. All operating parameters, including Typicals must be validated for each customer application by customer's technical experts.
SCILLC doesnot convey any license under its patent rights nor the rights of others. SCILLC products are not designed, intended, or authorized for use as components in
systems intended for surgical implant into the body, or other applications intended to support or sustain life, or for any other application in which the failure of the SCILLC
product could create a situation where personal injury or death may occur. Should Buyer purchase or use SCILLC products for any such unintended or unauthorized
application, Buyer shall indemnify and hold SCILLC and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, costs, damages, and
expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if
such claim alleges that SCILLC was negligent regarding the design or manufacture of the part. SCILLC is an Equal Opportunity/Affirmative Action Employer. This literature is
subject to all applicable copyright laws and is not for resale in any manner.