Oops -- slight correction. When I was looking at the diagram at  
http://www1.jaycar.com.au/images_uploaded/relaydrv.pdf , I was  
mistakenly thinking the transistor was the output driver of the GPIO  
pin (guess I'm not quite fully awake yet). This "extra" transistor  
adds an additional inversion of the logic. At any rate, to make the  
output of the GPIO work with the opposite polarity, make the changes  
to the gpio.c patch mentioned below.


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

On May 7, 2007, at 7:00 , [EMAIL PROTECTED] wrote:

> Measuring the voltage between GPIO00 and GND I see 3.3v when
> set to 0 and 0v when set to 1.
>
> Sufice to say, I'm a tad confused, this seems the opposite way round
> then expected?




****************************
Controlsoft L.P.
Steven Finnegan
Web: www.ctrlsft.com
****************************


_______________________________________________
Soekris-tech mailing list
[email protected]
http://lists.soekris.com/mailman/listinfo/soekris-tech

Reply via email to