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 compiler settings (Read 4391 times)
Robert Voigtländer
Newbies
*
Offline


Posts: 3
Joined: Jan 10th, 2013
compiler settings
Mar 8th, 2013 at 6:09am
Print Post  
Hi,

I have a small problem with Visual Micro - or I may do something wrong.

So far all went really fine. I use Visual Micro and the debugger since a while and it is of great help.

With my new robot I use encoders. Just for testing I output the encoder counter values in the main loop.

Important code:
Code
Select All
//declarations
volatile unsigned long encRight = 0;
volatile unsigned long encLeft = 0;

//Setup
pinMode(2, INPUT_PULLUP); attachInterrupt(0, encLeftInterrupt, CHANGE);
pinMode(3, INPUT_PULLUP); attachInterrupt(1, encRightInterrupt, CHANGE);

//Loop
Serial.print(encRight);
Serial.print("-");
Serial.println(encLeft);

//Interruput functions
void encRightInterrupt() {
	encRight = encRight+1;
}

void encLeftInterrupt() {
	encLeft = encLeft+1;
} 



When I compile and upload my sketch with the Arduino GUI, I see the counter for the interrupts raise in the serial output.
When I compile it with Visual Micro the values stay 0.

May it be that the volatile declaration is ignored by the compiler?

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


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: compiler settings
Reply #1 - Mar 8th, 2013 at 7:59am
Print Post  
Hi, the plugin uses the same programs to compile as the Arduino IDE. So it's more likely to be a different problem. Can you compile without debug and see if that works?  (Micro Debug) = False

Thanks
« Last Edit: Mar 8th, 2013 at 12:57pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Robert Voigtländer
Newbies
*
Offline


Posts: 3
Joined: Jan 10th, 2013
Re: compiler settings
Reply #2 - Mar 8th, 2013 at 1:18pm
Print Post  
I'll give it a try this weekend.

Robert
  
Back to top
 
IP Logged
 
Robert Voigtländer
Newbies
*
Offline


Posts: 3
Joined: Jan 10th, 2013
Re: compiler settings
Reply #3 - Mar 11th, 2013 at 7:03am
Print Post  
It worked with both programs this weekend. Not sure what I did wrong last time.

Soo .. just forget about it Smiley

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


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: compiler settings
Reply #4 - Mar 11th, 2013 at 8:28pm
Print Post  
Thanks for the update. 

Things to watch out for, if sharing the serial port with the debugger. 

Do not  put breakpoints on your own manual serial statements. 

Do try to limit your own serial to a reasonable rate. It can overflow the arduino serial buffer and cause confusing displays.

If you are using the debugger, where possible use breakpoint messages instead of manual serial.print messages. Normally this consumes less memory because vm does not store the debug strings on the arduino chip, it also simplifies the serial output and leads to less problems.

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