Randy Yates wrote:
> Jerry Avins <jya@[EMAIL PROTECTED]
> writes:
>> [...]
>> I think he said 420 Hz jitter.
>
> Yeah. I'm not thinking too clearly on this one.
>
> What *would* the zero-crossings of A*sin(2*pi*50*t) + B*sin(2*pi*420*t)
> look like?
>
> How are the zero-crossings detected? Does the detection fire off an
> interrupt to the PIC, in addition to stopping the counter? Wouldn't
> Manfred possibly get a bunch of interrupts then (i.e., not just an
> average of 50 samples / second)?
I don't know how _he_ detects zero crossings. I have done it with a
hardware comparator* tied to the trigger of a catch register. The catch
register latches the contents of a continuously running counter. The
trigger (if I remember 68HC1x correctly) not only transfers the count,
but also can set an interrupt. There are several independently clocked
registers, so by clocking one with the positive-going comparator edge
and the other with the negative, you have independent whole-cycle
measurements twice per cycle. The interrupt routine subtracts the
register contents from the stored previous reading. Magically, counter
wraparound washes out (but of course, Mr. Fixedpoint, you know that).
*Because the counter never stops, there is no ***ulative error.* That's
fraction saving of a different kind. :-)
Jerry
___________________________
* The cheap way is just a diode tied to the positive power-supply rail
in series with a resistor tied to the AC of 12V or more. The junction of
the resister and diode switches pretty fast between logic 0 and 1.
Still, for noise immunity, I prefer a little hysteresis.
--
Engineering is the art of making what you want from things you can get.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
** Posted from http://www.teranews.com
**


|