Demonstration of HC-12 radio module configuration

PhilHornby

Senior Member


This program demonstrates sending configuration commands to the HC-12 RF transceiver. As it stands,
it doesn't do any actual data transfers to a remote HC-12, though it could easily be modified to do so.



Hardware configuration:
HC12_Test.jpg

Unfortunately, the code is too long to include inline (according to the forum software). It is included as an attachment.
 

Attachments

Last edited:

hippy

Technical Support
Staff member
Looking at some other sites on the HC-12 it appears your wiring diagram may be incorrect. The pin naming seems correct but pin naming order ( as seen from PCB top ) and pin numbering for names appears reversed.

More importantly, with RXD an input to HC-12 from a PICAXE output, TXD an output to a PICAXE input, it seems you may have a cross-over in your connections to the PICAXE.

http://www.14core.com/wiring-the-hc11-hc12-434433mhz-transceiver

One thing I do recommend ( though doesn't mean I always follow that advice ! ) is to add the power supply voltages allowed. The HC-12 seems to be good for 3.2V to 5.5V but indicating than can save worrying and checking if 5V is safe to use, whether the HC-12 is 3.3V only.

What I think it should be ...

Code:
 Viewed from top            -.--- 3V3 to 5V 
.---------------.            |
|             O | 5 SET <----|--- From PICAXE output
|             O | 4 TXD -----|--> To PICAXE input
|    HC-12    O | 3 RXD <----|--- From PICAXE output
|             O | 2 GND --.  |
| [O]         O | 1 VCC --|--'
`---------------'         |
 Antenna                 -^------ 0V
 
Last edited:

PhilHornby

Senior Member
Corrected schematic

The pin naming seems correct but pin naming order ( as seen from PCB top ) and pin numbering for names appears reversed.

More importantly, with RXD an input to HC-12 from a PICAXE output, TXD an output to a PICAXE input, it seems you may have a cross-over in your connections to the PICAXE.
Well spotted!

I've amended the schematic to connect the correct pins together. I'd not paid any attention to the manufacturer's pin numbers, because they're not marked on the board - whereas the names are. I've corrected those as well. (Personally, I consider the non-component side of the board to be the 'top'.)
 

hippy

Technical Support
Staff member
(Personally, I consider the non-component side of the board to be the 'top'.)
The usual convention for a single layer board ( or strip-board ) is the component and silk screened side is the top, and the tracking is on the bottom. Multi-layer boards generally follow that convention.

Most PCB design packages will use a scheme where one is looking down on a board with the top layer being viewed above all the rest.
 

inglewoodpete

Senior Member
Phil, Thanks for posting this project. I'm on a quest for knowledge of all things digital RF, after avoiding the subject for nearly 60 years!

Forgive me picking holes in your documentation - you seem to have copped a bit of "feedback" on your posting already:(.

The graphic that you have used for the download socket has the ring and tip connections reversed. If viewed from above, and I assume this was your intention, the contact orientation for your depiction of the socket is correct. However, ground should be connected to the tip and SerialIn to the ring.
 

hippy

Technical Support
Staff member
The graphic that you have used for the download socket has the ring and tip connections reversed. If viewed from above, and I assume this was your intention, the contact orientation for your depiction of the socket is correct. However, ground should be connected to the tip and SerialIn to the ring.
Thanks for spotting that; it was something which had been missed earlier. Correct connections should be -

Code:
                                               1/S   2/R   3/T                .---------------.
.----------.   1/S     2/R   3/T           .--------------------.             |               |
|          |---------.-----.-----.       .-|  .--.  .--.  .--.  |   .---------| Serial Out    |
|          |         |     |      \      | |  |  |  |  |  |  |  |   |         |               |
|          |         |     |      /      | |  |  |  |  |  |  |  |   |  .------| Serial In     |
|          |---------^-----^-----'       `-|  |  |  |  |  |  |  |   |  |      |               |
`----------'    |      |      |            `--|  |--|  |--|  |--'   |  |  .---| 0v            |
                |      |      |               `--'  `--'  `--'      |  |  |   |               |
PC RX ----------'      |      |                |     |     |        |  |  |   `---------------'
                       |      |                `-----|-----|--------'  |  |         PICAXE
PC TX -----------------'      |                      |     |  .-----.  |  |
                              |                      }-----|--|     |--'  |
GND --------------------------'                     _|_    |  `-----'     |
                                                   |   |   |    22K       |
                                               10K |   |   |              |
                                                   |_ _|   |              |
                                                     |     |              |
                                                   --^-----^--------------^-- 0v
Code:
                                                  .---------------.
 Viewed from Above                                |               |
                             .--------------------| Serial Out    |
  .--------------.           |       .-----.      |               |
.-|  +  +      O |--2/R--.---|---.---|     |------| Serial In     |
| |  .--.      O |--2/R--'   |   |   `-----'      |               |
| |  |  |   O    |--1/S------'   |     22K    .---| 0v            |
| |  `--'      O |--3/T--.      _|_           |   |               |
`-|  +  +      O |--3/T--{     |   |          |   `---------------'
  `--------------'       |     |   | 10K      |         PICAXE
                         |     |   |          |
                         |     `-.-'          |
                         |       |            |
                       --^-------^------------^-- 0v
 

PhilHornby

Senior Member
The graphic that you have used for the download socket has the ring and tip connections reversed.
Aaarrggh - my attempts to add this to Diptrace has caused untold grief. (I managed to have a PCB made for another project, with the connections back-to-front. :mad:)

I claim to have corrected it now!
 
Top