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 nonstop reading from serial port (Read 4646 times)
devpap7
Newbies
*
Offline


Posts: 3
Location: Germany
Joined: Sep 20th, 2014
nonstop reading from serial port
Sep 21st, 2014 at 8:17pm
Print Post  
Hi everyone,

i wrote a sketch inspired by a book for arduino software. Basically the code is waiting for serial events in the serialEvent-Function. 
When I upload the code using Visual Studio 2012 oder Atmel Studio 6.2 (in debug mode) and send something through the serial window my arduino ist justing running crazy. TX and RX are generally lit up. Can't send more commands in this state.
But if I m using the Arduino Development Enviroment my sketch is running an detecting my commands. Did I miss to check some properties or anything like this. If interested, find the source is in the attachment of this post.

thanks for support
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: nonstop reading from serial port
Reply #1 - Sep 21st, 2014 at 10:01pm
Print Post  
Yes that sort of makes sense.

By default the debugger gives an easy option where it can be shared with normal serial.println()  use from within the Arduino code.

However if you are sending from the pc then this will interfere with the pause/continue mechanism of the debugger. Less so if you do not have any breakpoints that pause/break (ie: Only have Trace points)

It's not supported to share the serial port with the debugger and also to send manually serial data to the arduino using the same port.

Of course you could upload without debugging and it will perform the same as the Arduino Ide but that means no debug.

As an alternative Visual Micro support debug on other Serial ports or using 1 or 2 digital pins. Please see this page from the Documentation for more details http://www.visualmicro.com/page/User-Guide.aspx?doc=Tracepoints-and-execution-sp...
  
Back to top
IP Logged
 
devpap7
Newbies
*
Offline


Posts: 3
Location: Germany
Joined: Sep 20th, 2014
Re: nonstop reading from serial port
Reply #2 - Sep 22nd, 2014 at 10:33am
Print Post  
this is a pretty good answer. thank you very much. i ll try to configure a different port or even another pin. I m not exactly sure what this means right now.
Using the Arduino Uno, is it even possible to redirect the debugger to another port?
Isn't there just one serial port on this board?
« Last Edit: Sep 22nd, 2014 at 10:37am by devpap7 »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: nonstop reading from serial port
Reply #3 - Sep 22nd, 2014 at 12:21pm
Print Post  
Hi,

You are right with the Uno you only have one real serial port but you can use the Visual Micro "SoftwareSerial" option in the debugger properties.

This allows you to buy an FTDI cable which plugs into your pc usb and allows you to connect a couple of wires from digital pins to the cable. Then the Arduino pretends to be a serial port.

The SoftwareSerial option is best used at speeds <= 56k and for non-break (trace mode) requires only one wire/pin.
  
Back to top
IP Logged
 
devpap7
Newbies
*
Offline


Posts: 3
Location: Germany
Joined: Sep 20th, 2014
Re: nonstop reading from serial port
Reply #4 - Sep 22nd, 2014 at 2:58pm
Print Post  
Interesting, thank you for your advice. for now I ll just can change the board. the software serial options is also worth a look, but right now there is no FTDI cable abvailable. Can you point me to such hardware. I don't know this kind of hardware. just a likewise cable which is compatible with the arduino uno.
« Last Edit: Sep 22nd, 2014 at 3:20pm by devpap7 »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: nonstop reading from serial port
Reply #5 - Sep 22nd, 2014 at 3:19pm
Print Post  
makes sense, you might also find that using TracePoints instead of BreakPoints avoids the issue
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint