R/C Servo pulse Monitor


Closed Thread
Results 1 to 8 of 8
  1. #1
    Join Date
    Feb 2007
    Location
    Dallas, TX
    Posts
    4

    Default R/C Servo pulse Monitor

    This is just a little Servo Pulse Code to monitor PPM Signals and output it to a Terminal Window via RS232 Comm's .9 to 2.0 PPM.
    ################################################## ##
    'Defines
    Define LOADER_USED 1
    define osc 20
    Include "modedefs.bas"

    F1 con 6 'frequency input pin
    W0 var word

    loop:
    Pulsin F1,1,W0 'Measure Input Pulse
    w0 = (W0*/500) 'Some math to Convert from (mµ)Microseconds to (ms)Milliseconds

    Serout2 portc.6,32,["ms= ", dec (w0/1000), ".", dec3 w0,13] 'Send Data out Port C pin 6 @ 19,200 Baud

    pause 25 'Little Buffer to quite things down
    Goto loop

  2. #2
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Could you elaborate a bit more on it.. what PIC have you used to test it on ?

  3. #3
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Talking

    Fun ...


    And, after all those years, I didn't know PbP was supporting decimal calculations ...

    Or may be this is some binary arithmetics ( 0,1 ) demo ...

    Wow ... I think I'll have to retire !!!

    Steve ... you were right, I get old !!!

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  4. #4
    Join Date
    Feb 2007
    Location
    Dallas, TX
    Posts
    4


    Did you find this post helpful? Yes | No

    Default

    I've tried it on 16F628(A), 16F88,16F876(A),16F877(A),etc......pretty much all of the 16F Picmicro Family will work fine.

  5. #5
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Wink Let's see ...

    [QUOTE=Harddkyss;33261]

    Pulsin F1,1,W0 'Measure Input Pulse

    > Let's say the result is 750 ( Neutral position : 1500µS )

    w0 = (W0*/500) 'Some math to Convert from (mµ)Microseconds to (ms)Milliseconds

    > 750 * 500 / 256 = 1464 ... instead of 1500 !!!

    500/256 = 1.953125 ...

    Now ...

    > 750 * 2 = 1500 ... or 750 << 1 .

    Always do it simple !!!

    Alain

    Yes, it was showing " something " .... False !
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  6. #6
    Join Date
    Feb 2007
    Location
    Dallas, TX
    Posts
    4


    Did you find this post helpful? Yes | No

    Default

    What OSC frequency you using...??

  7. #7
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Cool

    Quote Originally Posted by Harddkyss View Post
    What OSC frequency you using...??
    Me ??? none

    YOU : define osc 20

    Calculations made from that ...

    That's all !!!

    Alain

    PS ... may be you use a resonnator ???
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  8. #8
    Join Date
    Feb 2007
    Location
    Dallas, TX
    Posts
    4


    Did you find this post helpful? Yes | No

    Default

    Weird....Scales correctly on my end with no problems, I eventually made a ESC to Control Powerchair Motors and this was just a snippet of code to aid in designing stuff from R/C Signals....

Similar Threads

  1. DC to servo pulse converter
    By Agent36 in forum General
    Replies: 2
    Last Post: - 16th December 2009, 06:09
  2. More Servo Woes
    By chrisshortys in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 13th May 2009, 08:40
  3. Replies: 3
    Last Post: - 13th September 2008, 17:40
  4. Servo does not move
    By ruijc in forum General
    Replies: 12
    Last Post: - 12th November 2007, 19:14
  5. servo pulse problem...
    By tonkgang in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 7th April 2006, 16:12

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts