RS232 help

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

Post Reply
User avatar
goldwingers
Posts: 118
Joined: Wed Sep 06, 2006 1:22 pm
Location: London
Been thanked: 1 time
Contact:

RS232 help

Post by goldwingers »

In your example program on rs232 what do the following refer to

> ?....
< ?....

also i see this cropping up in programs "==" what does this do.

cheers guys

Ian

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:

Post by Benj »

Hello Ian

These commands are all comparisons.

> means greater then.

5 > 3 would return true (1)
3 > 5 would return false (0)
3 > 3 would return false (0)


< means less then.

5 < 3 would return false (0)
3 < 5 would return true (1)
3 < 3 would return false (0)


== means logically equal.

3 == 5 would return false (0)
3 == 3 would return true (1)

User avatar
goldwingers
Posts: 118
Joined: Wed Sep 06, 2006 1:22 pm
Location: London
Been thanked: 1 time
Contact:

reply...

Post by goldwingers »

Hi Beng

I get that but in your RS232 sample flowcode you ask if the input is anything other than 255 this is then followed by another decision box with the following

What are these char's im supposing they are < & > but what does it do?. the return char's as in the program.....(CHR<>60) AND (CHR<>62)

Cheers Ian

MW
Posts: 38
Joined: Mon Feb 26, 2007 2:04 am
Has thanked: 4 times
Been thanked: 2 times

RS232 Question

Post by MW »

Hi Guys,

Another RS232 Question. I know from previous threads that the RS232 component assumes a Xtal speed of 19.96MHz and that to adapt this to other Xtals you need to edit the C code.

Could you please elaborate on this a little. Specifically what (register?) do you edit and how do you derive what the new value should be for the new Xtal.

Thanks
MW

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:

Post by Benj »

Hello Ian

In the example CHR <> 60 means not equal to 60.

eg

if CHR = 59 then CHR <> 60 returns true (1)
if CHR = 60 then CHR <> 60 returns false (0)

You can also use the following instead to do the same function

CHR != 60

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:

Post by Benj »

Hello MW

The clock speed in Flowcode is set via the Chip -> Clock Speed menu.

Once this setting has been set correctly you can go into the properties for the RS232 component and adjust the baud rate accordingly.

No edits to the C code are required.

User avatar
goldwingers
Posts: 118
Joined: Wed Sep 06, 2006 1:22 pm
Location: London
Been thanked: 1 time
Contact:

One last thing

Post by goldwingers »

What is CHR 60 ?

and why do you filter it out?

sorry thats 2 things

Ian

User avatar
Steve
Matrix Staff
Posts: 3433
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times

Post by Steve »

60 is "<" and 62 is ">".

I've not seen the program, so I don't know why those two characters are filtered out. Presumably it is part of the communication from the PC.

Post Reply