Searching \ for ' [PIC] Decoding a modulated pulse' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'Decoding a modulated pulse'.

No exact or substring matches. trying for part
PICList Thread
'[PICLIST] [PIC] Decoding a modulated pulse'
2000\08\13@201919 by igorp

flavicon
face
Hello guys:

I apologize very much because I am certain my question was discussed here
many times already.
My problem is to decode a pulse of 16 kHz with defined length about 100 ms.
The modulation frequency can vary about 5 per cent as well as a length of
the pulse.
Having any PIC with an interrupt it would be a walk through a rose garden
but I have to use PIC12C508.
I suggest this solution:
a/ To use a timer for dividing input pulse to appropriate frequency to have
enough time for loops.
b/ After getting a pulse from a timer to count time defined loop to get a
modulation frequency
c/ When the pulse isn't long enough or it's too long jump to b/
d/ getting a right pulse to increase a counter to obtain a number of
modulation pulses and the whole length of a pulse as well.
e/ Having the length of any modulation pulse there is a possibility to
figure the right time of the whole pulse by very easy way.


Till now it seems clear. My questions sounds:

How to handle dropouts and how to find the end of the pulse?
Should I use a digital filter first?

I would like to find pulses by very high probability.

Any suggestions?

Regards

Igor

--
http://www.piclist.com hint: To leave the PICList
spam_OUTpiclist-unsubscribe-requestTakeThisOuTspammitvma.mit.edu>

2000\08\14@105145 by Scott Dattalo

face
flavicon
face
On Mon, 14 Aug 2000, Igor Pokorny wrote:

{Quote hidden}

A 5% variation in frequency corresponds to a cycle time variation from 59.5uS to
65.8uS.

What I'd probably do is try to capture the first rising edge. Then wait about
55us and begin searching for the next edge. When an edge is detected, add the
amount of time beyond 55us to a 16 or perhaps 24-bit accumulator. In addition,
count the number of rising edges. If a rising edge is found in say 15us after
the 55us window, then you can say that the 16khz is no longer present. Once
you've determined that the 16kHz is no longer present, the modulation time can
be calculated by:

mod_time =  (#of rising edges)*55us + 24-bit accumulator

The average frequency is:

avg-freq = #of rising edges / mod_time

Now, there are numerous tricks that are available to simplify this. But this
should serve to get the conversation rolling...

Scott

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]: PIC only [EE]: engineering [OT]: off topic [AD]: advertisements

More... (looser matching)
- Last day of these posts
- In 2000 , 2001 only
- Today
- New search...