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 Sharing the Serial port (beta 2) SOLVED (Read 7993 times)
John C
Newbies
*
Offline


Posts: 7
Location: Nottingham, UK
Joined: Oct 26th, 2011
Sharing the Serial port (beta 2) SOLVED
Aug 6th, 2012 at 1:25pm
Print Post  
I find that no Serial output comes from the sketch until a breakpoint is hit. The first output from the following code is "in loop 1", where we should see a "Started" followed by a "in loop 0". Breakpoints are on each digital write.
int loopCnt = 0;

void setup()
{
     pinMode(13,OUTPUT);
     Serial.begin(115200);
     Serial.println("Started");
}

void loop()
{
     Serial.print("in loop "); Serial.println(loopCnt);
     digitalWrite(13,HIGH);
     loopCnt++;
     delay(1000);
     digitalWrite(13,LOW);
     delay(1000);
}
« Last Edit: Aug 7th, 2012 at 7:51am by John C »  
Back to top
 
IP Logged
 
John C
Newbies
*
Offline


Posts: 7
Location: Nottingham, UK
Joined: Oct 26th, 2011
Re: Sharing the Serial port (beta 2)
Reply #1 - Aug 6th, 2012 at 1:31pm
Print Post  
Further to this I find that all works fine when I use a baud rate of 9600 rather than 115200.

This is not reliable all the time
« Last Edit: Aug 6th, 2012 at 1:41pm by John C »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Sharing the Serial port (beta 2)
Reply #2 - Aug 6th, 2012 at 2:47pm
Print Post  
My answer has been removed because it was rubbish!
« Last Edit: Aug 6th, 2012 at 7:00pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Sharing the Serial port (beta 2)
Reply #3 - Aug 6th, 2012 at 2:53pm
Print Post  
9600 is just forcing the arduino to crawl and preventing it from overflowing it's 250 byte transmit buffer.

Use a Timer to ensure certain parts of your code are running at different speeds. This will more closly match a real-world example.

By the way I have been useing SoftwareSerial as a debug transport recently and it works really well. If you are not using break/pause or startup/wait then you only need the tx wire from any arduino pin to the rx pin of an fdti cable.
« Last Edit: Aug 6th, 2012 at 2:56pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
John C
Newbies
*
Offline


Posts: 7
Location: Nottingham, UK
Joined: Oct 26th, 2011
Re: Sharing the Serial port (beta 2)
Reply #4 - Aug 6th, 2012 at 5:56pm
Print Post  
Please note the messages are limited to one every two seconds (spot the delays  Cool ) - surely not too much data.
Breakpoints are on the digitalWrite statements.
I am aware that the debugger can do it all for this example - this is a very simplified example rather that the proper sketch.
« Last Edit: Aug 6th, 2012 at 5:59pm by John C »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Sharing the Serial port (beta 2)
Reply #5 - Aug 6th, 2012 at 6:15pm
Print Post  
oh I am really sorry. I was using a little screen earlier when i looked at the message and rushed too fast!

Is the dtr enabled on your serial window when it opens? if not please switch on thanks.

if that doesn't fix it then please see what happens if you remove the serial.begin()

thanks
« Last Edit: Aug 6th, 2012 at 7:02pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
John C
Newbies
*
Offline


Posts: 7
Location: Nottingham, UK
Joined: Oct 26th, 2011
Re: Sharing the Serial port (beta 2)
Reply #6 - Aug 7th, 2012 at 7:50am
Print Post  
Problem went away when I set DTR on the Serial Window.

SOLVED

Thanks. Smiley
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Sharing the Serial port (beta 2) SOLVED
Reply #7 - Aug 7th, 2012 at 1:22pm
Print Post  
great, thanks for the update
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint