Baud rate change inside the FC programm
Moderator: Benj
-
- 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
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
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
- 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
This is feature is enabled in FCv5 already. We can try to help you to have that in FCv4.5.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??
-
- 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
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
Flowcode
Professional-Version
Flowcode v4.5.18.74s
BR
Dirk
- 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
Hi
I guess you are using software USART for RS232 as you are using 100K Baud rate. Is it?
I guess you are using software USART for RS232 as you are using 100K Baud rate. Is it?
-
- Posts: 99
- Joined: Fri Feb 02, 2007 3:54 pm
- Location: Germany
- Has thanked: 14 times
- Been thanked: 12 times
- Contact:
- 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
Actually the Baud rate change function in FCv5 supports 115.2Kbps maximum speed.
-
- 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
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
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
- 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
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?
-
- 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
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
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
- 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
Seems like should be possible to do that but need to do some trial to test whether it works or not.
-
- 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
Would be a good reason for me to buy a Prof. FC 5 license.
BR
Dirk
BR
Dirk
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
- Contact:
- 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
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);
To change to 9600 baud:
spbrg = (((MX_CLK_SPEED / 9600) - 16) / 16);
To change back to 100Kbaud:
spbrg = (((MX_CLK_SPEED / 100000) - 16) / 16);
-
- 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
Great many thanks!!
I will try it over the coming weekend!!
BR
Dirk
I will try it over the coming weekend!!
BR
Dirk