Exact match. Not showing close matches.
PICList
Thread
'[PIC] Detect PWM from an RC Servo'
2006\01\13@163409
by
Padu
Given a hobby RF receiver, the one that is used to remote control RC Cars, and knowing that they output regular RC Servo PWM (20ms pulse train with signal HIGH varying from 1 to 2 ms), what is a good method for detecting this HIGH interval on a PIC18F452?
Cheers
Padu
2006\01\13@164046
by
James Humes
Using the CCP module to measure the time between the rising edge and falling
edge comes to mind.
On 1/13/06, Padu <spam_OUTpaduTakeThisOuT
merlotti.com> wrote:
>
> Given a hobby RF receiver, the one that is used to remote control RC Cars,
> and knowing that they output regular RC Servo PWM (20ms pulse train with
> signal HIGH varying from 1 to 2 ms), what is a good method for detecting
> this HIGH interval on a PIC18F452?
>
> Cheers
>
> Padu
> -
2006\01\13@174050
by
Bob Blick
> Given a hobby RF receiver, the one that is used to remote control RC Cars,
> and knowing that they output regular RC Servo PWM (20ms pulse train with
> signal HIGH varying from 1 to 2 ms), what is a good method for detecting
> this HIGH interval on a PIC18F452?
>
Hi Padu,
I've used the Capture module. If you want an example in C for the 16F876
(I know that's not a 18F452, but...):
http://bobblick.com/techref/projects/sv2hb/sv2hb.html
Cheerful regards,
Bob
2006\01\13@183554
by
Padu
From: "Bob Blick" <.....bblickKILLspam
@spam@sonic.net>
>> Given a hobby RF receiver, the one that is used to remote control RC
>> Cars,
>> and knowing that they output regular RC Servo PWM (20ms pulse train with
>> signal HIGH varying from 1 to 2 ms), what is a good method for detecting
>> this HIGH interval on a PIC18F452?
>>
>
> Hi Padu,
>
> I've used the Capture module. If you want an example in C for the 16F876
> (I know that's not a 18F452, but...):
>
> http://bobblick.com/techref/projects/sv2hb/sv2hb.html
>
> Cheerful regards,
>
> Bob
Thanks for the example Bob, I don't know why but I had in my mind that the
CCP module didn't have enough resolution for this type of signal. I'll check
your code and the datasheet again.
Thanks
Padu
2006\01\13@234829
by
Mike Singer
Padu wrote:
> Thanks for the example Bob, I don't know why but I had in my mind that the
> CCP module didn't have enough resolution for this type of signal. I'll check
> your code and the datasheet again.
Measure for 16 (32, 64) pulses of your signal.
Regards,
Mike.
2006\01\14@094045
by
olin piclist
Padu wrote:
> Given a hobby RF receiver, the one that is used to remote control RC
> Cars, and knowing that they output regular RC Servo PWM (20ms pulse
> train with signal HIGH varying from 1 to 2 ms), what is a good method
> for detecting this HIGH interval on a PIC18F452?
The easiest way is to use a CCP module in capture mode. It can only be
configured to capture one edge polarity at a time, but this isn't a problem
because you have at least 1mS between the leading and trailing edges. Set
it up to capture the leading edge, then when you get that interrupt save
away the capture value and reconfigure it for the trailing edge. You've got
a whole mS to do this, so that should be no problem.
******************************************************************
Embed Inc, Littleton Massachusetts, (978) 742-9014. #1 PIC
consultant in 2004 program year. http://www.embedinc.com/products
2006\01\14@102826
by
olin piclist
Padu wrote:
> Thanks for the example Bob, I don't know why but I had in my mind
> that the CCP module didn't have enough resolution for this type of
> signal.
The CCP module can capture edges to instruction clock resolution. With a
18F the instruction period is 100nS, meaning it can resolve the 1-2mS pulse
width to 1 part in 5000. Other sources of error probably overshadow that by
a large margin.
******************************************************************
Embed Inc, Littleton Massachusetts, (978) 742-9014. #1 PIC
consultant in 2004 program year. http://www.embedinc.com/products
2006\01\16@040129
by
Michael Rigby-Jones
|
>-----Original Message-----
>From: piclist-bounces
KILLspammit.edu [.....piclist-bouncesKILLspam
.....mit.edu]
>Sent: 14 January 2006 15:28
>To: Microcontroller discussion list - Public.
>Subject: Re: [PIC] Detect PWM from an RC Servo
>
>
>Padu wrote:
>> Thanks for the example Bob, I don't know why but I had in my
>mind that
>> the CCP module didn't have enough resolution for this type of signal.
>
>The CCP module can capture edges to instruction clock
>resolution. With a 18F the instruction period is 100nS,
>meaning it can resolve the 1-2mS pulse width to 1 part in
>5000. Other sources of error probably overshadow that by a
>large margin.
Cheap RC servos can not repeatably resolve even 1 part in 256 (i.e. 8 bit) IME due to gear backlash and slop in bearings etc.
Regards
Mike
=======================================================================
This e-mail is intended for the person it is addressed to only. The
information contained in it may be confidential and/or protected by
law. If you are not the intended recipient of this message, you must
not make any use of this information, or copy or show it to any
person. Please contact us immediately to tell us that you have
received this e-mail, and return the original to us. Any use,
forwarding, printing or copying of this message is strictly prohibited.
No part of this message can be considered a request for goods or
services.
=======================================================================
2006\01\18@130003
by
Padu
From: "Olin Lathrop"
> The CCP module can capture edges to instruction clock resolution. With a
> 18F the instruction period is 100nS, meaning it can resolve the 1-2mS
> pulse
> width to 1 part in 5000. Other sources of error probably overshadow that
> by
> a large margin.
Thanks everybody for your comments... I did my test program and it works
perfectly. It wasn't as painfull as I had imagined.
Cheers
Padu
More... (looser matching)
- Last day of these posts
- In 2006
, 2007 only
- Today
- New search...