Yes, it's the math. I can read the pulsin okay by scaling one of the values up by a factor of ten to give me tenths. That worked fine.

Follow me here a second and see if this solution holds water. Haven't tried it yet, but it appears it will work.

Here is the deal.
On Reading the input....
The valid pulsin will always be from 30% to 80% duty cycle - so that gives me a total difference of 50% (remember that 30% dc is 0% o2 and 80% dc is 21% o2)

Scaling the Value on the out put.
0 -21% is the value I'm trying to represent on the output, so 21% O2 is at 80% duty cycle. 21% / 256 steps gives me my 1/10 of a percent resolution.

Output = 0% o2 = 0 vdc
21% o2 = 5vdc

So to get around the 8 bit resolution, instead of me outputting a voltage representing the input duty cycle of 0-100% I'd be better off reading the duty cycle coming in, converting it to %o2, then outputting the voltage based on a scale of 0-21%

That should give me slightly better than 0.1% resolution.


Knowing all of that, now the math....
Example:
Sensor o2 = 10.5%
Sensor Duty Cycle in should be = 55%

Get Ratios and scale it....
Input Duty Cycle - StartDutyCycle = FinalDutyCycleVar
55 - 30 = 25

Display to lcd.....
25 x 42 = 1050 or 10.50% o2


Setup for pwm output..... 0=0 21% = 5vdc
25 x 256 = 6400
6400 / 50 = 128

128 steps of PWM Out = 2.5 volts which represents 10.5%


WhaLa, looks okay.
@ 21% there is not a 16 bit overflow so that should be okay

See any problems?
Richard