Uart question in FC4

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
MarkW
Flowcode v5 User
Posts: 118
Joined: Thu Sep 17, 2009 1:30 pm
Has thanked: 3 times
Been thanked: 11 times
Contact:

Uart question in FC4

Post by MarkW »

Hi guys

I have a question about the uart macro in FC4, with respect to the hardware and "soft" uart
options. The situation is i will be receiving and sending data on the hardware TX/RX, but also
need another TX on some other i/o pin. So the question is, if i enable hardware uart for the
normal TX/RX pair(macro properties select box), will i be able to set another uart macro
properties for soft TX on another i/o in another part of the program when i need to do this?
Will this not confuse the properties of the macro box that had already the hardware uart set
or cause some sort of clash or override?
Also if this is possible, when the soft uart is setup in the macro box, what happens to the
actual hardware uart pins? (do they become inactive/idle), as the hardware uart port will
be interrupt driven. I am just concerned that i may miss in-coming char on the hardware
uart RX when the "soft" uart TX is busy.

Sorry quite a mouthful, but i need to ask this as its a bit of a puzzle otherwise and may
complicate the pcb design to make provision for other flow control ability. The "soft" uart TX
will be used for xon/xoff flow control.

Thanx

Mark

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: Uart question in FC4

Post by Benj »

Hello Mark,

It should be possible for you to add two of the RS232 components to your program.

The first RS232 component can be set to hardware mode and you can use as and when you need.

The second RS232 component can be set to software and again can be called as and when it's needed. A software UART in transmit mode should be pretty much as reliable as the hardware UART though you may need to tweak the baud calculation a bit as the v4 software UART is not as reliable as the v5 version.

Therefore both UART RS232 connections will be permanently taking control of the specific I/O pins.

Does this help?

MarkW
Flowcode v5 User
Posts: 118
Joined: Thu Sep 17, 2009 1:30 pm
Has thanked: 3 times
Been thanked: 11 times
Contact:

Re: Uart question in FC4

Post by MarkW »

Hi Ben,

Thanx for coming to the rescue again :)

It makes sense what you saying, will give it a bash. I do know from previous experience
on other compilers that "soft" TX is pretty much reliable....almost same as
hardware TX. Its the "soft" RX that gets tricky (not using that at all for obvious
reasons).

Just another quick question...In the uart macro options there is also a tick box
for RTS/CTS enable. If this is enabled, what determines when the RTS (going to
device CTS) is asserted or not? Does it toggle on every character received? A pre-determined
buffer size?
Typically i use that under manual control such that when a buffer reaches a max setpoint
i would take that RTS output low to stop flow and flush the buffer and then take it high
again to indicate flow may continue.
In this instance under FC control how does the RTS/CTS work?

Many thanx

Mark

Post Reply