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.

How to generate PWM from PIC16F84A to control the 4 switches of a h-bridge?

Status
Not open for further replies.

minisan

Junior Member level 1
Joined
Dec 15, 2005
Messages
19
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,489
how to generate PWM from PIC16F84A to control the 4 switches of h-bridge? does anybody would like to share the schematic and components to be connected to the microcontroller? thanks =)
 

Davood Amerion

Advanced Member level 2
Joined
Mar 1, 2005
Messages
584
Helped
116
Reputation
232
Reaction score
24
Trophy points
1,298
Location
Persia
Activity points
6,345
pwm schematic

it is not need any schematic!
you can use any of pins of 16F84.
and with genarate PWM in your program.
in this configuration frequency of PWM is not high,
if you want higher frequency you can use other microcontroller which have internal PWM peripheral.
 

    minisan

    Points: 2
    Helpful Answer Positive Rating

minisan

Junior Member level 1
Joined
Dec 15, 2005
Messages
19
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,489
pic16f84 pwm

can u suggest/show me more detail or perhaps example regarding this matter? sorry, this is my first time using microcontroller... thanks!!
 

minisan

Junior Member level 1
Joined
Dec 15, 2005
Messages
19
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,489
pwm pic16f84

ok... thanks alot!! how nice of u...=)
 

IanP

Advanced Member level 5
Joined
Oct 5, 2004
Messages
7,942
Helped
2,310
Reputation
4,622
Reaction score
531
Trophy points
1,393
Location
West Coast
Activity points
66,416

    minisan

    Points: 2
    Helpful Answer Positive Rating

minisan

Junior Member level 1
Joined
Dec 15, 2005
Messages
19
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,489
pwm with pic 16f84

thank you very much... nice of u... =)

Added after 23 minutes:

does PIC16F84A still can be used if i want to do a four-quadrant dc motor wif speed control? do the pins enough? thanks
 

IanP

Advanced Member level 5
Joined
Oct 5, 2004
Messages
7,942
Helped
2,310
Reputation
4,622
Reaction score
531
Trophy points
1,393
Location
West Coast
Activity points
66,416
irf530 pwm

Have a look at the configuration of this H-Bridge with P and N-channel MOSFETS ..
As yo can see you need only two PICs pins to control this bridge ..

For professional application, where high frequecy switching is required, you should consider microcontroller with build-in PWM hardware block, but at this stage you can easily work with frequencies such as, for example, 1kHz, and for that PIC16F84 is more than enough ..

Regards,
IanP
 

    minisan

    Points: 2
    Helpful Answer Positive Rating

minisan

Junior Member level 1
Joined
Dec 15, 2005
Messages
19
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,489
pwm pic 16f84

will PIC16F877A be more suitable for PWM dc motor speed control bcz i found that this microcontroller has built in PWM through pin CCP1&2? any external component to be connected to the pins? does it mean that PWM can be generated by the delay function in the programming part? is it possible to vary the duty cycle which affects the speed of the motor without changing the programming from time to time?

thanks a lot!!
 

IanP

Advanced Member level 5
Joined
Oct 5, 2004
Messages
7,942
Helped
2,310
Reputation
4,622
Reaction score
531
Trophy points
1,393
Location
West Coast
Activity points
66,416
hbridge_theory.pdf

PIC16F877 is much more versatile than PIC16F84 ..
On top of the additional PWM module it has also 10-bit ADC, which in your case can be used as reference to the PWM output without the need of changing the program all the time ..
Assuming, that the PWM generator is programmed and it is running "behind", you can connect a potentiometer to one of the Analog inputs and adjust the duty cycle from 0-100% at your will ..
The outputs from the PWM module can be connected directly to the MOSFET H-Bridge from the previous post ..

Regards,
IanP
 

    minisan

    Points: 2
    Helpful Answer Positive Rating

minisan

Junior Member level 1
Joined
Dec 15, 2005
Messages
19
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,489
high current pwm schematic

hi! really thanks for the schematic of h-bridge. it is really useful! i am thinking of building this circuit. btw, are the models&values of all the components in the circuit usable for +12Vdc motor? how to determine the model&value of the MOSFETs? really thank you very much! =)
 

IanP

Advanced Member level 5
Joined
Oct 5, 2004
Messages
7,942
Helped
2,310
Reputation
4,622
Reaction score
531
Trophy points
1,393
Location
West Coast
Activity points
66,416

    minisan

    Points: 2
    Helpful Answer Positive Rating

minisan

Junior Member level 1
Joined
Dec 15, 2005
Messages
19
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,489
mosfet pwm circuit

what should i know when buying a dc motor so that i can choose the suitable MOSFETs? power rating or current rating? let say current rating, my MOSFET current rating must be at least the current rating of the motor right? please guide...
thanks a lot!!
merry christmas!! =)
 

IanP

Advanced Member level 5
Joined
Oct 5, 2004
Messages
7,942
Helped
2,310
Reputation
4,622
Reaction score
531
Trophy points
1,393
Location
West Coast
Activity points
66,416
schema mosfet pwm

Usually motors have certain current rating ..
I would say, select a MOSFET which has at least 5 times that current, and the lowest possible Rds(ON) ..
Now, when a MOSFET has a low RDS(on) rating, it usually has quite a
high current rating typically in the 10s of amps. I needed 4 amps
continous and the MOSFET I chose offered 25 amps. Naturally, the lower
the RDS(on) rating, the more expensive the MOSFET. BTW, both types of
MOSFETs are available in TO220 packages.
This is a quotation from an article on the H-Bridge from one of the previous posts ..
Here is the rest:
https://www-isl.ece.arizona.edu/~soccer/team4a/data/motors/Hbridge_Theory.pdf

Regards,
IanP
 

    minisan

    Points: 2
    Helpful Answer Positive Rating

minisan

Junior Member level 1
Joined
Dec 15, 2005
Messages
19
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,489
pwm circuit schematics

Dear IanP,
For the circuit that u showed me last time, izzit usable for 3-9V dc motor? the current for the motor is arround 0.5A only when no load... so will IRF530 and IRF9530 still applicable? Can I straight away connect pin A and B to microcontroller or I need a driver between microcontroller and both pin A and B? thanks!!happy new year!!
 

IanP

Advanced Member level 5
Joined
Oct 5, 2004
Messages
7,942
Helped
2,310
Reputation
4,622
Reaction score
531
Trophy points
1,393
Location
West Coast
Activity points
66,416
pulse width modulation schematic

For the circuit that u showed me last time, izzit usable for 3-9V dc motor? the current for the motor is arround 0.5A only when no load... so will IRF530 and IRF9530 still applicable? Can I straight away connect pin A and B to microcontroller or I need a driver between microcontroller and both pin A and B? thanks!!happy new year!!

I don't know of any microcontroller that can sink or source substantial currents; usually these currents are below 20mA per pin ..
From that point of view you need a driver ..
The proposed IRF MOSFETS are ovesized for 0.5A motor, but because most of availble MOSFETs are in TO220 package, you will not save much room and/or money ..

Happy New Year to you too ...
Regards,
IanP
 

    minisan

    Points: 2
    Helpful Answer Positive Rating

electronixel

Newbie level 4
Joined
Jan 23, 2005
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
41
n channel mosfet pwm circuits

what should i know when buying a dc motor so that i can choose the suitable MOSFETs? power rating or current rating? let say current rating, my MOSFET current rating must be at least the current rating of the motor right? please guide
 

vin87

Newbie level 3
Joined
Jan 9, 2009
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,299
pwm generator shema

hi
I'm using a 12v,80w,7A current rating dc motor.
Can anyone sugget a H-bridge circuit for the same.
What should be the mosfet current ratings if we use the schematic shown above.
Thank you
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top