One way to do it would be to use Darrel Taylor's instant interrupts and PWM with a lookup table.
You could use this code on a PIC18, and just change the lookup values to a linear increase, dropping back to zero when it gets to 1.5v. http://www.picbasic.co.uk/forum/cont...-DT-interrupts . You would have to modify the speed of the interrupt. You could probably get by with a lot less steps.
For instance, the sinewave generated by the above code, is kind of like the red sine wave in this picture. If you were to change all the values in the lookup, you could generate your sawtooth, like the one in blue.
You can pretty much change the lookup table to create any wave form you like. Since your's is linear, you wouldn't really need a lookup table, you could just do some addition inside your interrupt handler, to increase the duty. And drop to zero after reaching X.
Let us know how it goes, whichever way you choose to go.
Walter
Last edited by ScaleRobotics; - 2nd August 2010 at 18:48.
Bookmarks