Hi Jamie_s,

With HPWM you cannot do this if I understood right. Somebody correct if I'm wrong.
Did you mean that with ADC = 12 you will get one pulse high/low in every 224 and ADC = 221 one pulse high/low in every 38?

If yes, then try something like this.

Code:
<code><font color="#000000">adval <b>VAR BYTE

</b>Loop:
    <b>GOSUB </b>Read_ADC
    <b>HIGH </b>PWM_Out        <font color="#000080"><i>'Change to match your pin name for PWM output!
    </i></font><b>PAUSE </b>1
    <b>LOW </b>PWM_Out
    <b>PAUSE </b>adval
    <b>GOTO </b>Loop

Read_ADC:
    <b>ADCIN </b>0, adval			
    adval = 235 - ((89 * adval)/100)  
    <b>RETURN</b></code>
Funtion that is used here is y = 235 - 0.89*x.
x = 221 -> y = 38.21
x = 12 -> y =224.32
It should give you sufficient accuracy, I hope so.

BR,
-Gusse-