How to change the range of voltage?
Assumptions:


The circuit has +10V and -10V supply rails available
Isolation of the dsPIC from the motor power / ground rails is desirable, to prevent back-EMF from frying the dsPIC


The following arrangement would provide arbitrary voltage switching, isolated from the controller side of the circuit:







simulate this circuit &ndash; Schematic created using CircuitLab

This will provide an inverted PWM signal to power the motor.


The PWM signal switches the optocoupler's internal LED on and off. 
This turns the output phototransistor of the optocoupler on and off correspondingly.
When the PWM signal is high, the opto's transistor conducts, pulling the MOSFET gate low, and thus it behaves as an open switch. 
When the PWM signal is low, the opto's transistor does not conduct, so the MOSFET's gate is pulled high, it behaves as a closed switch, allowing current through.
The diode across the motor prevents back-EMF from frying the MOSFET.