No, that wouldn't work - and would probably blow the PIC (and the transistor). You should use an NPN transistor with the motor in the positive supply to the collector - check my tutorials under 'hardware Extras' for examples.
No, that wouldn't work - and would probably blow the PIC (and the transistor). You should use an NPN transistor with the motor in the positive supply to the collector - check my tutorials under 'hardware Extras' for examples.
tnx for the replays guys... the next one is ok? The diode is fine?
and one more question:
can i create PWM in the software? coz i have ony one PWM channel and i need to control 2 motors.. and what difference is between the PIC PWM and the one that i create in the soft? the acuracy?
No, the resistor has to be in the BASE of the transistor (and the schematic symbol does not belong to NPN, but to PNP). The rest is ok.
And yes, you can create additional PWMs in software. Software PWM is generaly slower and requires more resources.
You've obviously not looked at the 'Hardware Extras' section of my tutorial as I suggested previously, where it shows EXACTLY the circuit you need (with a relay instead of a motor).
i have a problem now... i made the circuit and it's not working... the motor is spinning only if i help it in the beginning and i spin it a few times.. then the motor is working... but the transistor goes very hot.. i use a 9v battery at 1 Ampere (regulated at 5v with 7805), pic 16f628a, bc547 NPN transistor (60v , 0.2A), 4148 diode, a small motor, 700 ohms resistor
That looks fine, although I'm a little puzzled about the strange value of 700 ohms?.
You should also try posting your diagrams in a better format, JPG is fine for photos, but useless at diagrams - if you post it as a GIF it will be far smaller, and not lose any quality.