Quentin Wrote... > Hi > I want to control the speed of a motor (24V,10A) with one PWM with > direction and brake on a 16c87x. This is one of those topics where the possibilities are numerous but none are perfect IMHO. There are nice Motor Drive IC packages that are the easiest to use but I have found (at least in New Zealand) are expensive, hard to get and/or are not available reliably. I favour using mosfets in a bridge arrangement, either mixed Nchannel and Pchannel or all Nchannel with raised gate drives (high side driving) on the upper devices. After numerous cost/ benefit, reliability and noise immunity experiences my favoured system is now 4 Nchannel devices (much cheaper) forming the bridge driven via a quad optocoupler. The collectors of the optocoupler transistors connecting to a suitable drive voltage (the only real snag I think), eg at 24 volts the upper mosfets need typ 35 volts (29 volts if Logic level) and of course the emitters of said optocouplers connecting to the mosfet gates. There are a number of ways of generating the gate bias voltage but the easiest (if you are using a mains supply via transformer/s) is to use a small transformer (or unused winding) to generate say 12 volts and float that supply, connecting the 0volt to the motor +ve supply, the bias (for the upper mosfets) will always be 12 volts above the motor voltage). This will still need external glue logic in youre case but this system is very reliable. BTW I am developing a system at this very moment using this arrangement driving a 24 volt 2.5 amp motor but I am using both PWM outputs of a 16F877, one for each direction. _____________________________ Lance Allen Technical Officer Uni of Auckland Psych Dept New Zealand www.psych.auckland.ac.nz _____________________________