ATTiny85; order of magnitude loss of speed when enabling map AnalogRead function

Hello again.

Jiggy-Ninja:
Woot!
Hollah!
What?

Were you able to control the pulse height before? Because looking over you code it looks like it was malfunctioning from the start. It appears that your intention is to ramp up to pwmmax, reverse direction, then ramp down to pwmmin, then pause for the dead-time. But the scope traces you are posting show the ramp going all the way to Vcc then straight back down to 0. I think the problem's here:

Yes, I was able to control the height on a previous version of the code. I have probably 30 versions now saved in the IDE. It is NOT working in this version. In the version it worked in , I was substituting an 'int variable' and not using map AnalogRead function.

You are correct, It must ramp up as a sawtooth type wave form and then ramp down.

I will attach screen shots of the 'pwmMin' value working at 630mv float voltage.
The 'pwmMin' does work, just in the shots I posted it was set at pwmMin=0 so the float voltage is Zero.

Also you are correct that in these scope shots, the pwm ramp always goes to Max pwm value and does NOT follow the code to reset and drop down when it gets to the less than Max 'pwmMax' value.

thanks again

take care, peace
lost_bro