giving the vref on l297

You can generate an analog voltage from a pwm signal by applying a low pass filter to the output. Look at Microchip's application note "AN538: Using PWM to Generate Analog Output" for more details. You will need to determine if it is stable enough to be used as a Vref signal in your application.
 
Top