Baud rate change inside the FC programm

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
Dirk Bubley
Posts: 99
Joined: Fri Feb 02, 2007 3:54 pm
Location: Germany
Has thanked: 14 times
Been thanked: 12 times
Contact:

Baud rate change inside the FC programm

Post by Dirk Bubley »

Hello FC team,

I`m facing a new problem regarding UART communication.

In one of my projects I`m using a PIC 18F2420 UART with 100,000Baud. It works perfect and the setup was done for the Baud rate in the FC UART setup page for the device.

For setup reasons I would like to change the baud rate to 9600Baud during the programm opperation in order to communicate with a different RS232 device.
Is there a way for example with C-Code to modify the baud rate for a special lets say macro of the programm opperation and then go back to 100KBaud again??

Any help is welcome.

BR

Dirk

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: Baud rate change inside the FC programm

Post by Enamul »

Is there a way for example with C-Code to modify the baud rate for a special lets say macro of the programm opperation and then go back to 100KBaud again??
This is feature is enabled in FCv5 already. We can try to help you to have that in FCv4.5.
Enamul
University of Nottingham
enamul4mm@gmail.com

Dirk Bubley
Posts: 99
Joined: Fri Feb 02, 2007 3:54 pm
Location: Germany
Has thanked: 14 times
Been thanked: 12 times
Contact:

Re: Baud rate change inside the FC programm

Post by Dirk Bubley »

Yes that would be great if i could do this in 4.5. Below you can see my FC version.


Flowcode
Professional-Version
Flowcode v4.5.18.74s

BR

Dirk

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: Baud rate change inside the FC programm

Post by Enamul »

Hi
I guess you are using software USART for RS232 as you are using 100K Baud rate. Is it?
Enamul
University of Nottingham
enamul4mm@gmail.com

Dirk Bubley
Posts: 99
Joined: Fri Feb 02, 2007 3:54 pm
Location: Germany
Has thanked: 14 times
Been thanked: 12 times
Contact:

Re: Baud rate change inside the FC programm

Post by Dirk Bubley »

No I´m using the Pic Hardware UART.

BR

Dirk

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: Baud rate change inside the FC programm

Post by Enamul »

Actually the Baud rate change function in FCv5 supports 115.2Kbps maximum speed.
Enamul
University of Nottingham
enamul4mm@gmail.com

Dirk Bubley
Posts: 99
Joined: Fri Feb 02, 2007 3:54 pm
Location: Germany
Has thanked: 14 times
Been thanked: 12 times
Contact:

Re: Baud rate change inside the FC programm

Post by Dirk Bubley »

Up to 115kBaud is fine. Actually as said I`m using 100KBaud.

I need only the possibility to change between 9K6 and 100K and vice versa.

How is this done in FC5. I checked the demo software but I cant find any differences to setup the RS232 properties.
It looks the same like FC4.5 ???

BR

Dirk

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: Baud rate change inside the FC programm

Post by Enamul »

It's done in CAL layer not even in c component code..to modify that you should have access to professional Flowcode v5 but the problem is not that. I guess that will work only at standard speeds not any customize speed like 100K. Can you use any of the standard speed with 9.6 other than 100K?
Enamul
University of Nottingham
enamul4mm@gmail.com

Dirk Bubley
Posts: 99
Joined: Fri Feb 02, 2007 3:54 pm
Location: Germany
Has thanked: 14 times
Been thanked: 12 times
Contact:

Re: Baud rate change inside the FC programm

Post by Dirk Bubley »

Unfortunatly the 100KBaud rate is a must.

How about the Customize C-Code feature in FC5. Would be there a possibility to preset a individual Baudrate related to each RS232 component marco??


BR Dirk

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: Baud rate change inside the FC programm

Post by Enamul »

Seems like should be possible to do that but need to do some trial to test whether it works or not.
Enamul
University of Nottingham
enamul4mm@gmail.com

Dirk Bubley
Posts: 99
Joined: Fri Feb 02, 2007 3:54 pm
Location: Germany
Has thanked: 14 times
Been thanked: 12 times
Contact:

Re: Baud rate change inside the FC programm

Post by Dirk Bubley »

Would be a good reason for me to buy a Prof. FC 5 license.

BR

Dirk

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: Baud rate change inside the FC programm

Post by Enamul »

Yes, FCv5 is blessed with many feature like that.
Enamul
University of Nottingham
enamul4mm@gmail.com

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Baud rate change inside the FC programm

Post by LeighM »

You can test the baud rate changing by adding a C code icon.

To change to 9600 baud:
spbrg = (((MX_CLK_SPEED / 9600) - 16) / 16);

To change back to 100Kbaud:
spbrg = (((MX_CLK_SPEED / 100000) - 16) / 16);

Dirk Bubley
Posts: 99
Joined: Fri Feb 02, 2007 3:54 pm
Location: Germany
Has thanked: 14 times
Been thanked: 12 times
Contact:

Re: Baud rate change inside the FC programm

Post by Dirk Bubley »

Great many thanks!!

I will try it over the coming weekend!!

BR

Dirk

Post Reply