Hello, welcome to our forum.

It looks like you have registered but you have not yet posted and messages. Our requirements are that you must post at least two messages, to allow the moderators to review your registration, before you will be allowed access to the full range of forum areas.

Please make a couple of posts, until then you may see a notice that says you are banned from certain forum areas.


Thank you.

Remove Text Formatting
Loading...

+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2008
    Posts
    42

    Default Ebay HC-12 wireless transceivers

    HC-12 wireless transceivers

    Has anyone used the HC-12 wireless RS-232 modules on ebay? My modules seem to work fine with Arduino but I am having no luck using a 16F628A/16f616. Very simple code below returns
    4
    8
    2
    96
    128
    32
    16
    32
    32
    32
    16
    128
    96
    4
    16
    64
    128
    128

    Transmitter Code 16F616:
    Tx:
    SEROUT PORTC.5,6,[2] 'sends 2 to the HC-12 every 3 seconds
    PAUSE 3000
    GOTO TX

    Receiver Code 16F628A:
    OVER:
    SERIN2 PORTB.2,16468,3000,OVER,[V1]
    IF V1 = 0 THEN GOTO OVER
    SEROUT PORTB.5,6,[#V1,10] 'Output to serial Monitor
    GOTO OVER
    Last edited by n0yox; - 30th January 2017 at 02:37.

  2. #2

    Default Re: Ebay HC-12 wireless transceivers

    Break down the problem - connect the 16F616 pin C.5 to the 16F628A pin B.2 with a piece of wire and make that work first.
    GND on both devices should be tied together too.

  3. #3
    Join Date
    Mar 2008
    Posts
    42

    Default Re: Ebay HC-12 wireless transceivers

    Quote Originally Posted by Charlie View Post
    Break down the problem - connect the 16F616 pin C.5 to the 16F628A pin B.2 with a piece of wire and make that work first.
    GND on both devices should be tied together too.
    It works as expected when wired direct.

  4. #4
    Join Date
    May 2013
    Location
    australia
    Posts
    1,149

    Default Re: Ebay HC-12 wireless transceivers

    It works as expected when wired direct.
    which would be not at all


    tx true level @38400 baud
    SEROUT PORTC.5,6,[2] 'sends 2 to the HC-12 every 3 seconds
    rx inverted @9600 baud
    SERIN2 PORTB.2,16468,3000,OVER,[V1]
    This is more entertaining than Free to Air TV

  5. #5
    Join Date
    Mar 2008
    Posts
    42

    Default Re: Ebay HC-12 wireless transceivers

    Quote Originally Posted by richard View Post
    which would be not at all


    tx true level @38400 baud


    rx inverted @9600 baud

    It works for sure when wired direct.
    If you take a look at the third 9600bps mode " http://melabs.com/resources/ser2modes.htm " you will find that 16468 is indeed 9600 inverted when using serin2 as is mode 6 when using serout. I am running inverted since I am wired direct and not thru a set of MAX232 ics.
    Last edited by n0yox; - 31st January 2017 at 00:04.

  6. #6
    Join Date
    May 2013
    Location
    australia
    Posts
    1,149

    Default Re: Ebay HC-12 wireless transceivers

    ok [I was thinking serout2]

    are you sure the signal needs to be inverted , I have not used these modules but the code here is using true levels
    http://www.picbasic.co.uk/forum/showthread.php?t=20869

    there is also mention of setting the module correctly re baud rate and fu_x
    This is more entertaining than Free to Air TV

  7. #7
    Join Date
    Mar 2008
    Posts
    42

    Default Re: Ebay HC-12 wireless transceivers

    Thank you, Richard the link was helpful as was yours and Charlie’s comments .My project is back on track with the code below

    Transmitter Code 16F616:
    Tx:
    SEROUT PORTC.5,2,[2] 'sends 2 to the HC-12 every 3 seconds
    PAUSE 3000
    GOTO TX

    Receiver Code 16F628A:
    OVER:
    SERIN2 PORTB.2,84,3000,OVER,[V1]
    IF V1 = 0 THEN GOTO OVER
    SEROUT PORTB.5,6,[#V1,10] 'Output to serial Monitor
    GOTO OVER

Similar Threads

  1. Reflow Oven in Ebay
    By rsocor01 in forum Off Topic
    Replies: 6
    Last Post: - 20th December 2013, 10:37
  2. eBay Auction (no reserve)
    By T.Jackson in forum Adverts
    Replies: 43
    Last Post: - 13th June 2008, 15:06
  3. PicBasic Pro Ebay Auction
    By tonyfelloni in forum Adverts
    Replies: 1
    Last Post: - 10th January 2008, 11:09
  4. has anyone used chipcon transceivers?
    By grahamwebb2000 in forum General
    Replies: 1
    Last Post: - 28th June 2006, 20:29
  5. Transceivers with 2 different PICs.
    By Eng4444 in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 7th June 2006, 09:31

Members who have read this thread : 15

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

Tags for this Thread

Posting Permissions

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