a problem RF Signal with PULSIN


Closed Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 2005
    Posts
    26

    Default a problem RF Signal with PULSIN

    Hi,

    I am working on a project. I have a problem. I must measure some RF signals with some pic's ports. I am using PULSIN command for this. But I cannot measure any signals. Some parts of my code is here;

    *********************************
    ...
    TRISA=%11000011
    RFCOD VAR PORTA.0

    temp var word
    temp = 0
    lcdout $fe, 1
    lcdout "test"
    pause 500

    START:

    if RFCOD = 1 then
    pulsin RFCOD, 1, temp
    GOSUB CODECONTROL
    endif
    goto START

    CODECONTROL:
    lcdout $fe, $c0, #temp
    pause 500
    resume

    *********************************

    I have a 433 mhz hybrid on my board and it is connected my Pic's PORTA.0 and I am using PIC 16F876A. When I push my transmitter's button I can receive the signal from my hybrid. Because I can see the signal with my scope. But my codes;

    if RFCOD = 1 then
    pulsin RFCOD, 1, temp
    GOSUB CODECONTROL
    endif

    never works. I can see the signals on my scope but I the "IF statement" doesnt work. The variable of RFCOD is 0 (zero) everytime. So I cannot read the signals. If somebody has any ideas I am waiting for. What the problem can be?

    Have a nice day.

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


    Did you find this post helpful? Yes | No

    Smile

    Hi,

    Solution is evident:

    pulsin measures a pulse, beginning with the Low to high transition ... in your example, the signal is already high when Pulsin begins ...

    No L>H transition ... Pulsin = 0 !!! ( cause overflow ...)

    The solution : Use RC Time command and add to the result the time needed by the test on RFCOD ...

    Alain

    PS: take care to carefully verify the PULSIN_MAX define ...
    Last edited by Acetronics2; - 21st July 2005 at 10:02.

  3. #3
    Join Date
    Jul 2005
    Posts
    26


    Did you find this post helpful? Yes | No

    Default

    Thank you Acetronics,

    But I am new on PBP. How can I do your solution? So if you have some example codes about your solution and if you send it to examine , I will be happy.

    Thank you so much again.

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


    Did you find this post helpful? Yes | No

    Wink

    Hi, Muskut

    You're new with PBP ... that's the worst reason I ever heard to ask for a "ready cooked" solution !!!

    I think the first thing you should do is understand what the different functions do and how they do it.

    For that first step, reading carefully the manual is not too much ... see what RCTime can do for you and we will be talking about that one next time.

    Learning is NOT a shame, it's the beginning of intelligence ... begging might be prohibited here !!!

    Alain
    Last edited by Acetronics2; - 21st July 2005 at 19:34.

  5. #5
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,810


    Did you find this post helpful? Yes | No

    Default

    What is your transmited signal? What baud rate? How many bits?

    Are you transmiting with some kind of Serout like command?

    Ioannis

  6. #6
    Join Date
    Jul 2005
    Posts
    26


    Did you find this post helpful? Yes | No

    Default

    I solved it by TMR0 and I changed the RF pin. The pin was PortA.0 but I cannot get any signals from here. Then I decided to chage port and the new port was PortC.5. And the result was Ok. I could read signals. Why I didnt read any signals from PortA.0 ? (16F876) Does anybody has an idea? Thank you so much again.

  7. #7
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    PORTA on the F876 is configured to A/D inputs by default on power-up due to
    the default value in the ADCON1 register on power-up.

    ADCON1 = 7 ' configures A/D pins as digital I/O.

    Also, PORTC.5 is a schmitt trigger input. RA0 is TTL.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

Similar Threads

  1. Funny PULSIN values: what is going on???
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 30th April 2008, 08:02
  2. problem with sending data using RF module
    By rano_zen06 in forum mel PIC BASIC Pro
    Replies: 51
    Last Post: - 10th April 2008, 17:08
  3. Pulsin 16F819 problem
    By rekcahlaer in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 11th April 2007, 13:52
  4. Replies: 11
    Last Post: - 13th July 2005, 19:26
  5. problem with RF receiver
    By nanami7702002 in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 31st January 2005, 21:55

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