Next: In-lab Tasks:
Up: Tasks
Previous: Tasks
- Explain how the OC4 interrupt handler presented in
section 3.5 works.
- Rewrite the OC4 interrupt handler so it generates a
PWM signal on PA4 that has approximately a 2 msec period
(2048 time tick period) and a duty cycle that is controlled
by a single global variable.
- Write a new kernel function named
set_pwm()
that can be called from main
to reset the duty cycle
of the PWM signal.
- Write a program that reads a
commanded duty cycle from the PC's terminal and then
generates a 2 msec PWM signal on pin PA4 with the specified
duty cycle.
Michael Lemmon
2009-02-01