Hi all,
I'm quite new to flowcode v5 and am trying to do the following but am not being successful:
I'm reading three values (0-100) with a PIC and am sending these values through the RS232 module of flowcode (PIC hardware UART) to be received by another PIC RS232 module and then display that number on an LCD display. What I need to know is the format that the numbers needs to be in (number? string? etc) when it is sent. In what format does the number arrive when it is received by the receiver unit and what conversion is required to get it to display on the LCD. This stuff is basic in assembler, but just cant seem to figure out what flowcode is doing to the data.
Thanks in advance
RS232 data sending
Moderator: Benj
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: RS232 data sending
Hello,
With RS232 you are sending and receiving bytes. That is packets of 8-bit binary data.
A byte can represent the values 0 - 255 so each byte could be a unique value for your system.
I would do something like this in a while 1 run forever loop.
Transmitter
1) because your values are 0 to 100 we need a start value to sync the transmitter and the receiver. so why not send out the value 101.
2) Follow the start byte by sending out your three value bytes a, b and c
3) A small delay can then be inserted here to ensure we are not constantly blasting out data.
Receiver
1) Attempt to receive a byte
2) Check the value, is it equal to 101?
3) If 101 received then receive three more times and store into variables a, b and c, otherwise return to start.
Hope this helps.
With RS232 you are sending and receiving bytes. That is packets of 8-bit binary data.
A byte can represent the values 0 - 255 so each byte could be a unique value for your system.
I would do something like this in a while 1 run forever loop.
Transmitter
1) because your values are 0 to 100 we need a start value to sync the transmitter and the receiver. so why not send out the value 101.
2) Follow the start byte by sending out your three value bytes a, b and c
3) A small delay can then be inserted here to ensure we are not constantly blasting out data.
Receiver
1) Attempt to receive a byte
2) Check the value, is it equal to 101?
3) If 101 received then receive three more times and store into variables a, b and c, otherwise return to start.
Hope this helps.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: RS232 data sending
Thanks. I managed to solve the problem. Was basically a lack of understanding as to how the FC simulator and RS232 FC module works. Telemetry system is working great now.