RS232 help

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
siliconchip
Posts: 392
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 101 times
Been thanked: 25 times

RS232 help

Post by siliconchip »

hi all can anyone help me with a simple program between a pic and pc using RS232 i have very basic knowledge on serial comms and would appreciate some help also can the 232 be used in changing the parameters of a program for example if i have a simple program flashing a LED at 1Hz can i change this frequency to say 3Hz via 232 with the program running, any help would be greatly appreciated thanks

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 help

Post by Benj »

Hello,

Have you looked at the Flowcode 4 examples download. In there are example files for each of the components including RS232 to help get you started. The component help file (component properties -> help) is also a good reference point.

Also yes controlling things via the RS232 connection is simple to do. All you would do is say setup a timer interrupt based on a control variable to control your output. You would then listen for incoming messages and create your own protocol.

For example a simple 2 byte protocol like this could be used. command, data.

Here you would receive a byte and see if it is a valid command using decision icons or a switch icon. If a valid command is received then receive another byte and use this as the data for the specific task.

eg. command 0 = change frequency
command = RS232 receive byte
if command = 0
yes:
data = RS232 receive byte
new frequency = data

siliconchip
Posts: 392
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 101 times
Been thanked: 25 times

Re: RS232 help

Post by siliconchip »

hi benj thanks for the reply but i am still unsure how my pc would interact using 232 do i need a program to open on the pc to get a screen up to communicate with the pic etc

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 help

Post by Benj »

Hello,

If your using XP then you can use Hyperterminal to manually send data to the PIC. On Win Vista or 7 download an application called RealTerm and this will do the same job.

To automate the process you could use the free version of VB 2010 as there are some good tutorials on how to get started with this.

This is a good starting point for the VB.
http://tiktakx.wordpress.com/2010/11/21 ... -net-2010/

Post Reply