![]() |
Forum Index : Microcontroller and PC projects : CMM2 and HC-12
Author | Message | ||||
Andrew_G Guru ![]() Joined: 18/10/2016 Location: AustraliaPosts: 871 |
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: AustraliaPosts: 1097 |
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: AustraliaPosts: 1882 |
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 ZealandPosts: 9610 |
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: AustraliaPosts: 1097 |
Oops Just checked mine. Grogs is correct. 3.3V on Rx & 5V on Tx Brian ChopperP |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
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: AustraliaPosts: 1882 |
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: FrancePosts: 87 |
@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: AustraliaPosts: 871 |
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: AustraliaPosts: 1097 |
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: AustraliaPosts: 871 |
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: AustraliaPosts: 1097 |
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 ZealandPosts: 9610 |
@ 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! |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |