RS232 data sending

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Post Reply
keejay
Flowcode v5 User
Posts: 115
Joined: Tue Jul 23, 2013 10:02 am
Been thanked: 15 times

RS232 data sending

Post by keejay »

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

User avatar
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

Post by Benj »

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.

keejay
Flowcode v5 User
Posts: 115
Joined: Tue Jul 23, 2013 10:02 am
Been thanked: 15 times

Re: RS232 data sending

Post by keejay »

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.

Post Reply