I want to use 16F628 or 16F877 analog input which will get signal from potentiometer. Output should be 2 pins, one for each direction of PWM to drive H bridge. So, when we having potmeter in center both PWM pins don't output anything and motor is dead, when we turn potmeter in one side, one PWM output is starting egnerating PWM from 0 to 100%, and also same in revenrse, when we turn potmeter in other direction, than other PWM pin starts to output PWM from 0 to 100%.

To get thing more ilustrated, it should look something like this:

input on analog port 0:

0V-------motor 100% reverse
2,5V-----motor 0%
5V-------motor 100% forward

Real volatge levels from potmeter on porta.0 aren't need to be exact, only for ilustration, as here should be some dead time in middle and so.

As, for one direction I now how to make code, just having ADCIN, x, and then using HPWM where x should be duty cycle variable.....only don't have any idea how to make it output on two pins depending on potmeter?

thanks!