R/C receiver to PIC16F84


Closed Thread
Results 1 to 10 of 10
  1. #1
    Join Date
    Apr 2007
    Posts
    18

    Default R/C receiver to PIC16F84

    Im trying to hook up 2 channel R/C control system to pic16f84.

    How do i came out the programm to input the signal from the receiver to PIC?
    Do i use the Pulsin for this, need help, thanks?

  2. #2
    Join Date
    Oct 2003
    Location
    Australia
    Posts
    257


    Did you find this post helpful? Yes | No

    Default

    I've successfully used Pulsin to count the servo pulses out of a receiver and then displayed on an LCD to show the servo movement. So I can say that this will work.

    This thread has good example of the bar graph http://www.picbasic.co.uk/forum/showthread.php?t=2359

    Squib

  3. #3
    Join Date
    Apr 2007
    Posts
    18


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Squibcakes View Post
    I've successfully used Pulsin to count the servo pulses out of a receiver and then displayed on an LCD to show the servo movement. So I can say that this will work.

    This thread has good example of the bar graph http://www.picbasic.co.uk/forum/showthread.php?t=2359

    Squib

    Is it possible if u could send me the sample code of using Pulsin with the input from the receiver.
    I dont have an LCD to determine the value of the pulses coming through the receiver.

    [email protected]

    really appriciate it.

    Rohaimi

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by tech View Post
    Is it possible if u could send me the sample code of using Pulsin with the input from the receiver.
    I dont have an LCD to determine the value of the pulses coming through the receiver.

    [email protected]

    really appriciate it.

    Rohaimi
    Or...Or...Or...and I'm just going out on a limb here...You could read that other thread, forget the fact that you don't have an LCD and just ignore it, maybe even do something crazy like comment out anything to do with the LCD, write some code and do what you're going to do with the code, which you haven't said what your end result will be...But that's just me going out on a limb, ya know, trying something out for the first time...'cause that's just too funny...

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


    Did you find this post helpful? Yes | No

    Wink

    Hi, Tech ( I do adore the joke ! )

    The good thing would be to know WHAT you want to do with the Rx decoded outputs ...

    cause channels capture code will depend upon that ...

    Alain

    I think a search in these columns with "PULSIN" K.W. could give you lots of relevant hits ...subject is not "brand new" ... Lol !
    ************************************************** ***********************
    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
    Apr 2007
    Posts
    18


    Did you find this post helpful? Yes | No

    Default

    ----------------------------------
    result1 var word
    result2 var word

    radio:

    pulsin PORTB.0,1,result1
    pulsin PORTB.1,1,result2

    if result1 < 600 then forward1
    if result1 > 900 then reverse1
    if result2 < 600 then ccw
    if result2 > 900 then cc

    goto radio

    -------------------------------

    Very sorry bout the previous post, just out it a side then.
    I've been trying the pulsin . Two channel go directly to the input.

    if result1 < 600 then forward1

    i.ve used this based on my previous school project using basic stamp. It was not programm by me. Did the order of programm goes in this way?

    comment appreciated.

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


    Did you find this post helpful? Yes | No

    Wink

    Ok ...

    This is code obviously coming straight from a BS2 !!!

    1) you must tell PbP you work @ 20 Mhz ...

    DEFINE OSC 20 ... and use HS Oscillator

    2) as your channels follow each other, you must know you'll measure CH1, miss CH2, miss CH1, measure CH2, measure CH1, miss CH2, miss CH1 , measure CH2, etc, etc ...

    not very critical but you must know it for your timings ...


    3) Think CH1 and CH2 are refreshed every 20 - 25 ms ... and you'll have to update your captures ... so what do forward1,reverse1,ccw and cc subs must not take too long a time, to allow updating your channels at a "decent" rate ...

    4) may be you will have to add wrong pulses detection ... but it is another story !!!

    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 " !!!
    *****************************************

  8. #8
    Join Date
    Apr 2007
    Posts
    18


    Did you find this post helpful? Yes | No

    Default

    i get what u mean and had Define OSC 20 and the HC oscillator

    i dont get what u mean by the point below.
    How i measure CH1 and CH2? what u mean by "miss CH2"

    2) as your channels follow each other, you must know you'll measure CH1, miss CH2, miss CH1, measure CH2, measure CH1, miss CH2, miss CH1 , measure CH2, etc, etc ...

  9. #9
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by tech View Post
    i dont get what u mean by the point below.
    How i measure CH1 and CH2? what u mean by "miss CH2"
    2) as your channels follow each other, you must know you'll measure CH1, miss CH2, miss CH1, measure CH2, measure CH1, miss CH2, miss CH1 , measure CH2, etc, etc ...
    Takes to time to do what a PIC has to do according to your program.
    Therefore, if doing all of this thru software (i.e. not using any internal hardware modules), you'll spend time measuring the pulse width of CH1, then while acting upon that (driving another servo or something?), the PIC is too busy doing one thing to measure another pulsing (CH2).

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


    Did you find this post helpful? Yes | No

    Wink

    Re,

    That's simple :

    The channel signals follow each others within ~ 10-15 ns ( nano seconds ! ) delay ...

    PULSIN need a little time ( some µs ) to be ready to catch the signal. (see PbP libs ! )

    those µs being more than the ns channel separation time, the second PULSIN doesn't see the second pulse rising edge ... and must wait for the following frame.

    That's all

    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 " !!!
    *****************************************

Similar Threads

  1. Replies: 17
    Last Post: - 12th April 2014, 02:17
  2. 433 Mhz Data Receiver
    By Pesticida in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 29th November 2010, 02:26
  3. PBP code to read R/C signal from receiver
    By malc-c in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 28th October 2009, 21:51
  4. Replies: 4
    Last Post: - 15th May 2008, 09:43
  5. receiver can not receive signal
    By nicolelawsc in forum Schematics
    Replies: 1
    Last Post: - 19th May 2006, 08:01

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