Shop OBEX P1 Docs P2 Docs Learn Events
Propeller as PPM encoder... — Parallax Forums

Propeller as PPM encoder...

GeneBGeneB Posts: 3
edited 2008-04-15 17:12 in Propeller 1
Can anyone tell me if the Propeller is fast enough to encode an 8 channel PPM pulse train every 25ms or so?


I'm trying to replicate a bit of hardware I have that takes a 19,200 baud input and translates it to and 8 channel pulse train that is fed into the
trainer jack of a "standard" R/C transmitter.

If the Propeller can do the job, has anyone done this already? If so, care to share the code? [noparse]:D[/noparse]

Thanks all.

g.

Comments

  • whickerwhicker Posts: 749
    edited 2008-04-15 00:57
    of course it's possible.

    However I doubt somebody made something so specific.
    Granted, there's an object for the 19.2 baud serial communication.
  • LawsonLawson Posts: 870
    edited 2008-04-15 04:42
    Don't think anyone has done this already, but this is EASILY within the capabilities of the Propeller. The full duplex serial object is easy to use, start it in it's own cog and just read/write the buffer. Also, the BS2 compatibility object includes the BS2's PULSOUT function written all in spin, it's a good template for generating the pulse train you'd like. It will need a few tweaks to get the most precise timings though. (i.e. read CNT only once and base all timed events off of this one time) Actually, this sounds like an excellent project to learn how to use the Propeller with.

    Best of luck
    Lawson

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Lunch cures all problems! have you had lunch?
  • GeneBGeneB Posts: 3
    edited 2008-04-15 13:19
    Thanks all.

    g.
  • Beau SchwabeBeau Schwabe Posts: 6,560
    edited 2008-04-15 15:43
    GeneB,
    The closest thing that I might have is an object that I played around with when I first received a Propeller.· It was a 6 Channel PCM signal, where I·directly drove the RC-transmitter off of a Propeller pin.
    Each channel required a 300us Stop pulse (LOW) followed by a Data pulse ranging from 750us to 1750us, making the worst case requirement for each channel to be 2050uS.·· Multiply this by 6 Channels and you get 12.3ms... or 8 Channels in your case and you get 16.4ms.
    Since the repeat interval comes around every 20ms-30ms you have about 3.6mS of overhead worst case.
    If you want to transmit at 19.2 Baud to set the channel values, that's only 520.8us per Byte of data... with 3.6mS overhead, you could "fit" about 6 bytes of data (almost 7)
    ·
    Now, take this into consideration..... The possible scenario above only references using 1 COG, with the Propeller you have 8 COG's to choose from, so you wouldn't necessarily need to interleave receiving data with the output pulse.
    ·
    Note: The output signal characteristics of your transmitter will most likely·vary from the transmitter that I used.· Without overloading your transmitter, you can connect a 10Meg resistor from your transmitters’ antenna·to a scope, and visually see what your signal characteristics may look like.· Also, ground the scope to your transmitters ground (or negative supply) while making this test.·
    ·



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • GeneBGeneB Posts: 3
    edited 2008-04-15 16:19
    Beau, thanks for that! The device I'm using now uses a pulse width of 1000us to 2000us, with 1500us being the servo "center".
    The output is going to a Hitec Prism 7 transmitter. The baud rate I quoted was the max rate that this device can handle. Can I assume that if I crank the rate up to 38400 or higher then there would be more "room" to accomodate the 8 byte stream? (each byte is a servo position for each of the 8 channels)

    I need to look into actually getting a Propeller now. [noparse]:)[/noparse]

    Thanks!

    g.
  • Beau SchwabeBeau Schwabe Posts: 6,560
    edited 2008-04-15 17:12
    "The device I'm using now uses a pulse width of 1000us to 2000us, with 1500us being the servo "center"." - Right, same deal over here, only there's about a 50us overhead....· 300us+750us=1050us .... 300us+1750us=2050us .... That's just how the transmitter sends the data, the receiver interprets this with a pulse between 1000us and 2000us.

    "Can I assume that if I crank the rate up to 38400 or higher then there would be more "room" to accommodate the 8 byte stream?" - Yes, but you wouldn't need to if you used a second COG.· One COG would receive whatever signal you gave it and update·values in memory, ·the second COG would read the values in memory, and create the proper pulse stream.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
Sign In or Register to comment.