'Reading 61 kHz with 17C43'
|At 19:42 09.04.97 -0500, Richard Wamser wrote:
>Has ony one tried using a STIMULUS File for testing their PIC ?? Can a PIC
>17c43 be used to read in a Frequency of about 61,000Hz ?? If so any idea's
>on how to write the code ?? Iam in the process of converting my driveway Car
>detector from a multipull descrite IC's to a Mircocontroller based system.
I think it's worth trying the capture module of the 17C43.
Assuming you use the 25 MHz version of the PIC, you have 100 instructions
between two interrupts of the capture module. That could be sufficient,
to find the width of the signal (instead of the frequency), what may be
sufficiently convenient for a regulating algorithm.
| Wolfram Liebchen |
| Forschungsinstitut fŸr Optik, TŸbingen, Deutschland |
| ffo.fgan.de | liebchen
At 19:42 09.04.97 -0500, Richard Wamser wrote:
> Can a PIC
>17c43 be used to read in a Frequency of about 61,000Hz ??
61kHz? No problem. But then again, I don't the exact details of your
But you may wish to consider a macro that has been used on the '622:
sample_mac macro _mem_loc
; instantiate(sp) the macro
If you wish, you could just as well parametize the port
and the bit to be tested too. This macro takes one sample
every two instructions. The idea is simple:
1) A chunk of (potentially temporary) memory is allocated
2) Check the bit in the I/O port.
3) If it is set, then set the bit in the memory buffer
that corresponds to the sample number.
The idea is that some event occurs that initiates the
sampling of the data. For me it was an interrupt. You
sample a bazillion bits and post process the data. There
are numerous ways to post process the data to extract
the 61kHz component. I and others have discussed the
"cheap-man's fourier transform" as Hamming calls it; that
is use square waves instead of sine waves as the orthogonal
basis. Or, you could simply average the periods of all
of the cycles. This is conceptually similar to the
technique Wolfram suggests with the clock. However,
the signal has to be fairly clean; spurious glitches
Eric Smith has pointed out that he uses this technique for
one of his applications. Perhaps he has some additional
"The problem with television is not the resolution."
Hugh. F. Frohbach
We're quite successfully reading just over 100kHz MFM-encoded data using
both capture timers, one for rising and one for falling (input wired to 2
pins on the PIC); interrupt-driven, with interrupt-driven serial I/O, too;
on 22MHz PIC17C4x's.
Peter F. Klammer, Racom Systems Inc. ACM.OrgPKlammer
6080 Greenwood Plaza Boulevard (303)773-7411
Englewood, CO 80111 FAX:(303)771-4708
More... (looser matching)
- Last day of these posts
- In 1997
, 1998 only
- New search...