If you specify your 10 cycles for PWM, then it will execute those tens cycles before exiting and continuing with your next instruction.
You may want to check out Darrel Taylors PWM routine that can sit and run in background whilst you're doing other things...
http://www.pbpgroup.com/modules/wfse...hp?articleid=6
...and if that excites you try...
http://www.pbpgroup.com/modules/wfse...p?articleid=12
Bookmarks