ECE 4760: Homework 2
- Draw the lowpass circuit required in Lab 2 to filter the PWM output.
R and C to meet the requirements stated in the first paragraph of the Procedure
section of the lab writeup.
- What is the maximum frequency of sine wave you can generate on the Mega644
using the fastest PWM mode?
Assume a hardware clock frequency of 16MHz and
that you will change PWM values every PWM cycle.
Assume also that you require 8 samples/sinewave cycle to produce a filterable signal.
- The keypad scanning routine given in Lab 2 uses a scheme where the upper
and lower nibbles of an i/o register are alternately used for input and output.
Figure out a way to scan a 4x4 keypad which drives the vertical wires as 4
output bits and reads the horizontal wires as inputs, with no i/o swapping.
Does either scheme have an advantage?
- How accurate is the crystal? Find a data sheet.
Does the crystal accuracy limit the measured accuracy on the oscilloscope? Justify your answer.
Copyright Cornell University
August 31, 2012