Forums

PIC Power thru the I/O pins?

Started by Dave Mucha January 16, 2006
Hi All,

I have a stepper driver that has 5 V power from one source, drives
TIP120 Darlingtons that are on a separate power source (12 volts) and
the inputs are from the PC's Parallel port.

16F628 and the STEP and DIR pins are on 17 and 18. RA0 and RA1

All three power supplies have a common ground.

The PIC seems to have power when the 5V and the 12V are turned off.

can the PIC 'run' from a 5V signal on one of the I/O lines ?

Dave




Dave Mucha wrote:

>Hi All,
>
>I have a stepper driver that has 5 V power from one source, drives
>TIP120 Darlingtons that are on a separate power source (12 volts) and
>the inputs are from the PC's Parallel port.
>
>16F628 and the STEP and DIR pins are on 17 and 18. RA0 and RA1
>
>All three power supplies have a common ground.
>
>The PIC seems to have power when the 5V and the 12V are turned off.
>
>can the PIC 'run' from a 5V signal on one of the I/O lines ?
yes between any io-pin and substrate there are parasitic diodes,
but you should care not to put too much current through them.

Stef

>Dave >
>
>to unsubscribe, go to http://www.yahoogroups.com and follow the instructions
>Yahoo! Groups Links



Hi Dave,

Yes, you're back driving it.

Alan KM6VV

> Hi All,
>
> I have a stepper driver that has 5 V power from one source, drives
> TIP120 Darlingtons that are on a separate power source (12 volts) and
> the inputs are from the PC's Parallel port.
>
> 16F628 and the STEP and DIR pins are on 17 and 18. RA0 and RA1
>
> All three power supplies have a common ground.
>
> The PIC seems to have power when the 5V and the 12V are turned off.
>
> can the PIC 'run' from a 5V signal on one of the I/O lines ?
>
> Dave
>


Yup, those protection diodes on the PIC's pins are tied to Vdd and
ground. If the voltage on a pin is higher than the Vdd rail by a diode
drop, current will flow from the pin to Vdd and turn your PIC on. At
that point, things can get real wierd.

--- In piclist@picl..., "Alan Marconett" <KM6VV@a...> wrote:
>
> Hi Dave,
>
> Yes, you're back driving it.
>
> Alan KM6VV
>
> > Hi All,
> >
> > I have a stepper driver that has 5 V power from one source, drives
> > TIP120 Darlingtons that are on a separate power source (12 volts) and
> > the inputs are from the PC's Parallel port.
> >
> > 16F628 and the STEP and DIR pins are on 17 and 18. RA0 and RA1
> >
> > All three power supplies have a common ground.
> >
> > The PIC seems to have power when the 5V and the 12V are turned off.
> >
> > can the PIC 'run' from a 5V signal on one of the I/O lines ?
> >
> > Dave
> >
>


--- In piclist@picl..., "bergweed" <mikeberg@r...> wrote:
>
> Yup, those protection diodes on the PIC's pins are tied to Vdd and
> ground. If the voltage on a pin is higher than the Vdd rail by a diode
> drop, current will flow from the pin to Vdd and turn your PIC on. At
> that point, things can get real wierd.
>


> At that point, things can get real wierd.

Not sure if that is the technical term, but it sure describes what the
thing acts like. I have been using the term 'haunted'

Dave


Been there, done that. Makes you wonder about things that go bump in
the night. :p

Most important, usually, is the power-up sequencing. Make sure that
VDD is always first up and last down and higher than any other pin,
unless that pin is very current limited.

Chad

--- Dave Mucha <dave_mucha@dave...> wrote:

> --- In piclist@picl..., "bergweed" <mikeberg@r...> wrote:
> >
> > Yup, those protection diodes on the PIC's pins are tied to Vdd and
> > ground. If the voltage on a pin is higher than the Vdd rail by a
> diode
> > drop, current will flow from the pin to Vdd and turn your PIC on.
> At
> > that point, things can get real wierd.
> > > At that point, things can get real wierd.
>
> Not sure if that is the technical term, but it sure describes what
> the
> thing acts like. I have been using the term 'haunted'
>
> Dave


My software has no bugs, only undocumented features.



--- In piclist@picl..., Chad Russel <chadrussel@y...> wrote:
>
> Been there, done that. Makes you wonder about things that go bump in
> the night. :p
>
> Most important, usually, is the power-up sequencing. Make sure that
> VDD is always first up and last down and higher than any other pin,
> unless that pin is very current limited.
>
> Chad


What are the work arounds ?

Since I have two different power sources, it seems that either one
could be on at any time.

I opted to lay out another board with opto-isolators, but am not sure
if that is the best(simplest?) way.

any suggestions ?

Dave


With out having the entire picture, it is difficult to guess the best
or cheapest way to accomplish your goal.

I belive you mentioned a 5 volt interface to the 12 volts. The
easiest and maybe cheapest, might be to find a way to keep the driving
5 volts disabled until the PIC is up and smiling, then let the PIC
enable the 5 volts.

Another method might be cmos switches in the driving control lines
that are turned on by the PIC.

What ever method you chose should probably be designed to cause
minimum clitching in the output circuits, when enabled or diabled.

Designing a system to power up and power down in a well behaved
fashion can be a lot of work.

Good Luck,
Chad

--- In piclist@picl..., "Dave Mucha" <dave_mucha@y...> wrote:
>
> --- In piclist@picl..., Chad Russel <chadrussel@y...> wrote:
> >
> > Been there, done that. Makes you wonder about things that go bump in
> > the night. :p
> >
> > Most important, usually, is the power-up sequencing. Make sure that
> > VDD is always first up and last down and higher than any other pin,
> > unless that pin is very current limited.
> >
> > Chad > What are the work arounds ?
>
> Since I have two different power sources, it seems that either one
> could be on at any time.
>
> I opted to lay out another board with opto-isolators, but am not sure
> if that is the best(simplest?) way.
>
> any suggestions ?
>
> Dave
>




--- In piclist@picl..., "chadrussel" <chadrussel@y...> wrote:
>
> With out having the entire picture, it is difficult to guess the best
> or cheapest way to accomplish your goal.
>
> I belive you mentioned a 5 volt interface to the 12 volts. The
> easiest and maybe cheapest, might be to find a way to keep the driving
> 5 volts disabled until the PIC is up and smiling, then let the PIC
> enable the 5 volts.
>
> Another method might be cmos switches in the driving control lines
> that are turned on by the PIC.
>
> What ever method you chose should probably be designed to cause
> minimum clitching in the output circuits, when enabled or diabled.
>
> Designing a system to power up and power down in a well behaved
> fashion can be a lot of work.
>
> Good Luck,
> Chad

That is an understatement.

To review, the board is a simple Stepper Driver board. it receives 5V
signals from a PC's Parallel port. These will run at a maximum of
about 50kHz in some software packages, but I think my limitations will
be slower.

Currently, I added opto-isolators so the line from the parallel port
is ended before reaching the PIC and back-feeding it.

The motors are run from something between 5 and 50 Vdc. They are
controlled with a TIP-120 Darlington. The base of that chip is
connected to the PIC with a 1k resistor.

The motor control enclosure also has a 12 volt power line. That line
comes into my board and is regulated to 5v and (12V or 9v)

The 12v or 9v are used to power a relay (depending on the sale of the
week) and the 5V is used to power the PIC.

I wish I could get a 5 and 12v line from a laptop, but alas, I am
using a separate power supply.

The PIC would be connected to the outputs of an opto to get it's
signals and then to the base of the Darlingtons. Hopefully, it will
not have any more adventures without my knowledge.

As for the fun ride. when a PC starts, it runs a P.O.S.T. or Power On
Self Test and it exercises the parallel port. That means is has some
apparently random signals on that port going high and low for it's own
uses. And that makes the stepper driver go crazy.

To solve that, I have thought about a timer that will stop any of
those signals from passing until the PC has been on for over 30 seconds.

There is one motor controller program that outputs a 15kHz signal on
one PP line to indicate that the software is in control of the
signals. with that, it is easy to know when it is safe to let things
run. alas, there is only one software program that I know of that
does that.

Thanks for the responses.

At this time I am just putting in a bunch of isolators to prevent the
signals from backfeeding the PIC.

As more testing goes on, I am sure I will find other problems.

Dave



The PC is probably trying to initialize the printer it thinks is
installed, if there is one. You can try holding the Parallel Busy line
high until you are ready.
--- Dave Mucha <dave_mucha@dave...> wrote:

> --- In piclist@picl..., "chadrussel" <chadrussel@y...> wrote:
> >
> > With out having the entire picture, it is difficult to guess the
> best
> > or cheapest way to accomplish your goal.
> >
> > I belive you mentioned a 5 volt interface to the 12 volts. The
> > easiest and maybe cheapest, might be to find a way to keep the
> driving
> > 5 volts disabled until the PIC is up and smiling, then let the PIC
> > enable the 5 volts.
> >
> > Another method might be cmos switches in the driving control lines
> > that are turned on by the PIC.
> >
> > What ever method you chose should probably be designed to cause
> > minimum clitching in the output circuits, when enabled or diabled.
> >
> > Designing a system to power up and power down in a well behaved
> > fashion can be a lot of work.
> >
> > Good Luck,
> > Chad
>
> That is an understatement.
>
> To review, the board is a simple Stepper Driver board. it receives
> 5V
> signals from a PC's Parallel port. These will run at a maximum of
> about 50kHz in some software packages, but I think my limitations
> will
> be slower.
>
> Currently, I added opto-isolators so the line from the parallel port
> is ended before reaching the PIC and back-feeding it.
>
> The motors are run from something between 5 and 50 Vdc. They are
> controlled with a TIP-120 Darlington. The base of that chip is
> connected to the PIC with a 1k resistor.
>
> The motor control enclosure also has a 12 volt power line. That line
> comes into my board and is regulated to 5v and (12V or 9v)
>
> The 12v or 9v are used to power a relay (depending on the sale of the
> week) and the 5V is used to power the PIC.
>
> I wish I could get a 5 and 12v line from a laptop, but alas, I am
> using a separate power supply.
>
> The PIC would be connected to the outputs of an opto to get it's
> signals and then to the base of the Darlingtons. Hopefully, it will
> not have any more adventures without my knowledge.
>
> As for the fun ride. when a PC starts, it runs a P.O.S.T. or Power
> On
> Self Test and it exercises the parallel port. That means is has some
> apparently random signals on that port going high and low for it's
> own
> uses. And that makes the stepper driver go crazy.
>
> To solve that, I have thought about a timer that will stop any of
> those signals from passing until the PC has been on for over 30
> seconds.
>
> There is one motor controller program that outputs a 15kHz signal on
> one PP line to indicate that the software is in control of the
> signals. with that, it is easy to know when it is safe to let things
> run. alas, there is only one software program that I know of that
> does that.
>
> Thanks for the responses.
>
> At this time I am just putting in a bunch of isolators to prevent the
> signals from backfeeding the PIC.
>
> As more testing goes on, I am sure I will find other problems.
>
> Dave >
>


My software has no bugs, only undocumented features.