Picaxe 08m2+ and HC-12 rf module serin command

jackberg

New Member
Hello,
I'm new in the Picaxe programming, and my current project is to send "AT" command to a HC-12 RF module and get a response from the "serin" command
so far I'm able to send commands with "serout C.4,T9600_8,("AT")" successfully , but the answer from the serin does not work.
I'd like to decode all the feedback from the HC-12 module as show in the Serial Terminal picture.
Also I did install a 1n4148 diode (bar to Vcc) and a 10k resistor (to Gnd) at pin C.3

In this program I'm using pin C.3 as input and C.4 as output, and the pin C.1 & C.2 will be use for I2C (LCD,RTC)

The HC-12 was tested from the Picaxe Serial Terminal.

Any suggestions is welcome.
Thank's again.

the codes:

#no_data
#picaxe 08m2
setfreq m8
PAUSE 500

DO
serout C.4,T9600_8,("AT") ;command sent

;serout 4,T9600_8,("AT+RX")
;serout 4,T9600_8,("AT+C002")

SerIn C.3,T9600_8,b0,b1 ;answer
sertxd ( b0,b1,cr,lf ) ; sending the answer to the Serial Terminal
;DEBUG
PAUSE 3000
loop


================ answer from serin =====================


23958


====================== HC-12 Test =======================================

23959


============================== circuit diagram =============================


23965


==================================================================================

23966


======================= test with 2 HC-12 Module 1 transmitter 1 receiver 37 Bytes Data=======================


23970
 
Last edited:

jackberg

New Member
Thank's to PhilHornby codes "HC12Setup.bas", very good codes I must say.
I modified these codes for my application and it works very well with 1 module to obtain the version, the parameters, and the "AT" OK too
I leave here a .bas file for the Picaxe 08m2 +, and the circuit diagram. My next challenge will be to make the link with 1 transmitter and 4 receivers all HC-12, with the configuration of channels.
 

Attachments

jackberg

New Member
New test with HC-12 Module, 37 Bytes send / Received
The Receiver is connected as follow: VCC "with 1n4007 diode" , GND , TXD--RXD "together" , SET not connected.
 
Last edited:
Top