Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Wrong baud rate for serial comm in Debug (Read 4918 times)
Marius S
Junior Member
**
Offline


Posts: 11
Joined: Sep 26th, 2013
Wrong baud rate for serial comm in Debug
Jul 16th, 2014 at 8:11pm
Print Post  
Hi!

I encountered a strange behaviour in the last version of VisuaMicro. 

I open the project, open the serial comm window and set it at 9600 bauds if it is not already setted ('clear', 'reconnect' are checked and 'CR and NL' option is selected) . 

I have already setted 2 breakpoints (in a .cpp file attached t othe project) and I start debugging (F5).

After the upload, the baud rate in the comm serial window always revert to 115200.

Let's say that I change back the baud rate to the 9600 bauds, then I start to see the data coming in the Output/Micro Debug Trace window. 
If I stop the debug sesion (blue square button) and then start the debugging again, the comm rate jumps back to 115200.
In Tools/Options/VisualMicro/General/Communications I can see that the Baud rate is setted (grayed) at 9600.

Am I doing something wrong? I am merely a limited user of the Visual Studio with limited experience also.
I have to say that this behaviour started with the new version and was not present in the previous versions.

Note: all the settings are at default except the Intellisense where Always Re-add header is True.
I use VS2013(update 2) on Win8.1 x64.

Thank you!
Marius

LE: Found the answer on a previous topic:
"Something important that appears to be lost somewhere within the depths of the new documentation is a note to explain that the default speed for the debugger is 115k. If your sketch code is sharing the same serial port that the debugger uses then you will see that the serial monitor shows a speed of 115k when the debugger opens.

Because your code has elected to use 9600 then you need to tell Visual Micro to use 9600. You do this using the LocalSpeed and RemoteSpeed project property. You will see that in your case you can just fill in one of the properties and the other will automatically populate with the same value. Either that or alter your sketch serial.begin() to 115k

So the fact that your arduino is sending at 9600 but the pc is using 115k is the reason why no breakpoint data is appearing. 

How to find the project properties window is here http://www.visualmicro.com/page/User-Guide.aspx?doc=Project-Properties-window.ht...."
« Last Edit: Jul 16th, 2014 at 9:50pm by Marius S »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Wrong baud rate for serial comm in Debug
Reply #1 - Jul 16th, 2014 at 11:25pm
Print Post  
Thanks for the post and the answer.

The new docs are still under review and we will surely make this clearer.

The documentation index does contain this topic Debugging with Different Ports, Pins and Speeds but we will try to add it to more obvious places and also maybe add a note to the serial monitor when Tutorial Mode is on.

The reason as you have found is that the debug code is compiled into the sketch so the speed can not be altered after upload without recompile. 

Therefore Visual Micro forces the Serial Monitor to be the "correct" speed (if it knows the current port and project have debugging configured).

If your sketch code is sharing the serial port with the debugger then the speed that Visual Micro expects and the speed your sketch code speeds must match.

Alternatively you can use a different serial port for debug if available. If not then one or two spare digital pins can be used with the SoftwareSerial debugger transport setting.

Thanks again

  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint