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 Same Code Different behavior between Microchip Studio and Arduino IDE (Read 122 times)
Upstage
Newbies
*
Offline


Posts: 2
Joined: Mar 25th, 2025
Same Code Different behavior between Microchip Studio and Arduino IDE
Mar 28th, 2025 at 7:16pm
Print Post  
Hi all

This is a new one for me,

I brought some code over from the Arduino IDE and it is running differently in Microchip Studio than in the Arduino IDE.

I'm running a couple stepper motors and getting the expected behavior in Arduino IDE, but in Microchip Studio, the output is "jerky" for lack of a better word.

Any ideas?

-Peter


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


Posts: 2652
Joined: Feb 13th, 2019
Re: Same Code Different behavior between Microchip Studio and Arduino IDE
Reply #1 - Mar 28th, 2025 at 7:40pm
Print Post  
Assuming they are sharing the same board package versions.... do you have the same board options selected in both IDE's?

Also in Microchip Studio do you have the vMicro > Debugger > Debug set to Off?
  
Back to top
IP Logged
 
Upstage
Newbies
*
Offline


Posts: 2
Joined: Mar 25th, 2025
Re: Same Code Different behavior between Microchip Studio and Arduino IDE
Reply #2 - Mar 28th, 2025 at 8:42pm
Print Post  
Hi,

Thanks, I didn't think about the serial debugger holding up the loop because I was only using the breakpoints to monitor, not halt.
Turning off the Serial Debugger fixed the problem, though I was hoping to use it through the process of working on the project.

Would JTAG debugging be a better option? I have an Atmel ICE but have not figured out how to use it in Visual Micro.

Is it supported?

-Peter
« Last Edit: Mar 29th, 2025 at 2:12pm by Upstage »  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2652
Joined: Feb 13th, 2019
Re: Same Code Different behavior between Microchip Studio and Arduino IDE
Reply #3 - Mar 31st, 2025 at 9:05am
Print Post  
Thanks for confirming that the Serial Debugger was the issue here.

Any delays within the Serial Debugger can be removed by enabling the vMicro > Debugger > Full Speed (No Throttle) option.

If there is a lot of information within the trace and a lot of trace points firing quickly, it can overwhelm the PC Serial Port, but from your description this does not sound to be the case.

It is also best for time critical tracing to disable any of the Monitor Digital/Analog Pins to save this also being sent back every break/loop().

When working with Stepper Motors (which are often ms or us critical in pulsing) I have always found it best to complete a full "movement" without any debugging, and if you do want to see within such time critical elements then the video below helps to explain how the @Plot charts can be used with the Serial Debugger for this applciation:
YouTube: Visualize Millisecond Events from Your Arduino - https://www.youtube.com/watch?v=wwRawju55nk

The Atmel-ICE (or other Hardware Debugger) may be useable for your board, if you can confirm which board you have we can advise better.

The Hardware Debugging is generally slower than the Serial Debugger for these time critical purposes, as it has to constantly stream back far more information to the PC than the Serial Debugger.
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint