RS 232 communication

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
ncc1502
Posts: 48
Joined: Mon Apr 07, 2008 9:18 pm
Has thanked: 23 times
Been thanked: 8 times
Contact:

RS 232 communication

Post by ncc1502 »

I need parity on a project (only sending).

simple Pics don't have parity, but there is a possibility to choose 9 databits, so the 9th bit could be the (self calculated) parity.

The 9 bit option is greyed out, how do i set this up?
How do i send the 9th bit to the uart register (txsta.tx9d)?

I assume i have to change the code of the RS232 component (initialisation and TX).

When i look at the code of the RS232 component i don't understand all the %m things (i am not a C programmer). Is there somewhere help on how to understand the setup so i might figure out how to do this?

On the Sendchar code i found:
#if(%m_DATASIZE == 1)
if (test_bit(nChar, 8))
st_bit(txsta, TX9D);
else
cr_bit(txsta, TX9D);
#endif
This looks like something usefull, but i have no clue on how to adapt this.

Perhaps MM can enlighten me.
Better safe then sorry

Sean
Valued Contributor
Valued Contributor
Posts: 548
Joined: Tue Jun 26, 2007 11:23 am
Has thanked: 6 times
Been thanked: 44 times
Contact:

Re: RS 232 communication

Post by Sean »

Hello,

The ability to select the 9th data bit is enabled when 'Char receive type' option is set to Int.

Data should be written and read using integer values.

You should be able to calculate a parity bit for each 8-bit data byte, and attach it as the 9th bit before sending.

Note: Receive time-outs and errors are handled differently in the 9-bit mode of operation. Refer to the Component Properties' section of the RS232 component help file if you need information on this or the other V4 changes.

Post Reply