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
Hot Topic (More than 8 Replies) Serial Monitor with VS2012 + Leonardo: Strange behavior (Read 18495 times)
LuiginoRM
Newbies
*
Offline


Posts: 6
Joined: Jan 18th, 2013
Serial Monitor with VS2012 + Leonardo: Strange behavior
Jan 20th, 2013 at 11:05am
Print Post  
Hi,

my setup is: Visual Studio 2012 + Olimexino32u4 (Arduino Leonardo clone) + Visual Micro 1.1212.30 + Debugger

I can compile and upload, but serial monitor does not work properly. No problem at all with Arduino IDE Serial Monitor.

Any advice?
Thank you
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12198
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Serial Monitor with VS2012 + Leonardo: Strange behavior
Reply #1 - Jan 20th, 2013 at 12:24pm
Print Post  
What do you mean by does not work properly?

Are you using println()?
  
Back to top
IP Logged
 
LuiginoRM
Newbies
*
Offline


Posts: 6
Joined: Jan 18th, 2013
Re: Serial Monitor with VS2012 + Leonardo: Strange behavior
Reply #2 - Jan 20th, 2013 at 1:52pm
Print Post  
Tim@Visual Micro wrote on Jan 20th, 2013 at 12:24pm:
Are you using println()?


Code
Select All
Serial.println("TEST"); 



Sometime writes "TES" without "T", most of the times writes nothing.

On Arduino Ide works ok.

Bye
« Last Edit: Jan 20th, 2013 at 1:53pm by LuiginoRM »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12198
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Serial Monitor with VS2012 + Leonardo: Strange behavior
Reply #3 - Jan 20th, 2013 at 1:55pm
Print Post  
I'll give it a try, what speed are you using?

What other serial statements do you have in your sketch?

Is debugger switch on?

  
Back to top
IP Logged
 
LuiginoRM
Newbies
*
Offline


Posts: 6
Joined: Jan 18th, 2013
Re: Serial Monitor with VS2012 + Leonardo: Strange behavior
Reply #4 - Jan 20th, 2013 at 2:01pm
Print Post  
Tim@Visual Micro wrote on Jan 20th, 2013 at 1:55pm:
What speed are you using?


115200

Tim@Visual Micro wrote on Jan 20th, 2013 at 1:55pm:
What other serial statements do you have in your sketch?


Nothing

Code
Select All
// the loop routine runs over and over again forever:
void loop() {
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(500);               // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(500);               // wait for a second
 
  Serial.println("TEST");
} 



Tim@Visual Micro wrote on Jan 20th, 2013 at 1:55pm:
What Is debugger switch on?


Not installed (Uninstalled).
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12198
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Serial Monitor with VS2012 + Leonardo: Strange behavior
Reply #5 - Jan 20th, 2013 at 2:05pm
Print Post  
Great, that's easy I'll try it later. Such a basic example should just work!!

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


Posts: 12198
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Serial Monitor with VS2012 + Leonardo: Strange behavior
Reply #6 - Jan 20th, 2013 at 5:22pm
Print Post  
I have tested this with a Leonardo and it works fine for me. 

Another test I made with 1ms delay also works



The only thing I can think that would be different is to look at the usb driver in Device Manager (Ports (COM & LPT). 

The usb drivers for the Teensy kit are the same as Arduino. I notice that with my Leonardo plugged in my driver shows a manufacturer of "PJRC.COM, LLC". The driver also has the name "USB Serial (Communication Class, Abstract Controls Model)". pjrc.com make the teensy stuff.

Which driver is showing for your board? 

If you can't find a better driver then there is a post of how to update your usb drivers in this forum somewhere. I'll dig it out if needed.

Thanks

ps: If the debugger is installed or not it does not affect the serial reader unless you set (Micro Debug)=Full
  
Back to top
IP Logged
 
Marius
Developer
****
Offline


Posts: 204
Location: Centurion RSA
Joined: Sep 7th, 2011
Re: Serial Monitor with VS2012 + Leonardo: Strange behavior
Reply #7 - Jan 20th, 2013 at 7:23pm
Print Post  
Tim
The symptoms of this problem seem to be the same that I got. The last character of the printed message is always gone.
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12198
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Serial Monitor with VS2012 + Leonardo: Strange behavior
Reply #8 - Jan 20th, 2013 at 7:34pm
Print Post  
Was that with Leonardo?
  
Back to top
IP Logged
 
Marius
Developer
****
Offline


Posts: 204
Location: Centurion RSA
Joined: Sep 7th, 2011
Re: Serial Monitor with VS2012 + Leonardo: Strange behavior
Reply #9 - Jan 20th, 2013 at 7:41pm
Print Post  
No with the Teensy
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12198
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Serial Monitor with VS2012 + Leonardo: Strange behavior
Reply #10 - Jan 20th, 2013 at 7:45pm
Print Post  
Okay Teensy is probably classed as the same.

This smacks of usb issues, I know vm could be more efficient with the serial reader but I never get problems and run the same system as you. 

Here is a simple example that works for me. Can you please try this, lets work up from here to find when it goes wrong. BUT, LuiginoRM is only sending a small serial packet once per second so we know the buffers are not being blown, the problem has to be something obvious.

Code
Select All
void setup()
{
	Serial.begin(115200);
}

void loop() {
  Serial.println("TEST123456789012345678901234567890TEST");
  Serial.println("TEST123456789012345678901234567890TEST");
  Serial.println("TEST123456789012345678901234567890TEST");
  Serial.println("TEST123456789012345678901234567890TEST");
}
 



Which usb driver shows when your board is plugged in?
« Last Edit: Jan 20th, 2013 at 7:46pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Marius
Developer
****
Offline


Posts: 204
Location: Centurion RSA
Joined: Sep 7th, 2011
Re: Serial Monitor with VS2012 + Leonardo: Strange behavior
Reply #11 - Jan 20th, 2013 at 8:03pm
Print Post  
Correction on my previous post, I also got the error with the Uno. I dropped the Teensy for now and continued the project on the Uno but because I was pumping lots of serial data, I did not monitor again. 
I am running some tests on my system. I will test for you when the hardware is free again.
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12198
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Serial Monitor with VS2012 + Leonardo: Strange behavior
Reply #12 - Jan 20th, 2013 at 8:27pm
Print Post  
Yes you were hammering it. I think it's a different issue, this one is unable to handle 4 characters per second.
  
Back to top
IP Logged
 
LuiginoRM
Newbies
*
Offline


Posts: 6
Joined: Jan 18th, 2013
Re: Serial Monitor with VS2012 + Leonardo: Strange behavior
Reply #13 - Jan 20th, 2013 at 9:02pm
Print Post  
Tim@Visual Micro wrote on Jan 20th, 2013 at 5:22pm:
Which driver is showing for your board? 

If you can't find a better driver then there is a post of how to update your usb drivers in this forum somewhere


I don't think that the driver is responsible. Arduino IDE handles USB communication with the same driver without any problems.

Bye
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12198
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Serial Monitor with VS2012 + Leonardo: Strange behavior
Reply #14 - Jan 20th, 2013 at 9:10pm
Print Post  
Yes but the java serial system uses a very different method for serial comms so how it interacts with the drivers might vary quite a bit.

I have a question, is the last char or every message missing or just the first message after the arduino starts up?

I've just checked vm serial reader and it just reads and displays whatever windows gives it so it is quite simple. 

I have found that the window layout was being disabled prior to writing text to the serial monitor text box. It's a temporary setting that vs resumes when it requires so should not be part of this problem. This was old code that is no longer required so I have removed it. But I am clutching at straws in a very simple system. 

I don't want to waste your time more than this has already but, trying the usb drivers from pjrc who produce the similar Teensy board might be worth a try. There must be a reason why they decided not to use the drivers supplied with the arduino ide. Again clutching at straws, sorry.
  
Back to top
IP Logged
 
LuiginoRM
Newbies
*
Offline


Posts: 6
Joined: Jan 18th, 2013
Re: Serial Monitor with VS2012 + Leonardo: Strange behavior
Reply #15 - Jan 20th, 2013 at 10:17pm
Print Post  
Tim@Visual Micro wrote on Jan 20th, 2013 at 9:10pm:
I have a question, is the last char or every message missing or just the first message after the arduino starts up?

I've just checked vm serial reader and it just reads and displays whatever windows gives it so it is quite simple. 

[...]

I don't want to waste your time more than this has already but, trying the usb drivers from pjrc who produce the similar Teensy board might be worth a try. There must be a reason why they decided not to use the drivers supplied with the arduino ide. Again clutching at straws, sorry.


When works strips every last char. Tomorrow i'll try your driver, do you have the url?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12198
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Serial Monitor with VS2012 + Leonardo: Strange behavior
Reply #16 - Jan 20th, 2013 at 10:29pm
Print Post  
The teensy windows/xp/vista/7 installer should create a Teensyduino folder. 

http://www.pjrc.com/teensy/td_download.html

Teensyduino is just a slightly adapted version of the arduino. The drivers folder below the ide should contain all the usb drivers.
« Last Edit: Jan 20th, 2013 at 10:29pm by Tim@Visual Micro »  
Back to top
IP Logged
 
LuiginoRM
Newbies
*
Offline


Posts: 6
Joined: Jan 18th, 2013
Re: Serial Monitor with VS2012 + Leonardo: Strange behavior
Reply #17 - Jan 21st, 2013 at 2:01pm
Print Post  
Tim@Visual Micro wrote on Jan 20th, 2013 at 10:29pm:
The teensy windows/xp/vista/7 installer should create a Teensyduino folder. 

http://www.pjrc.com/teensy/td_download.html

Teensyduino is just a slightly adapted version of the arduino. The drivers folder below the ide should contain all the usb drivers.


Same as Arduino IDE driver Sad Not working at all. When I have a moment, I'll try a clean installation.

Bye
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12198
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Serial Monitor with VS2012 + Leonardo: Strange behavior
Reply #18 - Jan 21st, 2013 at 5:59pm
Print Post  
Thanks for trying. I don't think a clean install will help. The product is just a few dlls in the Visual micro program folder.

I guess you have all windows and vs service packs applied?

I'll try to add a serial trace facility over the next few days so that we can see if this is a serial/usb or UI issue.

I will also create a little c# app that reads the serial port just to prove that vm/vs is struggling and not windows/usb

Thanks for the update

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


Posts: 12198
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Serial Monitor with VS2012 + Leonardo: Strange behavior
Reply #19 - Jan 21st, 2013 at 7:33pm
Print Post  
By the way I think I should explain why I am not pouring over the vm code looking for an obvious bug. 

The serial reader is a relatively simple routine, whilst I do expect to find some things that I can improve in VM, this problem is not as obvious as it seems.

First off, I know a lot of people using the serial window without these issues. More importantly the debugger relies on serial for all communications. 

If we had this general problem the debugger would never work. Aside from myself, I know of quite a few people debugging both Leonardo and Uno. So again we have working serial.

I only tell you this so that you know it can work, should work and worth the effort to make it work. I hope  Smiley

One other question. Do you have an FTDI cable or similar. If so you should be able to hook up to the Tx1 and Rx1 pins and try out Serial1 instead. This uses the std Arduino hardware serial, interested to know if you find a difference??

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