Page 1 of 1

Baud rate change inside the FC programm

Posted: Tue Dec 18, 2012 6:31 pm
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

Re: Baud rate change inside the FC programm

Posted: Tue Dec 18, 2012 7:14 pm
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.

Re: Baud rate change inside the FC programm

Posted: Tue Dec 18, 2012 8:16 pm
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

Re: Baud rate change inside the FC programm

Posted: Tue Dec 18, 2012 10:12 pm
by Enamul
Hi
I guess you are using software USART for RS232 as you are using 100K Baud rate. Is it?

Re: Baud rate change inside the FC programm

Posted: Tue Dec 18, 2012 10:24 pm
by Dirk Bubley
No I´m using the Pic Hardware UART.

BR

Dirk

Re: Baud rate change inside the FC programm

Posted: Tue Dec 18, 2012 10:35 pm
by Enamul
Actually the Baud rate change function in FCv5 supports 115.2Kbps maximum speed.

Re: Baud rate change inside the FC programm

Posted: Tue Dec 18, 2012 11:07 pm
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

Re: Baud rate change inside the FC programm

Posted: Tue Dec 18, 2012 11:19 pm
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?

Re: Baud rate change inside the FC programm

Posted: Tue Dec 18, 2012 11:39 pm
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

Re: Baud rate change inside the FC programm

Posted: Tue Dec 18, 2012 11:46 pm
by Enamul
Seems like should be possible to do that but need to do some trial to test whether it works or not.

Re: Baud rate change inside the FC programm

Posted: Tue Dec 18, 2012 11:58 pm
by Dirk Bubley
Would be a good reason for me to buy a Prof. FC 5 license.

BR

Dirk

Re: Baud rate change inside the FC programm

Posted: Wed Dec 19, 2012 12:07 am
by Enamul
Yes, FCv5 is blessed with many feature like that.

Re: Baud rate change inside the FC programm

Posted: Wed Dec 19, 2012 10:30 am
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);

Re: Baud rate change inside the FC programm

Posted: Wed Dec 19, 2012 4:13 pm
by Dirk Bubley
Great many thanks!!

I will try it over the coming weekend!!

BR

Dirk