In general Steve's code example should work,
but it will require some filtering and smoothing at the PWM Output.
And with variable load you may want to have some feedback of the Output Voltage to be able to compensate for changes in Load.
And last but not least:
Plan some time for experimenting to find proper Values for your lookup table.
If you could give us some more details we can probably come up with better solutions.
regards
Ralph
_______________________________________________
There are only 10 types of people:
Those who understand binary, and those who don't ...
_______________________________________________
Bookmarks