Hm-trp


Closed Thread
Results 1 to 5 of 5

Thread: Hm-trp

Hybrid View

  1. #1
    Join Date
    Nov 2008
    Posts
    5

    Unhappy Hm-trp

    Please help me about HM-TRP. http://www.hoperf.com/rf_fsk/hm-trp.htm

    This is my PICBasic Pro Code:

    Transmitter:

    @ DEVICE pic12F675, intrc_osc_noclkout, wdt_off, pwrt_on, mclr_off, bod_off, protect_off

    Include "modedefs.bas" ' Mode definitions for Serout

    Define OSCCAL_1K 1 ' Calibrate internal oscillator

    CONF Var GPIO.1
    ENAB Var GPIO.2
    LED Var GPIO.0
    SI Var GPIO.4
    SO Var GPIO.5

    B0 var byte


    ANSEL = 0 ' Set all digital
    CMCON = 7 ' Analog comparators off

    HIGH CONF

    mainloop:

    FOR B0=0 TO 99
    Serout SO,N9600,[B0]
    Pause 200
    NEXT

    Goto mainloop

    End

    Receiver:

    @ DEVICE pic12F675, intrc_osc_noclkout, wdt_off, pwrt_on, mclr_off, bod_off, protect_off

    Include "modedefs.bas" ' Mode definitions for Serout

    Define OSCCAL_1K 1 ' Calibrate internal oscillator

    CONF Var GPIO.1
    ENAB Var GPIO.2
    LED Var GPIO.0
    SI Var GPIO.4
    SO Var GPIO.5

    B0 var byte


    ANSEL = 0 ' Set all digital
    CMCON = 7 ' Analog comparators off

    HIGH CONF
    b0=0

    mainloop:

    Serin SI,N9600,B0
    WRITE B0,B0

    Goto mainloop

    End

    What is wrong with my code?

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,115


    Did you find this post helpful? Yes | No

    Default Re: Hm-trp

    Did you set up the modules prior their use?

    Ioannis

  3. #3
    Join Date
    Nov 2008
    Posts
    5


    Did you find this post helpful? Yes | No

    Default Re: Hm-trp

    [QUOTE=Ioannis;101633]Did you set up the modules prior their use?

    I think its not necessary. Default Settings is 9600bps, 8bit, No check, 1 bit stop.

  4. #4
    Join Date
    Feb 2010
    Location
    USA, New England
    Posts
    164


    Did you find this post helpful? Yes | No

    Default Re: Hm-trp

    [QUOTE=zdravko;101637]
    Quote Originally Posted by Ioannis View Post
    Did you set up the modules prior their use?

    I think its not necessary. Default Settings is 9600bps, 8bit, No check, 1 bit stop.
    I haven't used this particular device but I've become quite familiar with Hope's RFM22B. I think you might be a little optimistic in assuming the default serial settings cover everything you'll need. Given that it isn't working, following the guidance in the datasheet for configuring the chip might be a good step (after confirming that your PIC is working by blinking an LED or something).

    Some very quick observations on your code:
    -You define an ENAB pin but never explicitly set it low.
    -You don't allow any warm up time. I think good practice is to give the PIC (and the module) a few hundred millisec to get their acts together. I usually add a PAUSE 500 after setting all the configuration bits.
    -I don't see how you can even tell if it's working or not--how are you getting data out? At least for initial testing try having an LED blink (or something) each time a character is received.

    Let us know how it goes. If you can't get it working give us some description of what it does and doesn't do--beyond "it doesn't work"--and how you're testing it. A schematic showing your hookup might also be useful.

    Best Regards,
    Paul
    The way to avoid mistakes is to gain experience. The way to gain experience is to make mistakes.

  5. #5
    Join Date
    Nov 2008
    Posts
    5


    Did you find this post helpful? Yes | No

    Default Re: Hm-trp

    Thanks Paul

    This is a scheme and Ioannis is right. I have to configure the HM-TRP but currently have no MAX3232, MAX232 only.
    Attached Images Attached Images  

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