# EE454 TEST 2 Sample EE454 TEST 2 sample

1.Given the bifilar stepper motor below with the center tap of each winding connected to 12 volts. Each of the four windings has a resistance of 12 ohms and a nominal current of 1 amp. Design the hardware to drive the motor showing calculations and the signal connections to port 1 of an 89c51rd2. You may use only the components shown to the right of the stepper. With the following specifications:

## Transistor Type

/ Current gain,  / Vce(sat) / Vbe(on) / Ic(max)
PNP Q1 / 20 / .2 v / 1.0 v / 1500 ma.
NPN Q2 / 20 / .2 v / .6 v / 1500 ma.

### Type

/ Description / VOL @ IOL = 16 ma. and Vcc = 5 v / VOH Max voltage at output

#### U1 Sn7406

/ Open Collector Inverter / .4 v / 30 v

R1: Any resistance value.

#define beta 3
unsigned int calculate (unsigned int input)
{
static unsigned int output;
output = (beta*output+input)/(beta+1);
return (output);
}

2. Given the c-51 subroutine calculate to the right:

Assume the initial value of the variable output is zero. Also assume the variable “input” is always 100.

a) What is the value of “output” if this routine is called two times in a row?

b) What is the value of output if this routine is called five times in a row?

c) Describe a good use for this routine.

3. Use any number of the three kinds of components shown below. Assume an 89c51 system in which the components are to be used has memory space available at 0x1000 up to 0xFFFF. Include a sketch and include all 89c51 interface signals. a) Design a memory mapped output port at 0xCxxx.

b) Design a memory mapped input port at 0xExxx. 4. The combinational logic and the SR latch to the right with active low set and reset inputs are connected to the 89c51 signals as shown. A light emitting diode with the associated PNP driver is connected to the output of the latch.

a) Write the c-51 statement that will turn the LED “on”.

b) Write the c-51 statement that will turn the LED “off”.

5. A photo transistor (like the one discussed in class) has a 1k resistor connected between the emitter and ground. The collector is connected to + 5 volts. When the sensor is placed in an environment with a certain low level illumination I0, the voltage at the emitter is 2 volts.

a) Assume the sensor is placed in a room with one half the illumination (I0/2) as mention above. What resistance value should be used to replace the 1k resistance so that the output will remain 2 volts?

b) Assume a 2k resistor is connected between the emitter and ground. The sensor is placed in the same illumination I0 as described originally. What is the voltage at the emitter of the transistor?