MOSFET/circuit troubleshotting :-\

Andrew Holme wrote:

When the pin goes low, the motor slows down, but it's far from
stopped :(

This suggests you've destroyed the MOSFET. I hope you bought plenty of
spares.
I've tried about 4, and they all did the same (one was the bigger 1A
version I bought) :(

--
Danny
 
Andrew Holme wrote:

The wiring around the small cap looks totally wrong !
It was at the time - I don't know how, it was fine earlier... I think I
took the cap out and put it back wrong, then next time I took a cable
out, I put it back according to where I saw the cap going! That was all
fixed before my last few posts though :(

--
Danny
 
Miles Harris wrote:

BTW, I assume the OP has observed proper handling precautions for the
MOSFET? There's a lot of static around at this time of year.
Yep :p

I've not got an anti-static strap or anything, but I regularly touch the
radiator as I'm working. The static-sensetive stuff all arrives in bags
marked so from Rapid :)

--
Danny
 
Andrew Holme wrote:

Check the gate-source voltage with that.

1.15V from gate to source

BINGO. That's wrong: that's not enough to switch the FET on; it should be
almost Vdd.
It's only just over 1V, but the motor is *on*. When the pin goes low,
the pin output drops to exactly 0, but the motor only slows - this
doesn't make any sense?

--
Danny
 
Andrew Holme wrote:
+ve -> Motor -> MOSFET(D), MOSFET(S) -> -ve

The motor still runs... This doesn't seem right??

Components sometimes go open or short-circuit when you destroy them;
however, before you throw it away: connect the gate to the source. Does
that stop the motor?
Nope. If I connect:

+ve -> Motor -> MOSFET(D), MOSFET(S + G) -> -ve

Both S & G are connected to ground, and +ve is connected to D via the
motor, the motor runs :-\
 
You're going to love this...

My MOSFET wasn't the wrong way around - I was reading the diagram wrong
(it was drawn from the bottom, not the top), *And* I though source =
supply and drain = ground, so it was actually connected correctly. My
recent tests have all been flawed!

So, connecting everything back up correctly, with the motor *really*
connected to Drain, and Source to ground, guess what happens...

The motor doesn't turn at all....

This makes sense, if the 1.xxV coming from the PIC's high isn't enough
to drive the MOSFET.

Why the chip is only outputting 1.xxV, I don't know, but at least I've
got somewhere to start looking!

:)

--
Danny
 
Danny T wrote:

Why the chip is only outputting 1.xxV, I don't know, but at least I've
got somewhere to start looking!
According to the datasheet, a low should be < 0.6V, and a high should be
Vdd - 0.7V. Vdd is around 4.5V (I've confirmed this with my meter), but
the pin high is around 1.3V (low is 0V). I've tried with another chip,
with the same results!

*cries*

--
Danny
 
Danny T wrote:
Andrew Holme wrote:

Check the gate-source voltage with that.

1.15V from gate to source

BINGO. That's wrong: that's not enough to switch the FET on; it
should be almost Vdd.

It's only just over 1V, but the motor is *on*. When the pin goes low,
the pin output drops to exactly 0, but the motor only slows - this
doesn't make any sense?
Have you got the source and drain the right way round now? There's no point
checking the gate-source voltage until this is sorted out. Source should be
connected to ground.
 
Danny T wrote:

Why the chip is only outputting 1.xxV, I don't know, but at least I've
got somewhere to start looking!

According to the datasheet, a low should be < 0.6V, and a high should be
Vdd - 0.7V. Vdd is around 4.5V (I've confirmed this with my meter), but
the pin high is around 1.3V (low is 0V). I've tried with another chip,
with the same results!

*cries*
I've got two pins configured as outputs, and when high, one is around
0.65V and the other, around 1.2V... This just gets weirder and weirder!

I've just written the same program to a new chip, to get the same
results... :(

--
Danny
 
Danny T wrote:
Andrew Holme wrote:
+ve -> Motor -> MOSFET(D), MOSFET(S) -> -ve

The motor still runs... This doesn't seem right??

Components sometimes go open or short-circuit when you destroy them;
however, before you throw it away: connect the gate to the source.
Does that stop the motor?

Nope. If I connect:

+ve -> Motor -> MOSFET(D), MOSFET(S + G) -> -ve

Both S & G are connected to ground, and +ve is connected to D via the
motor, the motor runs :-\
It's a dud then.
 
Danny T wrote:
Danny T wrote:

Why the chip is only outputting 1.xxV, I don't know, but at least
I've got somewhere to start looking!

According to the datasheet, a low should be < 0.6V, and a high
should be Vdd - 0.7V. Vdd is around 4.5V (I've confirmed this with
my meter), but the pin high is around 1.3V (low is 0V). I've tried
with another chip, with the same results!

*cries*

I've got two pins configured as outputs, and when high, one is around
0.65V and the other, around 1.2V... This just gets weirder and
weirder!

I've just written the same program to a new chip, to get the same
results... :(
1. Do you have the red probe on the pin and the black probe on ground?
2. Is the pin programmed for active pull-up or open-drain? It needs to be
an active pull-up.
3. Was anything else connected to the pin when you measured this?
 
Andrew Holme wrote:

Have you got the source and drain the right way round now? There's no point
checking the gate-source voltage until this is sorted out. Source should be
connected to ground.
I believe all my problems come down to the one thing - my pic "high"
isn't really high.

I've got two chips, both with the same program burnt (I can post, it it
helps).

They sit "high" until an input goes low, then they go low too.

Using my meter, is seems these outputs are:

GP4 0.3V (way below the min the datasheet says!)
GP5 0.6V

When I make the input low, they go:

GP4 0V
GP5 0V

Both chips do the same, and I can't find anything in the datasheet to
suggest even if I had something silly enabled/disabled, this would happen.

Any ideas?


--
Danny
 
"Danny T" <danny@nospam.oops> wrote in message
news:41e15a4d$0$25601$ed2619ec@ptn-nntp-reader01.plus.net...
Danny T wrote:

Why the chip is only outputting 1.xxV, I don't know, but at least
I've
got somewhere to start looking!

According to the datasheet, a low should be < 0.6V, and a high should
be
Vdd - 0.7V. Vdd is around 4.5V (I've confirmed this with my meter),
but
the pin high is around 1.3V (low is 0V). I've tried with another chip,
with the same results!
I looked at the code you posted in a.m.8-bit. What voltage does the pin
put out when it is not connected to the MOSFET? Your loop is turning
the motors off at the beginning. Assuming a clock of 4Mhz, your loop
takes 12uS to execute. 8 of those 12uS are spent with outputs turned
off resulting in a square wave with a duty cycle of 33%, hence the
average voltage is 1.3V. (1.3V * 3) + .7V = 4.6V or to put it another
way (4.5V - .7V)/3 =~1.3V

Do you have external pullup resistors on the inputs? If so, what value?

How did you come up with your __CONFIG value. It all looks good except
for the '3'. Shouldn't that be a '1'? The datasheet says that other
bit is unimplemented.
 
Danny T wrote:
Andrew Holme wrote:

Have you got the source and drain the right way round now? There's
no point checking the gate-source voltage until this is sorted out.
Source should be connected to ground.

I believe all my problems come down to the one thing - my pic "high"
isn't really high.

I've got two chips, both with the same program burnt (I can post, it
it helps).

They sit "high" until an input goes low, then they go low too.

Using my meter, is seems these outputs are:

GP4 0.3V (way below the min the datasheet says!)
GP5 0.6V

When I make the input low, they go:

GP4 0V
GP5 0V

Both chips do the same, and I can't find anything in the datasheet to
suggest even if I had something silly enabled/disabled, this would
happen.

Any ideas?
Do you have them configured as open-drain outputs with weak pull-up? Are
you even sure you have them configured as outputs?

Sanity check: what does the voltage on the Vdd pin measure? Is that 4.5V??
 
Andrew Holme wrote:

+ve -> Motor -> MOSFET(D), MOSFET(S + G) -> -ve

Both S & G are connected to ground, and +ve is connected to D via the
motor, the motor runs :-\

It's a dud then.
I had S and D the wrong way around (my diagram was drawn from the
bottom, and I was looking at the top of the MOSFET).

I'm still stick on the output voltage being too low :-(

Got a simple circuit, I've even tied MCLR to Vdd via a 1K resistor as
the datasheet says...
--
Danny
 
Anthony Fremont wrote:

I looked at the code you posted in a.m.8-bit. What voltage does the pin
put out when it is not connected to the MOSFET? Your loop is turning
the motors off at the beginning. Assuming a clock of 4Mhz, your loop
takes 12uS to execute. 8 of those 12uS are spent with outputs turned
off resulting in a square wave with a duty cycle of 33%, hence the
average voltage is 1.3V. (1.3V * 3) + .7V = 4.6V or to put it another
way (4.5V - .7V)/3 =~1.3V
I'm not getting 2-3V (with delays added after the motors are turned on).
This is only on the pin with my LED though (measuring voltage in
parallel with the LED).

The time spent "high" is more than enough to make the LED look like it's
lit constantly, but obviously wasn't enough to drive the MOSFET.

I'll re-write my code later, before re-connecting the motors and see how
it goes!

Thanks all! :)

--
Danny
 
Danny T wrote:
Andrew Holme wrote:

A digital photo of the breadboard layout could be as, if not more,
revealing.

http://dantup.me.uk/tmp/breadboard.jpg

I've tried to mark as much as I can, since any angle I took the pic from
obscured something! Under the larger cap is another diode, like the one
you can see. These two diodes are slightly different to the one used for
back EMF protection, since I was using up some old bits.

As I said, replacing the MOSFET with a cable between S/D causes the
motor to spin. Moving the cable connected to G to and LED, also works fine.

:-\

--
Danny
I don't see how the motor runs, even if you short the mosfet drain ot
source.

It looks like the positive lead on the motor (the one that ties to the
cathode of the reverse voltage clamping diode and the small blue
bypass cap has no connection to the diodes to the positive supply.
--
John Popelish
 
"John Popelish" <jpopelish@rica.net> wrote in message

I don't see how the motor runs, even if you short the mosfet drain ot
source.
I don't know what particular MOSFET he's using, but if it has an
internal protection diode and is put in backwards, wouldn't this happen?
 
Danny T wrote:
it's off for *most* of the time! Stupid fool! I'll change the logic to
"buffer" it (like further down, or I'll call the delay after turning
the motors on).
Buffer it. Don't just put in a delay. You'll needlessly create glitches if
you rapidly switch it on and off; even if it's only off for a micro-second.
That would be sloppy. You shouldn't need a delay if you're doing it right.
 
Andrew Holme wrote:

Do you have them configured as open-drain outputs with weak pull-up? Are
you even sure you have them configured as outputs?
Yes, they're *definately* outputs. I don't understand what open drain or
weak pull-ups are. The only reference to either of these are weak
pull-ups for inputs, which are disabled for outputs :-\

As you've probably seen elsewhere, I've got it sorted now, it was down
to the logic of my programming. The pin was high less than half the
time, so although enough to light an LED constantly, it wasn't enough to
drive the MOSFET. Thanks for your help, sorry I didn't post enough info
in this group to show what was wrong!!


Sanity check: what does the voltage on the Vdd pin measure? Is that 4.5V??
It did :)

--
Danny
 

Welcome to EDABoard.com

Sponsor

Back
Top