Convert PPM to PWM
#1
Junior Member
Thread Starter
Join Date: Sep 2004
Location: Tongeren, BELGIUM
Posts: 4
Likes: 0
Received 0 Likes
on
0 Posts
Convert PPM to PWM
Hi there!
I am making my end of year school project,
with 2 friends, and we have to read PPM signal from a gyro or receiver,
into our digital microcontroller (µC) (a PIC16F873 @ 4 mhz)
I have some PWM input in my µC,
but no PPM input, i tried to read it via analog digital conversion,
but all i get is 0 or 255,
wich is normal, since PPM consists of a little peak, every time a PWM signal would stop.
They both start at the beginning of your period in a predefined frequency.
.freq: |_________|_________|_________|_________|
PWM: |¯¯¯¯|____|¯¯|______|¯¯¯¯¯|___|¯¯¯¯ ¯|____|
.PPM: _____|_______|____________|________|_____
What i need to know, is, how i could easily convert the PPM signal to a PWM signal,
and maybe backwards.
Anyone has some experience?
Thanks!
I am making my end of year school project,
with 2 friends, and we have to read PPM signal from a gyro or receiver,
into our digital microcontroller (µC) (a PIC16F873 @ 4 mhz)
I have some PWM input in my µC,
but no PPM input, i tried to read it via analog digital conversion,
but all i get is 0 or 255,
wich is normal, since PPM consists of a little peak, every time a PWM signal would stop.
They both start at the beginning of your period in a predefined frequency.
.freq: |_________|_________|_________|_________|
PWM: |¯¯¯¯|____|¯¯|______|¯¯¯¯¯|___|¯¯¯¯ ¯|____|
.PPM: _____|_______|____________|________|_____
What i need to know, is, how i could easily convert the PPM signal to a PWM signal,
and maybe backwards.
Anyone has some experience?
Thanks!
#2
My Feedback: (2)
Join Date: Jul 2003
Location: wilmington, MA
Posts: 829
Likes: 0
Received 0 Likes
on
0 Posts
RE: Convert PPM to PWM
a simple chip called a j-k flip flop should do the trick. the freq input goes to the j input and the ppm goes to the k input. since these flops trigger on negative edges signal inversion is necessay. probably many other ideas will be posted. i hope i am not dating myself wit j-k flip flops
#3
Junior Member
Thread Starter
Join Date: Sep 2004
Location: Tongeren, BELGIUM
Posts: 4
Likes: 0
Received 0 Likes
on
0 Posts
RE: Convert PPM to PWM
Thanks!!
I really can't find ANY information anywhere...
Even my teachers at school have no idea!
I'm allready very happy with your reply,
and hope other people have idea's too!
Thanks!
I really can't find ANY information anywhere...
Even my teachers at school have no idea!
I'm allready very happy with your reply,
and hope other people have idea's too!
Thanks!
#5
Junior Member
Thread Starter
Join Date: Sep 2004
Location: Tongeren, BELGIUM
Posts: 4
Likes: 0
Received 0 Likes
on
0 Posts
RE: Convert PPM to PWM
Yes, indeed.
I really understand the difference and the relation between the two signal modulations,
but i didn't knew how i could easily convert / demodulate the signal.
I found some great site explaining the two types of signal modulations,
but nothing about conversion
http://www.tpub.com/content/neets/14.../14184_135.htm
I really understand the difference and the relation between the two signal modulations,
but i didn't knew how i could easily convert / demodulate the signal.
I found some great site explaining the two types of signal modulations,
but nothing about conversion
http://www.tpub.com/content/neets/14.../14184_135.htm
#7
Senior Member
Join Date: Jun 2002
Location: West Coast,
CA
Posts: 536
Likes: 0
Received 0 Likes
on
0 Posts
RE: Convert PPM to PWM
Examples of PIC routines for servos is found here: http://www.piclist.com/techref/microchip/servos.htm
Decoding the full R/C PPM frame is MUCH more complex. You must determine the start of the frame (look for the frame reset), then start measuring the width of each channel as it is serially presented. The channels are separated by sync's, which must be detected by your software. Each frame is separated by a reset pulse.
Your code must do everything. You can use simple polling techniques or take advantage of the interrupt features that are available on some PICs. This sort of project is not well suited for an entry level PIC programmer.
Decoding the full R/C PPM frame is MUCH more complex. You must determine the start of the frame (look for the frame reset), then start measuring the width of each channel as it is serially presented. The channels are separated by sync's, which must be detected by your software. Each frame is separated by a reset pulse.
Your code must do everything. You can use simple polling techniques or take advantage of the interrupt features that are available on some PICs. This sort of project is not well suited for an entry level PIC programmer.