Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

DC motor colntrol wit PIC18f452

Status
Not open for further replies.

suwaii

Member level 4
Joined
Jan 21, 2006
Messages
68
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,830
i want to control DC motor using PIC18f452& transistor TIP120 and i use port B (PB07) to switch on and off but the problem the motor does not run properly
i heard that we have to use port C to control motor because portB is weak pull up
is it true??
 

Hi,

If you use RB7 with software PWM, then there's no problem. But if you use hardware PWM, you can't use RB7, instead you have to use RC2 as that is the PWM output pin.

Hope this helps.
Tahmid.
 

sorry i do not understand you what differene if i use the PB07 with PWM software or hadware

what i do i make programe to make PB07 run motor few second then turn off but the motor did not run propely .however if i use led insted of motor the led turn off and on propberly
 

PIC has internal PWM module which can be used, in that case you need to use RC2. But if you want RB7, you need to use a timer and interrupt it for PWM.
Take a look at these:
https://www.best-microcontroller-projects.com/pwm-pic.html
**broken link removed**
**broken link removed**
Hope this helps.
Tahmid.
 

The weak pull-up resistors of Port B are off by default. Also, they are active only if the pin is configured as an input pin. So, they aren't the cause of your problem.

I'm not good with electronics, but as far as I know, a motor is an inductive load and it may cause sudden voltage changes in the circuits when it starts and stops. This can cause a device reset. Make sure you have some capacitance in your circuit, like 100 uF. If it doesn't help, try to isolate PIC from the motor, by using optocouplers and separate sources of power.

Also, search the term "flywheel diode", and make sure you use it. I am not able to explain its logic because of my poor electronics skills, but you can find lots of information about it on the internet.
 

Tahmid


i think you are right.if we control the DC motor by portC and use portB to check the status of input sensor then theDC motor will work properly so that we could not use portB to control DC motor. i try this i get successful



Thanks for all
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top