[Soekris] net4801 GPIO driving a relay...
Jan Hoevers
jan.hoevers at xs4all.nl
Mon May 7 10:01:45 UTC 2007
hello Peter,
If I understood your email right, your circuitry is doing exactly what
it should...
The text doesn't say so, but the npn circuitry in your pdf is obviously
designed to be driven by a totem pole output, while the gpio pins of the
PC87366 chip used on the 4801 have open drain outputs (see page 130 of
the PC87366 specs at
http://www.ortodoxism.ro/datasheets/nationalsemiconductor/PC87366.pdf).
You solved this problem in the correct way by using a pull up resistor,
but apparently oversaw that this setup works as an inverter.
That is: writing "1" to gpio will open the output transistor in the
PC87366, which will pull the output to ground level; writing "0" to gpio
will close the transistor and the pull up resistor will pull the output
to supply level.
The circuitry is not faulty, but as you write yourself it doesn't "feel
right". The "elegant" solution is to use the pnp circuit that is
decribed on the same pdf document. It will reverse the actions of the
relay.
Note that you MUST leave out the pull up resistor now, Q2/R2 will pull
up the open drain (effectively completing the open drain to a totem
pole). Failure to do so will give unpredictable results, because the
pull up resistor may or may not prevent Q2 from coming into saturation.
Note that simply replacing the pull up resistor by a pull down resistor
will not work, it will prevent your relay from switching at all.
If you think my description is to technical, here's a summary: replace
the npn circuitry by the pnp circuitry on the same pdf and leave out the
pull up resistor.
Sorry for my English, I'm not a native speaker.
regards,
Jan Hoevers
More information about the Soekris-tech
mailing list