Searching \ for 'Reading 61 kHz with 17C43' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page:
Search entire site for: 'Reading 61 kHz with 17C43'.

Truncated match.
PICList Thread
'Reading 61 kHz with 17C43'
1997\04\10@032610 by Wolfram Liebchen

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

| Wolfram Liebchen                                    |
| Forschungsinstitut fŸr Optik, TŸbingen, Deutschland |
|                         |

1997\04\10@170708 by sdattalo

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

         BSF   _mem_loc,0
         BSF   _mem_loc,1
         BSF   _mem_loc,2
         BSF   _mem_loc,3
         BSF   _mem_loc,4
         BSF   _mem_loc,5
         BSF   _mem_loc,6
         BSF   _mem_loc,7


; instantiate(sp) the macro
       sample_mac sample_mem0
       sample_mac sample_mem1
       sample_mac sample_mem2

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
 and cleared.
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
wreak havoc.

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

1997\04\11@225459 by .EDU>

You wrote:
{Quote hidden}

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.                   PKlammerspamKILLspamACM.Org
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
- Today
- New search...