Go Down

Topic: PWM Interrupt & SW behavior (Read 482 times) previous topic - next topic

max1982

Hello Everybody,

I'm noticing a very weird behavior of my Arduino Due board. Actually I started developing my code from the ASF framework under AS6.2.
Most of my code is executed under PWM interrupt (synchro mode, 16khz generated by channel 0, interrupt generated by counter 0 event).
For bandwidth occupation testing I'm using an I/O pin that I'm reading with an oscilloscope. I pull it up as soon as I enter in the interrupt and down at the end of the last instruction of the interrupt call.
I can say that it is running as expected until the code is not exceeding 40% of the interrupt bandwidth. If I add some more instructions just for exceeding this 40%, the interrupt is going to be saturated, even if the added code will require just a couple of more useconds.

Any feedback is well appreciated.

max

ahmedeisa

hi max
can you help me to change PWM frequency on due board

exedor

ahmedeisa,

Search the forum for PWM frequency. There is already a very in depth thread with sample code that shows you exactly how to set the PWM frequency. I am running mine at 45kHz due to recommendation from motor manufacturer. Now, finding drivers that will actually take 45kHz? Yeah, another story entirely. Make sure if you turn it up very high whatever circuit you are using it with can handle it.

http://forum.arduino.cc/index.php?topic=131323.0


Here's another link I got from google:
http://www.kerrywong.com/2014/09/21/on-arduino-due-pwm-frequency/



Go Up