There is a difference from being able to provide 5V at a very low current and being able to provide 5V at a large amount of current. If you try to draw too much current from something, the output voltage will drop in order to try and provide that much current.
The 5V is sufficient to control the gate of a transistor (which requires very little current that the PIC is able to supply) to switch a larger current on and off (ie. to control a motor). But the a PIC CANNOT supply enough current to run a 5V motor directly.
Your circuit seems to say that you understand this since you do use a MOSFET transistor to control the current to the motor with the PIC driving the gate.
I could acheive this without the RC filter using only the MOSFET but I want the voltage to the motor to be constant (not square wave).
However, the RC filter is useless- the PWM will cause the main motor current to switch on and off BUT (and this is a big thing, the inductance from the motor will smooth out the current waveform and effectively cause the motor to "see" a voltage that is the [PWM % duty cycle x supply voltage]. With the RC filter's resistor you are not doing anything except totally, completely limiting the current that flows through the motor. I can see what you are trying to do- smooth out the PWM'd voltage travelling through the motor, but hopefully this will tell you why you can't and why you don't need it. It is not needed, and is makes your circuit basically useless. The motor's inductance will take care of everything without limiting the current. RC filters are not used for power applications, they are used for signal applications which require much lower current.
orangerobot said:
Normally I would run the motor directly with the PWM but the PIC is only rated for 5v. My end objective is to be able to vary the speed of a 12v motor using the PIC.
Even if both motor and PIC are 5V you still must use a transistor or something to indirectly drive the motor with the PIC. The PIC cannot supply enough current through it's pins.
analog said:
What type of motor is this? Why not just feed the PWM directly? Its done all the time.
Feed the PWM directly? To what? The motor? Won't work, PIC can't supply enough current to drive the motor. (I know you know this, but the words are a bit misleading to someone new). You have to feed it to the transistor gate, which I the opening poster is doing.