Steve
Thank you for pointing me in the right direction!
I just realized that Darrel's code is a slow SPWM and cannot handle high frequencies (e.g. up to 20KHz).
I would like to generate two frequencies simultaneously where the one is a
multiple of the other, e.g Freq 1 = 10 kHz, Freq 2 = 20KHz
I do not need to vary the duty cycle. I only need a duty cycle of 50%, thus
either on or off.
Darrel's code would have been perfect if it could handle higher frequencies.
I cannot use the hardware PWM because all PICs with multiple PWM outputs that I know of, share the same timebase.
Thus the frequency must be the same on all the outputs, but the duty cycles are individually controllable. I don't know of a PIC that's an exception
In short, I am looking for a software PWM that is capable of handling 2 different frequencies simultaneously, where each frequency may vary up to 20KHz. I have looked everywhere but could not find any example code to this.
I will appreciate any help or suggestions.




Bookmarks