Unit 2 IO and Memory Interfacing - cs3691
Unit 2 IO and Memory Interfacing - cs3691
Unit 2 IO and Memory Interfacing - cs3691
Example:
MC1408 DAC (or DAC0808)
Converting lout to voltage in DAC0808
Ideally, the output pin Iout is connected to a resistor and the
current is converted to voltage and monitor the output on the
scope.
This causes inaccuracy in real life because the input resistor of
the load where it is connected will also affect the output
voltage.
For this reason, the Iref current output is isolated by connecting
it to an op-amp such as 741 with Rf5k ohms for the feedback
resistor.
Example – Stair Step Ramp
In order to generate a stair-step ramp, set up the circuit and
connect the output to an oscilloscope. Then write a program to
send data to the DAC to generate a stair step ramp.
Solution:
CLR A
MOV P1, A ;send data to DAC
INC A ;count from 0 to FFH
ACALL DELAY ;let DAC recover
SJMP AGAIN
AGAIN:
Sensor Interfacing
Temperature Sensors:
Transducers convert physical data such as temperature, light
intensity, flow and speed to electrical signals.
Depending on the transducer, the output produced is in the
form of voltage, current, resistance or capacitance.
For example, temperature is converted to electrical signals
using a transducer called a thermistor .
But the response from a thermistor is nonlinear.
Because of the complexity associated with writing software
for nonlinear devices, linear temperature sensor like LM34,
LM35 series are widely used.
Sensor Interfacing : LM34 / LM35
Temperature Sensors:
The sensors of the LM34 series are precision integrated-
circuit temperature sensors whose output voltage is linearly
proportional to the Fahrenheit temperature.
The LM34 requires no external calibration since it is
internally calibrated.
It outputs 10 mV for each degree of Fahrenheit temperature.
The LM series sensors are precision intergrated circuit
temperature sensors whose output voltage is linearly
proportional to the Celsius (centigrade)
The LM35 requires no external calibration since it is
internally calibrated.
It outputs 10 mV for each degree of Centigrade temperature
Temperature Sensors: LM34 / LM35
Signal conditioning and interfacing the LM35 to the
8051
Transducers produce an output in the form of voltage ,
current, charge, capacitance and resistance.
These signals need to converted to voltage in order to
send to a ADC.
This conversion is called Signal Conditioning
Signal conditioning can be a current-to-voltage
conversion or
a signal amplification.
For example, the thermistor changes resistance with
temperature. The change of resistance must be
translated into voltages in order to be of any use to an
ADC.
Temperature Sensors: LM34 / LM35
Connection of Temperature Sensor to the ADC.
LM336 -2.5 zener diode is to fix the volage across the 10k
POT(Potentiometer) at 2.5V.
LM336-2.5 overcomes the fluctuation in power supply
Temperature Sensors: LM34 / LM35
STEPPER MOTOR
Step angle:
Step angle is defined as the minimum
degree of rotation with a single step.
No of steps per revolution = 360° / step
angle
Steps per second = (rpm x steps per
revolution) / 60
Example: step angle = 2°
No of steps per revolution = 180
Example 1: Write an ALP to rotate the
stepper motor clockwise / anticlockwise
continuously with full step sequence.
Program:
MOV A,#66H
BACK: MOV P1,A
RR A
ACALL DELAY
SJMP BACK
DELAY: MOV R1,#100
UP1: MOV R2,#50
UP: DJNZ
R2,UP DJNZ
R1,UP1
RET
A15