vsmGuy
Advanced Member level 2
Guys
I am on the lookout for an all software PWM with perhaps 8 bit resolution (256 states).
The frequency is ofcourse sub khz - definitely around 500Hz.
What I wanted to know is what is the range of PWM freq available using software methods ? Will it change with clock frequency.
Also, how will the performance of the peripherals - like USART, ADC, CCP, etc be affected with such a technique. And how many channels of PWM I can have this way ?
I am led to believe that the output created using software PWM is as good as that of the hardware PWM - atleast for 8 bit resolution.
How true is it ?
Please note that I am not as interested in the code rightaway (I located LOTS of soft PWM code here AND google) - I wanted to hear what you guys have to say about this.
My needs are to generate sub khz (around 100 to 500Hz - not all at same time) WITH adjustable duty cycle (minimum 10% to 90%) to drive a DC Motor control system. (I am NOT on the lookout for DDS !)
If possible I should be able to leave the TIMER free because this same IC will be used for quadrature decoding.
I will heavily prefer a technique that does not use 18F parts and will work nicely on a 16F like the 628a/877a.
4/8 channels of PWM will be nice because I will be able to implement locked anti phase control instead of signed magnitude.
Keep the suggestions flowing in ! Oh - ofcourse they must be in CCS C
I read 00654a.pdf titled "PWM, a Software Solution for the PIC16CXXX".
It's definitely an interesting read.
Anyone coded that already in C ? The code need not necessarily be tested, or even compiling for that matter.
Cheers
I am on the lookout for an all software PWM with perhaps 8 bit resolution (256 states).
The frequency is ofcourse sub khz - definitely around 500Hz.
What I wanted to know is what is the range of PWM freq available using software methods ? Will it change with clock frequency.
Also, how will the performance of the peripherals - like USART, ADC, CCP, etc be affected with such a technique. And how many channels of PWM I can have this way ?
I am led to believe that the output created using software PWM is as good as that of the hardware PWM - atleast for 8 bit resolution.
How true is it ?
Please note that I am not as interested in the code rightaway (I located LOTS of soft PWM code here AND google) - I wanted to hear what you guys have to say about this.
My needs are to generate sub khz (around 100 to 500Hz - not all at same time) WITH adjustable duty cycle (minimum 10% to 90%) to drive a DC Motor control system. (I am NOT on the lookout for DDS !)
If possible I should be able to leave the TIMER free because this same IC will be used for quadrature decoding.
I will heavily prefer a technique that does not use 18F parts and will work nicely on a 16F like the 628a/877a.
4/8 channels of PWM will be nice because I will be able to implement locked anti phase control instead of signed magnitude.
Keep the suggestions flowing in ! Oh - ofcourse they must be in CCS C
I read 00654a.pdf titled "PWM, a Software Solution for the PIC16CXXX".
It's definitely an interesting read.
Anyone coded that already in C ? The code need not necessarily be tested, or even compiling for that matter.
Cheers