Hardware Reference
In-Depth Information
E7.13 Write an assembly and a C program to generate a triangular waveform from the V OUT A
pin in Figure 7.36. What is the period of the waveform generated by your program?
E7.14 Write an instruction sequence to rotate the stepper motor shown in Figure 7.41 clockwise
one cycle using the full-step sequence.
E7.15 Write a C program to rotate the stepper motor one cycle in the counterclockwise direc-
tion using the half-step sequence by using 5 ms as the delay between two half steps. The circuit
connection of the stepper motor is shown in Figure 7.41.
E7.16 Write a C program to rotate the stepper motor shown in Figure 7.41 clockwise one cycle
using the full-step sequence with 5 ms as the delay between two steps.
E7.17 Write a C function to initialize the Port H key-wake-up function for the HCS12 that inter-
rupts the microcontroller on the falling edge (automatic) of any Port H pin. Also write an interrupt
service routine for this interrupt that simply clears the key-wake-up interrupt fl ags and returns.
7.15 Lab Exercises and Assignments
L7.1 Write an assembly or C program to generate a periodic square wave with a frequency that
alternates between 1 and 2 kHz every 4 s using the DAC circuit shown in Figure 7.36.
L7.2 Connect a stepper motor circuit as shown in Figure 7.41. The stepper motor mini board
from Futurlec ( www.futurlec.com) as shown in Figure L7.2 may work well with the circuit
given in Figure 7.40. Write a program to perform the following operations:
Step 1
Rotate the stepper motor using full-step sequence clockwise for 5 s.
Step 2
Rotate the stepper motor using full-step sequence counterclockwise for 5 s.
Step 3
Rotate the stepper motor using half-step sequence clockwise for 5 s.
Step 4
Rotate the stepper motor using half-step sequence counterclockwise for 5 s.
Experiment with intrastep delays of 2, 5, and 10 ms. The IND, INC, INB, and INA pins of the
stepper motor should be connected to PP3, PP2, PP1, and PP0 pins, respectively.
Figure L7.2 ■ A hobby stepper motor kit from Futurlec
 
Search WWH ::




Custom Search