Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PIC pin to MOSFET gate problem

Status
Not open for further replies.

Futterama

Member
Hello forum,

I'm working on a simple motor control using a PIC12F629 and 2 dual MOSFETs, a P-channel FDS6875 and a N-channel FDS6898AZ.

When I say "simple motor control" I mean full forward, stop and full reverse, no PWM is used. The controller is not speed critical, since it's for a small RC toy car with a small motor with a stall-current of 1,3A at 3,6V. The PIC is also running at 3,6V.

I have connected the MOSFETs in a H-bridge design, and have connected pull-up resistors on the P-channel gates, and pull-down resistors on the N-channel gates (56k).

The PIC is driving the gates directly.

The problem is, the PIC cannot drive the gates without a series resistor. This puzzles me. I know the gate is like a capacitor, and the PIC output current is max 25mA. But in other projects, a PIC10F206 is driving a SI2302DS MOSFET without problems.

Can some of you explain to me what my problem is?

Here is some links to the MOSFET datasheets if nessasary:

https://www.electro-tech-online.com/custompdfs/2007/11/FDS6875.pdf
https://www.electro-tech-online.com/custompdfs/2007/11/FDS6898AZ.pdf

Thanks.
 
What actually DOES happen? My best guess with the information available is that the FETs are bursting into oscillation, and this is disrupting the program. A look with an oscilloscope would confirm this. The classic way of dealing with this problem is, strange to say, a resistor of 100 ohms or so in series with the gate, as close to the gate pin as possible. You could also try the effect of a 100n capacitor across the PIC's power pins. Both these things are often designed in as a matter of course.
 
GP4 and GP5 is connected to the P-channel FET. GP0 and GP1 is connected to the N-channel FET.
At power-up the PIC pins are input, and the pull-up and pull-down resistors on the MOSFET gates keep the MOSFETs in a STOP condition.
In my program, I set the pins to the STOP state before making them outputs.

What happens is that the program is running, and all pins are doing their job, except the GP4 pin. It stays high, as in STOP state, even though the program sets the pin low.

Where should I connect the probe from the scope? I tried the misbehaving pin, but it just keeps it high state.
 
Nigel Goodwin said:
Why not just use the series resistors?, I would consider it VERY poor design not to anyway.
Nigel, I will use the resitors, otherwise I would use a MOSFET driver. I'm just curious to know what is causing this misbehaving.

And why would you consider it poor design not to use the resistors?

By the way, I did try to put a 220nF close to the PIC, that didn't help...
 
Last edited:
Futterama said:
And why would you consider it poor design not to use the resistors?

Because when the FET goes S/C it may well stick the full supply voltage directly on the output pin of the PIC - this means you have to replace the PIC as well as the duff FET's.
 
Thanks for the replies, I'll use a 100ohm resistor for these non-switching projects, and then I'll use a MOSFET driver (without any resistors I suppose?) for PWM projects.
 
MOSFETs have a huge gate capacitance. Also it takes a large amount of charge to get the gate past its turn-on voltage. It is almost like an infinite capacitor, wth the voltage hardly changing for a while as current goes into the gate.

Because of that, the pin won't read high for a long time after the program has driven it high.

I would avoid all bsf or bcf operations on the port. That is because those commands read the port, modify one bit, and then write to the port. If one pin on the port is trying to go high, but is actually low, then doing a bsf/bcf on any pin on that port, will clear the pin that is being dragged low.

You need to write bits to a shadow register, then move that to the port.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top