Of course Stevens software solution is just as good as my suggestion for replacing the hardware driver by the pnp version, except that the relay will come on while the soekris is booting. The pullup resistor will drive the npn transistor as soon as power comes on. It's a matter of taste what you prefer.
Jan Hoevers > Peter > > The circuitry is intended to drive LEDs, this is commonly done by > connecting the anode of the LED to the positive supply voltage, and > the cathode (thru an appropriate current-limiting resistor) to the > GPIO pin. When the pin turns "on", it connects the GPIO pin to ground > (0 volts). When the pin turns off, the ground is disconnected, and > the LED/resistor pull the output to the positive voltage. thus your > description is exactly right. > > And, this is the same way it should work with a relay, too, if you > use the NPN version of the circuit you referenced. > > HOWEVER, if you wish to use the other version, you can easily reverse > this logic. In my patch to geode.c, simply change the line: > > ledb[i] = -pins[i]; > > to > ledb[i] = pins[i]; //i.e. remove the minus sign > > In the logic that sets the GPIO pin, if the pin number is negative, > it uses negative logic (1 -> 0v). By removing the minus sign, it uses > positive logic (0 -> 0V). > > Hope this helps. > > Steven Finnegan _______________________________________________ Soekris-tech mailing list [email protected] http://lists.soekris.com/mailman/listinfo/soekris-tech
