I was going to say that the GPIO pins had been covered in previous postings to this list, but then I noticed you were one of those posters - on Jan 24 or so.
I believe the upshot of the postings was that the GPIO chip must have its pins enabled before they will be active. This is so the attached hardware does not get random glitches during the turn-on period. You must programatically enable the pins after the board is powered up. Check out the 240 page Nat Semi manual on the PC87366 chip. Around page 67 it tells about how to configure the GPIO pins. http://www.datasheetcatalog.org/datasheet/nationalsemiconductor/PC87366.pdf I hope this helps Bob G On Sat, 2009-02-21 at 18:49 +0200, Lars Noodén wrote: > I'm looking at using OpenBSD 4.4's gpio functions [1] on a Net4801 to > set some pins [2] to have +3.3 volts when on and 0 volts when off. > However, regardless of the state reported by gpioctl, the pins show > about +3.3 volts on my meter. > > # gpioctl 0 2; gpioctl 2 2; gpioctl 4 2; gpioctl 6 2; > pin 0: state 1 -> 0 > pin 2: state 1 -> 0 > pin 4: state 0 -> 1 > pin 6: state 0 -> 1 > > # gpioctl 0 2; gpioctl 2 2; gpioctl 4 2; gpioctl 6 2; > pin 0: state 0 -> 1 > pin 2: state 0 -> 1 > pin 4: state 1 -> 0 > pin 6: state 1 -> 0 > > The gpio<-> JP5 pin mappings are in /etc/rc.securelevel as follows: > > gpioctl -c 00 out pp; # should be pin no. 3 ? > gpioctl -c 02 out pp; # should be pin no. 5 ? > gpioctl -c 04 out pp; # should be pin no. 7 ? > gpioctl -c 06 out od; # should be pin no. 9 ? > > FWIW, there does not seem to be an obvious way to leave the system in > securelevel 0. The boot sequence says > "setting kernel security level: kern.securelevel: 0 -> 0" > but from the shell, it shows level 1: > $ sysctl kern.securelevel > kern.securelevel=1 > That's even after trying to set it explicitly in /etc/rc: > sysctl kern.securelevel=0 > (yeah, that should be left alone...) > > > > Regards > -Lars > > [1] > http://www.openbsd.org/cgi-bin/man.cgi?query=gpioctl&apropos=0&sektion=0&manpath=OpenBSD+4.4&arch=i386&format=html > > [2] see sect. 3.5 JP5, User I/O: > http://www.soekris.com/manuals/net4801_manual.pdf > > _______________________________________________ > Soekris-tech mailing list > [email protected] > http://lists.soekris.com/mailman/listinfo/soekris-tech _______________________________________________ Soekris-tech mailing list [email protected] http://lists.soekris.com/mailman/listinfo/soekris-tech
