Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 16:56 02 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : CMM2 and HC-12

Author Message
Andrew_G
Guru

Joined: 18/10/2016
Location: Australia
Posts: 871
Posted: 04:27am 25 Jun 2020
Copy link to clipboard 
Print this post

Hi All,
Firstly congratulations for all those involved in the CMM2 and what a great article in Silicon Chip.
My question relates to the use of HC-12 on CMM2 (and I guess serial comms too).
The HC-12 is better running at 5V and for the MM170 this is easy as both sets of Tx/Rx pins are 5V tolerant. But not the CMM2 which are only 3.3V.

How do I supply 5V to the HC-12 without frying the Tx/Rx pins (is it just a resistor required (what value?) or the circuit similar to that illustrated in Appendix A of the CMM2 manual - which seems to not protect the Tx pin?).

Many thanks,

Andrew
 
Chopperp

Guru

Joined: 03/01/2018
Location: Australia
Posts: 1097
Posted: 04:51am 25 Jun 2020
Copy link to clipboard 
Print this post

Hi Andrew

I have one running quite happily running on 5V with the Com connections connected straight to the CMM2 com port.

I did check the Tx & Rx pins on the HC12 & they were only 3.3V anyway so I figured that they wouldn't hurt the CMM2. So far so good.

Brian
ChopperP
 
KeepIS

Guru

Joined: 13/10/2014
Location: Australia
Posts: 1882
Posted: 04:56am 25 Jun 2020
Copy link to clipboard 
Print this post

Also, there are around 15 pins that are 5V tolerant, page 10 CMM2 user manual.
NANO Inverter: Full download - Only Hex Ver 8.1Ks
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 05:11am 25 Jun 2020
Copy link to clipboard 
Print this post

The HC12 module has on-board pull-ups on both TXD and RXD, so the TXD(output) pin on the HC12, will be at 5v potential.  The RXD(input) pin is pulled up to 3v3.

I normally use COM1 on the MM series, which is 5v tolerant, and thus you can directly connect.  Sometimes, if I have already used COM1 for something else and have to use the likes of COM2 - which is not 5v tolerant - then I generally just use a 1k series resistor on the TXD line and it seems to be fine.  If you are REALLY paranoid about it, you can use one of those MOSFET level-switching module things you can get on eBay or AliExpress for just a few cents - they will level-shift the data signal bidirectionally.
Smoke makes things work. When the smoke gets out, it stops!
 
Chopperp

Guru

Joined: 03/01/2018
Location: Australia
Posts: 1097
Posted: 05:24am 25 Jun 2020
Copy link to clipboard 
Print this post

Oops

Just checked mine. Grogs is correct. 3.3V on Rx & 5V on Tx

Brian
ChopperP
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 05:32am 25 Jun 2020
Copy link to clipboard 
Print this post

1.8k and 3.3k resistor divider on the HC12 TX and direct connection on the HC12 Rx

That is the combination I have settled on to drop 5V to 3,3V without too much loading.

I am not sure what the output impedance of the HC12 is but if you are feeding 5V into the CMM2, make sure that you don't have PULLUP or PULLDOWN set for those pins. If you do, the CMM2 will get upset and is likely to give inaccurate ADC readings.

Jim
VK7JH
MMedit
 
KeepIS

Guru

Joined: 13/10/2014
Location: Australia
Posts: 1882
Posted: 05:42am 25 Jun 2020
Copy link to clipboard 
Print this post

IMHO a 8k to 10k resistor in series is more appropriate, especially if you don't want the internal 3v3 supply to start bucking (drifting under the influence of a slightly higher voltage connected to the 3v3 pin) This can change your internal reference and can lead to strange non repeatable ADC readings etc. For that reason, a Schottky diode is sometimes connected from the CPU pin to the 3v3 supply and clamps the input should it drift high for any reason.

EDIT: Jim posted while I was writing, anyway you get the idea.
.
.
Edited 2020-06-25 15:46 by KeepIS
NANO Inverter: Full download - Only Hex Ver 8.1Ks
 
darthvader
Regular Member

Joined: 31/01/2020
Location: France
Posts: 87
Posted: 03:40am 26 Jun 2020
Copy link to clipboard 
Print this post

@Andrew_G

use logic level converter , it's the easyest way i found and it's cheap.
logic level converter
this ones are for 4 channels bi directional , but you can get models with 8 or 16 channels  

Cheers
Theory is when we know everything but nothing work ...
Practice is when everything work but no one know why ;)
 
Andrew_G
Guru

Joined: 18/10/2016
Location: Australia
Posts: 871
Posted: 10:13pm 27 Jun 2020
Copy link to clipboard 
Print this post

Hello all,
Having started this thread with the question "how to run an HC-12 at 5V?" I'd like to ask the question "why run an HC-12 at 5V (and not 3V3)?"
According to Robert Rozee's re-write of the manual (thanks Rob!) its voltage range is 2 to 5V5.
I've always used 5V (except when I gave up on using battery power) but I can't find reference to "why". Other shedders (eg Grogster?) have said they use 5V but is it necessary? Its range and ability to go through brick walls etc may be more due to its FU mode (baud rate and power applied) and may not be due to the power supplied.

Any comments?

Andrew
(Edit: Picture added then removed)
Edited 2020-06-28 10:16 by Andrew_G
 
Chopperp

Guru

Joined: 03/01/2018
Location: Australia
Posts: 1097
Posted: 12:35am 28 Jun 2020
Copy link to clipboard 
Print this post

Hi Andrew

I've got one running on my CMM1 @ 3.3V. Going OK.
No levels to worry about  
Checked the range on 2400bbs the other day at over 100m

Brian
ChopperP
 
Andrew_G
Guru

Joined: 18/10/2016
Location: Australia
Posts: 871
Posted: 02:22am 28 Jun 2020
Copy link to clipboard 
Print this post

Brian,
How does it do going through walls etc.
(and my yard is not 100m long - only kidding, its not even half that).

Andrew
 
Chopperp

Guru

Joined: 03/01/2018
Location: Australia
Posts: 1097
Posted: 03:15am 28 Jun 2020
Copy link to clipboard 
Print this post

Seems OK Andrew.

With the long distance test I did, my shed was in the "line of sight"

Going through a couple of walls in the house OK.

Brian
ChopperP
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 11:45am 29 Jun 2020
Copy link to clipboard 
Print this post

@ Andrew_G: I run ALL my HC12's at 5v.  I did try running them at 3v3, but they proved to be unreliable, and that was backed up by other members(at the time) also having issues with 3v3 operation.  I was testing with 100mW output though, so perhaps they are more reliable at 3v3, if you wind the wick down to 50% or less in terms of RF output.  I've never tried that though.
Smoke makes things work. When the smoke gets out, it stops!
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025