Hi JT,3 channels - Nice!
I think the misalignment in the terminal readout is due to the radio being half-duplex i.e. can't transmit and receive at the same time. The HC-12 has some delay required to change directions which is detailed in the datasheet. It takes some time after the end of a message in one direction to be ready to send in the other direction. It's also possible that it is reporting the results of one of the other channels when the PC decides to send the $REMOTE message. That will also cause some losses. For diagnostics, it's just annoying. If you actually require 2 way comms in the final code, you'll have to figure out a way to coordinate the sending of $REMOTE messages with the receiving back from the PIC. If that's a real requirement, we can cogitate on that. Otherwise, I'd live with it.
strbuf = "" is necessary where it is. You need to start with a clean string before you start building a new one. The best place to init something is just before you use it. If you want to generate errors, add a piece of code to poke bad characters into the string after building it or set a breakpoint and modify the string manually.
Not sure what you mean. The code just reports what it receives. It might be faster because it isn't burdened with a bunch of blocking delays but if your GPS(?) is sending the time string at 2/sec then you are guaranteed to get time reports with the the same time value.
Carry on.
I'll live with the radio anomaly, no problem.
I mentioned STRBUF = "" because once a sentence has been PARSED, all of STRBUF left until cleared has bad characters really, so adding different ones won't help. The error only happened in SIM, when I was sending messed up sentences, but I didn't see it LIVE, so perhaps not a real error. Generally the messages are pure, apart from starting in the middle of a sentence, but the system takes care of this. I'll leave it for now.
All of the 3x messages are transmitting at 5/SEC. I was happy to see the GPS Time at 2/SEC, which shows that the whole sequence went round 2x that second.
So it is looking pretty good. Once I add it into the MAIN program along with the SPI INPUTS, I can see what STRINGs are being saved.
Have you now finished? If so, I'll add it into the MAIN program, but then it is much harder to work on.
Cheers, C.
Last edited: