PM: 2.8" LCD board for the PM...


Author Message
Quazee137

Guru

Joined: 07/08/2016
Location: United States
Posts: 540
Posted: 05:15pm 26 Oct 2022      

On one project I replaced the RTC EEPROMs with FRAMs and added the ESP8266
so instead of SD card they could use a MM170 without the relays and i/o to
get the log data. They now use a phone app.

Glen0
Regular Member

Joined: 12/10/2014
Location: New Zealand
Posts: 83
Posted: 08:21pm 01 Nov 2022      

My HC12's have arrived. I tried them out with the code and instructions I found in the "Getting Started with the Micromite" document and the Pico manual, but no go unfortunately.
Two questions/requests
Do these look like the HC12's that should work?
Can someone post



 simple programs for the Pico's. I am of course testing with one pico for the transmitting module and one for the receiver so using the same comm. port/pins will be nice.

Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9204
Posted: 12:50am 02 Nov 2022      

No, they are clones.
Are you aware of the thread on the clone problem?
Let me know here if not, and I or another member will link you to it.
It is a multi-page read, but it does go in depth into the issue of clones and why they don't work very well, and usually not at all with other genuine HC12's in the same network.

Genuine ones say "HC12" on the bottom silkscreen, along with "www.hc01.com" web address, and the PCB is always BLUE, not black.

You can also tell these are clones by the fact that they are ID'd as TENSTAR ROBOT - that is not the HC company.  Unfortunately, there are A-LOT of clones on the market, and I had to make contact with the HC company with help from others, to buy direct from them.  That way, I know I am getting the genuine article.

There are BLUE ones out there that are also clones.  Complete with all the usual markings on the PCB, which makes it even harder to know what you have got.
One way, currently, is that the board has to be blue, have the HC markings on it, AND must also have the HC logo laser-engraved into the 30MHz crystal package on the top.  If the crystal does NOT have the HC logo lasered into it, the module is a suspect clone.

I remember getting some of those black ones to try out a few years ago, and I also had an extraordinarily hard time making them work.  They are not as easy to get working as the genuine HC12's are.  IE: Code that works fine with an HC12, will not work with these black ones.  Rob(robert.rozee) helped me out here.  I sent him a couple of these black ones to play with, and I seem to remember he did find a way to make them work, but I forget now what he did - this was years ago.

If he reads this, he may remember and post a reply.

I do remember binning them all though, as they were not worth the effort to get going compared to the real HC12's, that just work immediately right out of the box.
There were things that had to be changed in code I think it was, to get them to co-operate, meaning having to change the code on any device I wanted to use these things in, where the genuine HC12's just worked no hassle, no stress.

Probably not what you wanted to hear, but.....

Glen0
Regular Member

Joined: 12/10/2014
Location: New Zealand
Posts: 83
Posted: 02:26am 02 Nov 2022      

All good thanks. Better I hear that sooner rather than later. Saves me the exercise in futility when I spend hours trying to get them to work.

I am aware of the clone problem, which is why I brought this up on TBS after only a few attempts at getting it to work. Great to have the experience of others at your fingertips.

Does the HC company have an English website I can order from?

Do you have a simple program I could use to test on a pair of pico's, just in case I am doing it wrong, before I biff them in the bin.

Cheers

Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9204
Posted: 04:32am 02 Nov 2022      

Re: HC website - NO, and that's the problem.  
If you surf on over to their website, you will find it is all in Chinese, with no English option.  That's why most people buy them from eBay or AliExpress, but there is no way to know if you will get a clone or not.

Last time I ordered from HC directly, they had a MOQ of 50pcs, so you have to buy at least 50 if you order from them.  I think that the MOQ came in, along with many other things, cos of the virus.

I do have the genuine article here - flick me an email(I think you have my email) if you want me to sell you a couple.  I don't have a huge number in stock, but I could probably see you right for a small handful depending on what you need.  They are the genuine article sourced from HC though, so you know you will be getting the genuine article.

As to code, by default, they are 9600 baud, so without changing any settings in the module, you should be able to hook them up to the COM port and talk between them using 9600 baud.

An example transmitting test code:


DIM A$
OPEN "COM1:9600" AS #1
DO
 Input "Type a message: ", A$
 PRINT #1,A$
LOOP



An example receiving test code:


DIM A$
OPEN "COM1:9600" AS #1
DO
 DO:LOOP UNTIL LOC(#1)<>0 'Wait till something arrives in buffer
 PAUSE 150 'Allow time for data to arrive in buffer
 A$=INPUT$(LOC(#1),#1) 'Suck everything out of buffer, stick it in A$
 PRINT A$
LOOP


Use CTRL+C to break out of either of those running codes.
On BOTH PicoMites, COM1 is being used, but you could make that COM2 - this is just a quick example as requested.

This should work on any HC12's fresh out of the box, without any configuration changes at all to the modules, as by default, the HC12 is factory set to 9600 baud.

Only thing to ensure you do, is that the HC12 is fed from the 3v3 pin on the PM module, and that the SET line on the HC12 module is left floating. (it has an internal pull-up)  If SET is low, the module thinks you want to make changes to its settings, so just ignore that pin for now anyway.

EDIT: Remember that the silkscreen pin markings are with respect to the module, so RXD is data in from the PM module, and TXD is data out of the HC12 to the PM module.
I trust you have the HC12 datasheet.  Let me know if not, and I can upload it to this thread.  The datasheet is an English translation version, so it is easy to understand.
Edited 2022-11-02 14:37 by Grogster

Glen0
Regular Member

Joined: 12/10/2014
Location: New Zealand
Posts: 83
Posted: 09:13pm 02 Nov 2022      

Thanks Graeme
I'll email you later today hopefully, I have a lot on at the mo.
Next time you order from them I would like to piggy back if you don't mind.
It pays to stockpile these days, as price increase is accelerating, and will be for the foreseeable future.
Cheers