Hi,
is there anything to consider when using the command CahngeHWBaud to change the UART in the program from 9600 to 115200? Unfortunately this does not work properly for me.
Thanks for your help
UART baud rate change in the program
-
- Posts: 103
- http://meble-kuchenne.info.pl
- Joined: Mon Dec 07, 2020 12:47 pm
- Been thanked: 1 time
-
- Valued Contributor
- Posts: 458
- Joined: Mon Dec 07, 2020 1:00 pm
- Has thanked: 82 times
- Been thanked: 246 times
Re: UART baud rate change in the program
Could you give us a sample program?
This would at least tell us the target device.
When you say it doesn't work, what does it do?
Stay at 9600?
This would at least tell us the target device.
When you say it doesn't work, what does it do?
Stay at 9600?
Re: UART baud rate change in the program
Yes, I know that was a bit short on information. I just wanted to ask if there are any known issues.
The controller is an ATMEGA328P. Something strange is happening, I think there is a bug. I can't tell what baud rate it's running at after the command, all I know is that it stops receiving. If I start at 9600 and then switch to 115200 it doesn't work, if the UART is running at 115200 it works. I also have the same problem when I monitor the UART input via an interrupt. I activate the interrupt with different macros using an IF query. If, for example, the result of the query is "Yes" and the "No" branch also contains an activation of the RX interrupt, then no reception works, even if I deactivate the "No" interrupt activation! only when I delete it does it continue to run without errors.
The program is big and has many irrelevant parts, I have to make a small demo version to post it here: ....
The controller is an ATMEGA328P. Something strange is happening, I think there is a bug. I can't tell what baud rate it's running at after the command, all I know is that it stops receiving. If I start at 9600 and then switch to 115200 it doesn't work, if the UART is running at 115200 it works. I also have the same problem when I monitor the UART input via an interrupt. I activate the interrupt with different macros using an IF query. If, for example, the result of the query is "Yes" and the "No" branch also contains an activation of the RX interrupt, then no reception works, even if I deactivate the "No" interrupt activation! only when I delete it does it continue to run without errors.
The program is big and has many irrelevant parts, I have to make a small demo version to post it here: ....
-
- Valued Contributor
- Posts: 1549
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 138 times
- Been thanked: 737 times
Re: UART baud rate change in the program
There is some code at https://www.flowcode.co.uk/mmforums/vie ... te#p103383 which did this for the Arduino Mega and 328p.
Martin
Martin
Re: UART baud rate change in the program
Hi Martin,
Thank you! I nearly went mad with the error.
That works, great
Thank you! I nearly went mad with the error.
That works, great
