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 Changing Arduino Due PWM Frequency (Read 4524 times)
d.gelman
Newbies
*
Offline


Posts: 6
Joined: Feb 25th, 2015
Changing Arduino Due PWM Frequency
Mar 4th, 2015 at 8:35pm
Print Post  
Hello

I am trying to change the PWM Frequency of the Arduino Due (specifically pins 6, 7, 8, and 9). I usually do this by editing the variant.h file > #define PWM_FREQUENCY constant. When using the Arduino IDE, this works perfectly without a problem. 

Moving to Visual Studio, I have again changed this value. Via the solution explorer I searched for variant.h and assured that this is changed. I recompiled and scoped the channel on the Arduino and still see the 1KHz default. I tried this again after reloading VS, still nothing.

Any suggestions?

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


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Changing Arduino Due PWM Frequency
Reply #1 - Mar 4th, 2015 at 9:01pm
Print Post  
Hi,

I suspect that because the variants is stored outside of the main core a bug in the Visual Micro compiler optimized is not detecting the change to the .h file.

You can click "Build>Clean Solution" to clear the compiler cache

Thanks
  
Back to top
IP Logged
 
d.gelman
Newbies
*
Offline


Posts: 6
Joined: Feb 25th, 2015
Re: Changing Arduino Due PWM Frequency
Reply #2 - Mar 4th, 2015 at 9:11pm
Print Post  
Great! It worked, thank you.

Does reloading VS not clear the compiler cache?

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


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Changing Arduino Due PWM Frequency
Reply #3 - Mar 4th, 2015 at 9:14pm
Print Post  
No it detects date/time changes to files so should be more efficient than that.

but you can switch it off cache in the project properties.
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint