if i increase the chip mhz the pwm freq goes up right?, can i edit the pwm file in gcbasic to speed it up also? and if so what line would I do that on?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The higher the internal or external osc that is applied, the faster the soft pwmout routine will run. Its is well explained by Hugh here in help http://gcbasic.sourceforge.net/help/
If you wanted to mess with the software pwmout, then reduce the 8bit resolution in the subroutine to whatever resolution you want. For instance, if 6 bit resolution was acceptable (64 steps) then just reduce the internal loop count from 1 to 64 instead of 1 to 255. That would increase your speed substantially (almost 4 times).
Hard to keep track of the train of thought here. Is this a continuation of 12f683 software pwmout questions? If so then consider using the hardware Pwm module, and use the GCBasic HPWM command. This will run the PWM in the background, offer faster frequencies, all while you do other stuff in your code.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
if i increase the chip mhz the pwm freq goes up right?, can i edit the pwm file in gcbasic to speed it up also? and if so what line would I do that on?
The higher the internal or external osc that is applied, the faster the soft pwmout routine will run. Its is well explained by Hugh here in help http://gcbasic.sourceforge.net/help/
If you wanted to mess with the software pwmout, then reduce the 8bit resolution in the subroutine to whatever resolution you want. For instance, if 6 bit resolution was acceptable (64 steps) then just reduce the internal loop count from 1 to 64 instead of 1 to 255. That would increase your speed substantially (almost 4 times).
Hard to keep track of the train of thought here. Is this a continuation of 12f683 software pwmout questions? If so then consider using the hardware Pwm module, and use the GCBasic HPWM command. This will run the PWM in the background, offer faster frequencies, all while you do other stuff in your code.
is the internal loop count in the pwmout.h ?
No, that is the HPWM library. For the softpwm library look in stdbasic.h file. The line to change is:
For DOPWM = 1 to 255
...
...
Next
Good luck.