Co3 Questions and Answer

Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

Q1. Explain Interfacing Seven Segment with 8051 with ALP program?

Answer:

• Segments: The seven segments in a 7-segment display are typically labeled "a" through "g." The
eighth segment, when present, represents the decimal point and is labeled "dp." By selectively
illuminating these segments, various characters can be displayed.

• Common Anode and Common Cathode Displays: There are two main types of 7-segment
displays: common anode and common cathode. In a common anode display, all anodes of the
individual segments are tied together, and each cathode is controlled separately. In a common
cathode display, all cathodes are tied together, and each anode is controlled separately. You must
apply the appropriate voltage to either the common anode or common cathode to illuminate the
desired segments.

• Numerical Representation: 7-segment displays are often used to display numbers (0-9) and
sometimes a few additional characters, such as 'A,' 'b,' 'C,' 'd,' 'E,' 'F,' 'H,' 'L,' 'P,' and 'U.' To display
other characters, a combination of segments is used to approximate the desired shape.

• Applications: 7-segment displays are widely used in various applications, including digital clocks,
microwave ovens, calculators, scoreboards, and various digital meters.


Q2. Write HEX value of digit 0,1,2,3,4,5,6,7,8,9 for 7 –segment display.

Answer:

Q3. Program for 7-segment display to interface with 8051 and display 0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f
Q4. Explain the LCD Pins in detail?

Answer:-

Q5. Explain LCD Command Details


Q6. Write a program to interface LCD with 8051 and display “KLUCSE”

Answer:

Q7. How stepper moter works? Calculate the angle traversed in each step if it completes 360 degree
rotation in 200 steps?

Answer:
 Stepper motor is made up of a stator and a rotator. Stator represents the four electromagnet coils which remain
stationary around the rotator, and rotator represents permanent magnet which rotates.
 Whenever the coils energised by applying the current, the electromagnetic field is created, resulting the rotation
of rotator (permanent magnet).
 Coils should be energised in a particular sequence to make the rotator rotate. On the basis of this “sequence”
we can divide the working method of Unipolar stepper motor in three modes:
 Wave drive mode, full step drive mode and half step drive mode.
A stepper motor rotates at small angles to complete 360 degrees rotation, these small angles are called steps,
hence the name Stepper Motor. Typically, a stepper motor consists of 200 steps.

200 Steps = 360 degrees

1 Step = ‘x’ degrees

x = 360 / 200 = 1.8 degree

• Therefore, every step is 1.8 degrees.

• The high and low pulses are provided to the stator coil of the stepper motor.

• Here we’re using a 4-coil stator. The angle of each step is decided by the steps in the rotor and its alignment
with the stator.

Q8 Explain 3-Modes of stepper motor and write an assembly language program to operate the moter in these
modes

(a) Wave drive mode, (b) full step drive mode and (c) half step drive mode.
Q9. Explain ADC(0804)( Analog-to-Digital Converters and describes the functioning of each pins)?

Answer:-
ADCs( Analog-to-Digital Converters) are among the most widely used devices for data acquisition.
A Physical quantity, like temperature, pressure, humidity, and velocity, etc., is converted to
electrical ( Voltage , current) signals using a device called a transducer or sensor.We need ADCs
to translate the analog signals to digital numbers, so that the microprocessor/microcontroller can read
the data for further implement.

Pin description of ADC


1. V It works with +5 volts and has a resolution of 8 bits.
cc
2. Conversion time is another major factor in judging an ADC.
Conversion time is defined as the time it takes the ADC to convert the analog input to a
digital (Binary) number.
In ADC804 conversion time varies depending on the clocking signals applied to CLK R and
CLK IN pins, but it cannot be faster than 110 μs

3. CLK IN and CLK R


a. CLK IN is an input pin connected to an external clock source
b. To use the internal clock generator (also called self-clocking), CLK IN and CLK R
pins are connected to a capacitor and a resistor, and the clock frequency is
determined by

4. Typical values are R = 10K ohms and C = 150 pF.


5. We get f = 606 kHz and the conversion time is 110 μs.
6. VRef/2: It is used for the reference voltage
If this pin is open (not connected), the analog input voltage is in the range of 0 to 5 volts (the
same as the Vcc pin)

If the analog input range needs to be 0 to 4 volts, VRef/2 is connected to 2 volts

7. Analog ground and digital ground

Analog ground is connected to the ground of the analog Vin.

Digital ground is connected to the ground of the Vcc pin.

8. CS( Chip Select)

Chip select is an active low input used to activate the ADC0804 chip.

9. RD(Read)
This is an input signal and is active low. The ADC converts the analog input to its binary
equivalent and holds it in an internal register. RD is used to get the converted data out of the
ADC0804 chip. When CS=0, if a high-to-low pulse is applied to the RD pin, the 8-bit digital
output can be read from D0-D7. The RD pin is also referred to as Output Enable(OE).

12. WR( Write , a better name might be “start of Conversion”)

This is an active low input used to inform the ADC0804 to start the conversion process. If
CS=0, when WR makes a low-to-high transition, the ADC0804 starts converting the analog
input value of Vin to an 8-bit digital number

13. INTR( Interrupt, a better name might be “End of Conversion”)

This is an output pin and is active low. It is normally high pin and when the conversion is
completed, it goes low to signal the CPU that the converted data is ready to be picked up.
After INTR goes low, we make CS=0 and send a high- to- low pulse to the RD pin to get the
next analog data to be converted.

Q10.Explain Start of conversion, End of conversion. How to calculate the conversion time.

Answer:

WR( Write , a better name might be “start of Conversion”)

This is an active low input used to inform the ADC0804 to start the conversion process. If
CS=0, when WR makes a low-to-high transition, the ADC0804 starts converting the analog
input value of Vin to an 8-bit digital number

INTR( Interrupt, a better name might be “End of Conversion”)

This is an output pin and is active low. It is normally high pin and when the conversion is
completed, it goes low to signal the CPU that the converted data is ready to be picked up.

After INTR goes low, we make CS=0 and send a high- to- low pulse to the RD pin to get the
next analog data to be converted.

Calculation of conversion time


CLK IN and CLK R
CLK IN is an input pin connected to an external clock source
To use the internal clock generator (also called self-clocking), CLK IN and CLK R pins
are connected to a capacitor and a resistor, and the clock frequency is determined b

Typical values are R = 10K ohms and C = 150 pF.


We get f = 606 kHz and the conversion time is 110 μs.

Q11 Explain the logic to communicate the ADC with 8051

Q12.Write the program and logic to communicate ADC WITH 8051


Answer:
• Step 1: Set the port you connected to the output lines of the ADC as an input port.
• Step 2: Make the Port connected to EOC pin high. The reason for doing this is that the ADC
sends a high to low signal when the conversion of data is complete. So this line needs to be
high so that the microcontroller can detect the change.
• Step 3: Clear the data lines which are connected to pins ALE, START, and OE as all these pins
require a Low to High pulse to get activated.
• Step 4: Select the data lines according to the input port you want to select. To do this, select the
data lines and send a High to Low pulse at the ALE pin to select the address.
• Step 5: Now that we have selected the analog input pin, we can tell the ADC to start the
conversion by sending a pulse to the START pin.
• Step 6: Wait for the High to low signal by polling the EOC pin.
• Step 7: Wait for the signal to get high again.
• Step 8: Extract the converted data by sending a High to low signal to the OE pin.
• Assembly language program to interface ADC

Q13. Calculate step size or resolution if vref =2.56 and vin=1 0r 2,56 v ,
and digital output for ADC?
Answer:

Q14.Explain DAC(digital to analog convertor) interfacing with 8051.


Answer:
Microcontroller are used in wide variety of applications like for measuring and control of physical
quantity like temperature, pressure, speed, distance, etc.

In these systems microcontroller generates output which is in digital form but the controlling
system requires analog signal as they don't accept digital data thus making it necessary to use DAC
which converts digital data into equivalent analog voltage.

we use 8-bit DAC 0808. This IC converts digital data into equivalent analog Current. Hence we
require an I to V converter to convert this current into equivalent voltage.

According to theory of DAC Equivalent analog output is given as:


Q15. For the following digital input , calculate analog output:
(a)11000011 (b)00010111
Answer: Use the formula

Q16. Define Accuracy, Resolution, Full scale output voltage.


Answer:
1. Resolution: It can be defined as a smallest change in the output
corresponding to an input change by one LSB.
2. Accuracy: This is the measure of the difference between the actual output
voltage & the expected output voltage.
3. Full scale output voltage: This is the output voltage when binary input has the
highest value. For ex: 8-bit 5V DAC have max voltage 5V-19.5mv=
4.9805V.
Q17. Write a program to generate staircase waveform
Answer:

Q18. Write a program for generating triangular waveform


Answer:
Q19. Write a program to generate a sine wave
Answer:
To generate a sine wave , we first need a table whose values represent the magnitude
0 0
of the sine of angles between 0 & 360
0& 0
The values for the sine function vary from -1.0 to +1.0 for 0 360 angles. Therefore,
the table values are integer numbers representing the voltage magnitude for the sine
of theta (θ). To generate sine wave we assume the full scale voltage of 10V for DAC
output. Full scale output of the DAC is achieved when all the data inputs of the DAC
are high. Therefore, to achieve the full scale 10V output, we use the following
equation.
VOut = 5V + ( 5 X Sin θ)
Program to generate sine wave

You might also like