Re: RS232 Wireless help!
Posted: Fri Apr 19, 2024 9:37 pm
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):-
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
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):-
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