Aaron wrote. > Can anyone help > > I am wanting to control a motor from my pic 16c84. > I want to be able to vary the speed of the motor. A simple one directional speed control can be achieved with a logic level mosfet. I dont know the current consumption of the motor or its supply voltage but for a 12 volt motor at 1 amp or so you could use an Nchannel logic level mosfet such as RFD14N05 (can get from Farnell) which would easily handle most punishment typical inflicted upon such a driver. No heatsink should be needed with such a motor. The source pin goes to ground, gate to the PIC i/o you wish to use to control it, and drain to the motor -ve, the motor +ve goes to +12volts (in this example). You will need a "flywheel" or back EMF diode across the motor to stop back EMF damaging the mosfet, a 1N4001 would connect anode to motor -ve, cathode to +12v. Now the motor will go full speed if a high or 'one' is presented continually to the motor SO to vary the speed switch the mosfet on and off with a varying duty cycle. This will vary the speed. The frequency will be chosen at set up and then not varied, only the pulse width or duty cycle will be varied. I have found that 400Hz is a good frequency for your average little DC motor. Serious ineffiencies start to creep in the higher the frequency goes with motor inductance being one problem, the worst problem at very high frequencies, which the PIC is quite capable of doing, is the large-ish gate capacitance of the mosfet starts to load the PIC i/o pin to the point that 20mA will be exceeded if the frequency gets too high. PWM routines can be found at many sites including www.microchip.com, the PICLIST archives etc. Hope this has been some help. _____________________________ Lance Allen Technical Officer Uni of Auckland Psych Dept New Zealand _____________________________