RS232 Wireless help!

For general Flowcode discussion that does not belong in the other sections.
chipfryer27
Valued Contributor
Posts: 1162
http://meble-kuchenne.info.pl
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 287 times
Been thanked: 415 times

Re: RS232 Wireless help!

Post by chipfryer27 »

Hi Jorgen

Sorry to brief I will try and respond more later.

You loop checking for incoming data on the Rx, but this approach is prone to missing activity if the data arrives whilst you are busy elsewhere.

My suggestion would be to include a Circular Buffer and an interrupt set for RxInt to capture any incoming transmission and in the ISR simply put the incoming values in the Circular Buffer

ISR would contain (for example):-
ISR.JPG
ISR.JPG (17.43 KiB) Viewed 119 times

This way you will never miss any incoming data and in your Main loop you can search for your keyword within the buffer.

Not sure using Compare$ is the best option. Depending on your transmission medium there may be "control characters" such as CR / LF being sent and if so they may be captured in your string. If they are then your string won't just contain "Open". This may or may not be a concern though.

Regards

daddytims_tims
Posts: 20
Joined: Thu Jun 16, 2022 6:16 pm
Has thanked: 17 times

Flowcode v10 Re: RS232 Wireless help!

Post by daddytims_tims »

Hi Jorgen

Here's an Example, that's works. Related to what chipfryer is saying above.

I recently created it with an Esp32.


Regards
Ryan
Attachments
Esp32_hc05.fcfx
(15.12 KiB) Downloaded 7 times

jgu1
Posts: 615
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 507 times
Been thanked: 132 times

Re: RS232 Wireless help!

Post by jgu1 »

Hi Ryan and Chipfreyer!

Thank you for your help and examble. I certenly will perform a test.

I have just made a test with my own program, and yes, working first time :D connected directly tx out to rx in. Next step via HC12 wireless.

I have add the programs, if anybody can use them, hereby :lol:

I have no expeience with Cirkular buffer, maybe a good idea to play with this. ;)

Again thank´s to all.

Jorgen
Attachments
RX_PortOscon.fcfx
(12.13 KiB) Downloaded 8 times
Tx_PortOscon.fcfx
(12.49 KiB) Downloaded 8 times

Post Reply