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

Good day Robin2

I hope the following will explain a little better about what I'm trying to achieve.

Robin2:
I'm not sure I understand all that - but probably because I am not familiar with waveform generation and no because your description is inadequate.

---------- I have attached some o-scope screenshots to help with the explanation.---------

If I understand from the last part, you want a wave that goes from 0 to max in a time between 1 millisec and 30 millisecs (and declines the same way?)

------What I am trying to obtain is a ramp with a gradual build-up to pwmMax and a rapid fall to pwmMin.----

------Actually I tried to use: 'if(Pwm==pwmMax) Dir=-1; ' and ' Dir=+1; ' to control the pitch of the ramp. It did work under some code configurations, and now it doesn't. -------

Perhaps you can post a diagram showing some examples of the output you want.

-------- Yes, have posted , please check scope shots.-----------

And you want to use 3 potentiometers to allow the user to change the ramp interval, the repeat frequency and something else?


1- ramp Marktime (ontime)
2- ramp Deadtime (off time)
3- ramp height (ie; pwmMax & pwmMin functions)

Thanks for the assistance Robin2
take care, peace
lost_bro