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 Debug Interfering with Code Execution. (Read 1733 times)
Bunzino69
Newbies
*
Offline


Posts: 9
Joined: Apr 24th, 2018
Debug Interfering with Code Execution.
Apr 24th, 2018 at 7:24pm
Print Post  
I have come across an issue with Visual Micro (VM) using Visual Studio (VS) 15.5.7.

When I compile and upload my code onto an Genuine Arduino Nano 328 and I select VM "Automatic Debugging (release/debug)" my code compiles and uploads correctly but it does not do what is expected.  I have set-up a PWM pin output (Pin 10) to pulse at a 10% duty cycle.  The only code is as follows:

void setup ()
{

analogWrite(10,10);
}

void loop()
{
//nothing here...
}


As the code starts to run, I see PWM pulses appear on my oscilloscope for just a flash (1/2 second maybe?). Then it output goes flat. 

If I compile and upload without VM "Automatic Debugging (release/debug)" enabled the PWM output pulses hold without interruption - as expected.

The above happens with our without VS debug mode enabled.

I'm at a standstill on why this is happening. Seems like a bug but I'm new to VisualMicro. Any input would be appreciated.


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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Debug Interfering with Code Execution.
Reply #1 - Apr 24th, 2018 at 8:36pm
Print Post  
Hi,

Maybe you are new to Arduino too Smiley

Code in setup() runs ONE time.

Code in the loop() runs over and over again.

Code (C++)
Select All
void setup ()
{

 //nothing here
}

void loop()
{

analogWrite(10,10);

} 

« Last Edit: Apr 24th, 2018 at 8:37pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint