rfPIC Serin problem


Closed Thread
Results 1 to 40 of 53

Hybrid View

  1. #1
    Join Date
    Sep 2005
    Posts
    53

    Unhappy rfPIC Serin problem

    Hi All, I have been having some problems trying to send and receive data using the rfPIC16F675K and the rfRXD0420, I have been trying to use the serin command to read the data i have sent using the serout command:

    pulsout porta.2, 1
    SerOut PORTA.2,n2400,[$55,$55,"A",B0]

    when I use the serin2 command to wait and to receive "A", it seems like it does not work

    SERIN2 PORTC.1,n2400,1000,loop1,[WAIT("A"),B1]

    i have also tried the pulsin command but seem to be getting nothing, does anyone have some ideas?

    Many Thanks,

    Gavin

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    This should work... but as we don't se the whole code, it's hard to tell if you don't have anything missing in it. Make sure you have disabled all analog stuff on the pin you're using and it should be ok... unless i missed something
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    Sep 2005
    Posts
    53


    Did you find this post helpful? Yes | No

    Default rf Pic Serin Problem

    Hi Steve,

    Many thanks for the reply ;-)

    Please find below:

    Transmitter Side

    INCLUDE "modedefs.bas"
    DEFINE OSCCAL_1K 1

    TRISIO.0 = 1 ' set GPIO.0 as input
    TRISIO.2 = 0 ' set GPIO.0 as output

    B0 VAR WORD

    start:

    PAUSE 500
    HIGH PORTA.5
    PAUSE 500
    LOW PORTA.5
    PAUSE 500
    HIGH PORTA.5
    PAUSE 500
    LOW PORTA.5
    GOTO loop

    LOOP:

    PAUSE 500
    LOW PORTA.5
    IF PORTA.3 = 0 THEN GOTO LOOP1
    IF PORTA.3 = 1 THEN GOTO loop

    LOOP1:

    HIGH PORTA.5
    SerOut PORTA.2,n2400,[$55,$55,"A",B0]
    Pause 100
    GoTo LOOP

    End
    INCLUDE "modedefs.bas"


    trisa = %00111111
    trisc = %00111111

    B0 VAR WORD
    B1 VAR BYTE
    B2 VAR BYTE
    Pause 100

    start:

    high porta.4
    low porta.1
    pause 500
    low porta.4
    high porta.1
    pause 500
    high porta.4
    low porta.1
    pause 500
    low porta.4
    high porta.1
    pause 500
    GOTO loop

    loop:

    SERIN2 PORTC.1,N2400,1000,start,[WAIT("A"),B1]
    GOTO LOOP2

    loop2:

    low porta.4
    high porta.1
    pause 3000
    high porta.4
    low porta.1
    pause 3000
    goto START


    End

    Receiver Side:

  4. #4
    Join Date
    Sep 2005
    Posts
    53


    Did you find this post helpful? Yes | No

    Default rfPIC Serin Problem

    Hi steve,

    I have been running the code again and it seems to get stuck on the the receive side in the line of:

    SERIN2 PORTC.1,T2400,1000,start,[WAIT("A"),B1]

    The code seems just to hang, it does not even run to the label "start" i am using the PIC16F676, any ideas why it is doing this?

    Regards,

    Gavin

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


    Did you find this post helpful? Yes | No

    Default

    PORTC.1 on the 676 is an analog input by default at power-up. It will always read 0 until
    you disable its A/D function.

    The rfPIC12F675K also has A/D you may need to disable.
    Regards,

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

  6. #6
    Join Date
    Sep 2005
    Posts
    53


    Did you find this post helpful? Yes | No

    Default rfSERIN Problem

    Hi Bruce,

    Many thanks, i will try that ;-)

    Regards,

    Gavin

  7. #7
    Join Date
    Nov 2007
    Posts
    11


    Did you find this post helpful? Yes | No

    Unhappy rf pic transmission rate

    does anyone know how to calculate the transmission bitrate for rfPIC12F675?

    and im confuse about one thing. if the datasheet says it would transmit data in 433.9 mHZ, is that referring to the frequency band or the carrier frequency.? as far as i understood, it is the frequency bandwidth, and the carrier frequency depending on the oscillator that we used. isn't it??? can anyone please confirm this to me??

    do you know the range of data can be transmitted by rfPIC12F675??

    thank you in advance

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


    Did you find this post helpful? Yes | No

    Default

    The transmit frequency = RFXTAL frequency * 32. This can be trimmed by the value of C1 as shown in the chart. This is the carrier frequency for ASK modulation.

    ASK transmits at the center frequency. FSK transmits a few kHz from center frequency. This is explained in the data sheet.

    The bit-rate data is transmitted at depends on your firmware. If you look at the Microchip code examples you'll see how they use delays between toggling the data pin to set the bit- rate. 40 kbps is the upper limit.

    What you'll have for operating range will vary like the wind depending on your finished RF design, voltage on the PS pin, and a boat-load of other factors like receiver sensitivity, operating environment, antenna design/selection, etc, etc,.
    Regards,

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

  9. #9
    Join Date
    Nov 2007
    Posts
    11


    Did you find this post helpful? Yes | No

    Default

    thank you very much for the reply..

    i have one more question..im testing the rfPIC development kit right now with the demo program..we are trying to test the rf12F675 by using oscilloscope by conneting the probe to the pin output which is pin GP5 and GP0. however, we see no signals output from the transmitter except the analog voltage value 1.29 mv which i think comes from the power supply.

    any suggestion how to test it? we have checked the connection circuit many times..but it still give us the same result

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


    Did you find this post helpful? Yes | No

    Default

    You must have a different rfPIC development kit than the one I have. GP0 on mine connects
    to POT0. GP5 to the RFENA pin?

    Here are the pin definitions in the Microchip demo tx code example;

    #define POT0 GPIO, 0 ; (Analog Input) Potentiometer GP0
    #define POT1 GPIO, 1 ; (Analog Input) Potentiometer GP1
    #define TXD GPIO, 2 ; (Output) Transmit Data
    #define PB3 GPIO, 3 ; (Input Only) Push button switch GP3
    #define PB4 GPIO, 4 ; (Input) Push button switch GP4
    #define RFENA GPIO, 5 ; (Output) RF Enable

    I also have a full schematic in .PDF format on my CD that verifies this.

    Have you tried placing the scope on GP2?
    Regards,

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

  11. #11
    Join Date
    Nov 2007
    Posts
    11


    Did you find this post helpful? Yes | No

    Default

    yup we did try..but we dont get the expected signal..

    am i right if im expecting a modulated signal came out from the output channel? so i should be able to see an analog modulated signal with ASK. but, we only see a digital signal 0 1 which i think comes from the power supply that we used.

    im sorry..i gave the wrong information. we are using the same develoment kit as yours

    thank you

  12. #12
    Join Date
    Nov 2007
    Posts
    11


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by medusa2584 View Post
    thank you very much for the reply..

    i have one more question..im testing the rfPIC development kit right now with the demo program..we are trying to test the rf12F675 by using oscilloscope by conneting the probe to the pin output which is pin GP5 and GP0. however, we see no signals output from the transmitter except the analog voltage value 1.29 mv which i think comes from the power supply.

    any suggestion how to test it? we have checked the connection circuit many times..but it still give us the same result
    does anyone know why we have to times it by 32? i have looked at the datasheet, but it does not state the reason anywhere.

  13. #13
    Join Date
    Mar 2008
    Posts
    14


    Did you find this post helpful? Yes | No

    Default RFPIC project

    Hi all I am currently working on a project using the rfPIC micro. I am wondering if anyone has done any work with this PIC without using the dev board. I want to build the circuits myself and program them to work. if anyone has done this and can give me some assistance it would be greatly appreciated.

    Thanks

Similar Threads

  1. Serin Problem with 12F629/PBP
    By Flyingms in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 9th March 2009, 14:59
  2. Serin Problem 16f819
    By jjohannson in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 22nd March 2007, 22:50
  3. Serin serout problem
    By lerameur in forum mel PIC BASIC Pro
    Replies: 336
    Last Post: - 6th February 2007, 04:25
  4. Problem with PBP interrupt and Serin, please help
    By rgregor in forum mel PIC BASIC
    Replies: 0
    Last Post: - 22nd August 2006, 19:02
  5. serout and serin problem
    By nicolelawsc in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 11th April 2006, 19:44

Members who have read this thread : 0

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