Search this site

DC Motor Control and PWM - Unit 17 - Review Questions & Answers from 8051 Microcontrollers & Embedded Systems by Mazidi

 SECTION 17.1: RELAYS AND OPTOISOLATORS

1. Give one application where would you use a relay.

2. Why do we place a driver between the microcontroller and the relay? 

3. What is an NC relay?

4. Why are relays that use coils called electromechanical relays?

5. What is the advantage of a solid-state relay over EMR? 

6. What is the advantage of an optoisolator over an EM relay? 

Answers: 

1. With a relay we can use a 5 V digital system to control 12 V-120 V devices such as horns and appliances. 

2. Since microcontroller I digital outputs lack sufficient current to energize the relay, we need a driver.

3. When the coil is not energized, the contact is closed. 

4. When current flows through the coil, a magnetic field is created around the coil, which causes the armature to be attracted to the coil. 

5. It is faster and needs less current to get energized.

6. It is smaller and can be connected to the microcontroller directly without a driver. 



SECTION 17.2: STEPPER MOTOR INTERFACING 

1. Give the 4-step sequence of a stepper motor if we start with 0110.

2. A stepper motor with a step angle of 5 degrees has steps per revolution.

3. Why do we put a driver between the microcontroller and the stepper motor? 

Answers: 

1. 0110, 0011, 1001, 1100 for clockwise; and 0110, 1100, 1001, 0011 for counterclockwise 

2. 72

3. Because the microcontroller pins do not provide sufficient current to drive the stepper motor 



SECTION 17.3: DC MOTOR INTERFACING AND PWM

1. True or false. The permanent magnet field DC motor has only two leads for +ve and -ve voltages.

2. True or false. Just like a stepper motor, one can control the exact angle of a DC motor's move. 

3. Why do we put a driver between the microcontroller and the DC motor?

4. How do we change a DC motor's rotation direction? 

5. What is stall in a DC motor?

6. True or false. PWM allows the control of a DC motor with the same phase, but different amplitude pulses. 

7. The RPM rating given for the DC motor is for __________ (no-load, loaded). 

Answers: 

1. True 

2. False

3. Since microcontroller I digital outputs lack sufficient current to drive the DC motor, we need a driver. 

4. By reversing the polarity of voltages connected to the leads

5. The DC motor is stalled if the load is beyond what it can handle

6. False

7. No-load



DS12887 RTC Interfacing and Programming - Unit 16 - Review Questions & Answers from 8051 Microcontrollers & Embedded Systems by Mazidi

SECTION 16.1: DS12887 RTC INTERFACING

1. True or false. All of the RAM contents of the DS12887 are nonvolatile.

2. How many bytes of RAM in the DS12887 are set aside for the clock and date? 

3. How many bytes of RAM in the DS12887 are set aside for general-purpose applications?

4. True or false. The NV-RAM contents of the DS12887 can last up to 10 years without an external power source. 

5. Which pin of the DS12887 is the same as the ALE pin in the 8051?

6. True or false. When the DS12887 is shipped, its oscillator is turned on. 

Answers: 

1. True 

2. 9

3. 114

4. True

5. AS 

6. False 


SECTION 16.2: DS12887 RTC PROGRAMMING IN C 

1. True or false. The time and date are not updated during the initialization of RTC.

2. What address range is used for the time and date? 

3. Give the address of the first RAM location belonging to general-purpose applications.

4. Give the C statement to set the month to October. 

5. Give the C statement to set the year to 2009. 

Answers: 

1. True 

2. 0-9

3. 0EH (14 in decimal)

4. XBYTE[8]=0xOA;

5. XBYTE[09]=0x09; where the 20 part of 2009 is assumed.



SECTION 16.3: ALARM, SQW, AND IRQ FEATURES OF THE DS12887 CHIP 

1. Which bit of register B belongs to the SQW pin?

2. True or false. The IRQ out pin of DS12887 is active low. 

3. Which bit of register B belongs to alarm interrupt?

4. Give the address locations for hh:mm:ss of the alarm. 

5. If the source of activation for IRQ is alarm, then explain how the IRQ pin is activated.

6. What is the difference between the AF and AIE bits? 

7. What is the difference between the PF and PIE bits? 

Answers: 

1. D3 of D0 - D7 

2. True 

3. D5

4. Byte addresses of 1, 3, 5

5. If the AIE bit of Reg B is set to 1, then the IRQ pin is activated. This happens due to the AF bit in register C going high when the alarm time and real time values match.

6. The AF bit in register C becomes high when the alarm time and real time values match, while the AIE bit of register B simply allows the AF to be directed to the IRQ pin.

7. The PF bit in register C becomes high when the edge is detected for the periodic interrupt, while the PIE bit of reg­ister B simply allows the PF to be directed to the IRQ pin. 



Relay, Optoisolator, and Stepper Motor - Unit 15 - Review Questions & Answers from 8051 Microcontrollers & Embedded Systems by Mazidi

 SECTION 15.1: PROGRAMMING THE 8255 

1. Find the control byte if all ports are inputs.

2. Find the control byte for PC = in, PB = out, and PA = out. 

3. True or false. To avoid aliases, we must decode addresses A0 - A15.

4. Can 86H be the base address for port A of the 8255?

5. Why do we use the MOVX instruction to access the ports of the 8255? 

Answers: 

1. 9BH

2. 89H 

3. True

4. It cannot since we must have Al = 0 and AO = 0 for the base address. 

5. The MOVX instruction allows access to external memory and 8255 is mapped as memory-mapped I/0. 



SECTION 15.2: 8255 INTERFACING 

1. Modify the stepper motor program to turn counterclockwise.

2. True or false. In programming the LCD via an 8255 (without checking the busy flag), port A is always an output port.

3. True or false. In the LCD connection to the 8255, we must have a long delay before issuing the next data if we are not checking the busy flag. 

Answers: 

1. "RR A" is changed to "RL A". 

2. True

3. True