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 Why should be avoid break point on serial.print() code lines? (Read 2864 times)
Gilles Plante
Full Member
***
Offline


Posts: 156
Location: Québec, Canada
Joined: Oct 31st, 2013
Why should be avoid break point on serial.print() code lines?
Jul 24th, 2014 at 8:26pm
Print Post  
Quote:
One thing to watch out for which has not affected you in these images but worth mentioning is that Arduino doesn't like too many serial print statements on top of each other. I notice you set a break point on your own serial.print debug statements. This is not recommended.

Hi Tim, those two recommendations got my attention.

What is the issue with serial print statements in a bunch, same question about setting a breakpoint on a serial print statement ?

Thanks
« Last Edit: Jul 24th, 2014 at 8:34pm by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Why should be avoid break point on serial.print() code lines?
Reply #1 - Jul 24th, 2014 at 8:46pm
Print Post  
Hi Giles,

I have split the question into a new thread because it is important to keep each discussion with a clear subject making it easier for people to find solutions. The other thread was more of a question from a newbie about how to debug.

There are a few things to consider.

Normally break points on serial.print messages are okay but many users don't know how often their code is executing so it's possible to end up with many serial messages all on top of each other without any sort of gap/delay/spacing. For this reason best practice is for people to consider the volume of serial messages being sent or to allow gaps and time for the outbound messages to be sent.

The capability of the Arduino is affected more by the rate of hard coded serial.print() messages, number of debugger messages and speed of the serial. The user in the other post was using 9600 baud which is slow.

The arduino has to do a lot of work to transmit the messages. If the small Arduino serial buffer fills up to quickly it will wrap and cause previous outbound data to be destroyed. This should be a consideration for all Arduino projects regardless of debugger.

The pc has to do quite a lot of work to split up the inbound serial and display debugger data. If too many messages come in too quickly the pc won't cope and will fall behind in it's display of debugger status. 

So putting a debug message on a hard coded serial message should be avoid but if the break point is hit infrequently (ie: not in the loop()) it will be okay.

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