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! |
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
|
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! |
RE: Convert PPM to PWM
the key is to notice that the pwm signal goes positive at each freq tic mark and negative at each ppm tic mark
|
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 |
RE: Convert PPM to PWM
mm less reply than i thought...
* up... |
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. |
PPM to PWM conversion can be made using a Bistable Multivibrator
|
All times are GMT -8. The time now is 01:06 AM. |
Copyright © 2024 MH Sub I, LLC dba Internet Brands. All rights reserved. Use of this site indicates your consent to the Terms of Use.