HowTo gpio with com-port?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

HowTo gpio with com-port?

Younix
Hello,

I want to get some signals from a electronic circuit at my serial-port
com0. I don't know how to attach the pin's from the serial port with the
gpioctl tool. I think it my hardware is not supported, but I don't know
exactly. In my dmesg there is nothing like this:

"gpio0 at gscpcib0: 64 pins"

What could I do to get the signals from my circuit or to get support
with gpio?

thx
ciao, Jan

my dmesg:

OpenBSD 4.5-current (GENERIC.MP) #10: Tue Mar 24 06:45:46 CET 2009
     [hidden email]:/usr/src/sys/arch/i386/compile/GENERIC.MP
cpu0: AMD Athlon(tm) 64 X2 Dual Core Processor 6000+ ("AuthenticAMD"
686-class, 1024KB L2 cache) 3.05 GHz
cpu0:
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,CX16
real mem  = 1072984064 (1023MB)
avail mem = 1029214208 (981MB)
mainbus0 at root
bios0 at mainbus0: AT/286+ BIOS, date 07/16/07, SMBIOS rev. 2.4 @
0xfbc00 (30 entries)
bios0: vendor American Megatrends Inc. version "P2.10" date 07/16/2007
acpi0 at bios0: rev 0
acpi0: tables DSDT FACP APIC OEMB HPET
acpi0: wakeup devices PS2K(S4) PS2M(S4) UAR1(S4) USB0(S4) MAC_(S5)
AC97(S4) USB1(S4) USB2(S4) P0P1(S4)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: apic clock running at 202MHz
cpu1 at mainbus0: apid 1 (application processor)
cpu1: AMD Athlon(tm) 64 X2 Dual Core Processor 6000+ ("AuthenticAMD"
686-class, 1024KB L2 cache) 3.05 GHz
cpu1:
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,CX16
ioapic0 at mainbus0: apid 2 pa 0xfec00000, version 11, 24 pins
ioapic0: misconfigured as apic 0, remapped to apid 2
acpihpet0 at acpi0: 25000000 Hz
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 2 (P0P1)
acpicpu0 at acpi0
acpicpu1 at acpi0
acpibtn0 at acpi0: PWRB
bios0: ROM list: 0xc0000/0xd000 0xcd000/0x1800
pci0 at mainbus0 bus 0: configuration mode 1 (bios)
pchb0 at pci0 dev 0 function 0 "NVIDIA nForce3 250 PCI Host" rev 0xa1
agp at pchb0 not configured
pcib0 at pci0 dev 1 function 0 "NVIDIA nForce3 250 ISA" rev 0xa2
nviic0 at pci0 dev 1 function 1 "NVIDIA nForce3 250 SMBus" rev 0xa1
iic0 at nviic0
spdmem0 at iic0 addr 0x50: 1GB DDR2 SDRAM non-parity PC2-5300CL5
iic1 at nviic0
ohci0 at pci0 dev 2 function 0 "NVIDIA nForce3 250 USB" rev 0xa1: apic 2
int 9 (irq 9), version 1.0, legacy support
ohci1 at pci0 dev 2 function 1 "NVIDIA nForce3 250 USB" rev 0xa1: apic 2
int 3 (irq 3), version 1.0, legacy support
ehci0 at pci0 dev 2 function 2 "NVIDIA nForce3 250 USB" rev 0xa2: apic 2
int 9 (irq 9)
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 "NVIDIA EHCI root hub" rev 2.00/1.00 addr 1
nfe0 at pci0 dev 5 function 0 "NVIDIA nForce3 LAN" rev 0xa2: apic 2 int
9 (irq 9), address 00:19:66:47:22:e8
rlphy0 at nfe0 phy 1: RTL8201L 10/100 PHY, rev. 1
pciide0 at pci0 dev 8 function 0 "NVIDIA nForce3 250 IDE" rev 0xa2: DMA,
channel 0 configured to compatibility, channel 1 configured to compatibility
wd0 at pciide0 channel 0 drive 0: <MAXTOR 6L040J2>
wd0: 16-sector PIO, LBA, 38172MB, 78177792 sectors
wd1 at pciide0 channel 0 drive 1: <SAMSUNG SP2014N>
wd1: 16-sector PIO, LBA48, 190782MB, 390721968 sectors
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 6
wd1(pciide0:0:1): using PIO mode 4, Ultra-DMA mode 6
atapiscsi0 at pciide0 channel 1 drive 0
scsibus0 at atapiscsi0: 2 targets
cd0 at scsibus0 targ 0 lun 0: <HL-DT-ST, DVDRAM GSA-4167B, DL12> ATAPI
5/cdrom removable
wd2 at pciide0 channel 1 drive 1: <Maxtor 92049U6>
wd2: 16-sector PIO, LBA, 19544MB, 40026672 sectors
cd0(pciide0:1:0): using PIO mode 4, Ultra-DMA mode 2
wd2(pciide0:1:1): using PIO mode 4, Ultra-DMA mode 4
pciide1 at pci0 dev 10 function 0 "NVIDIA nForce3 250 SATA" rev 0xa2: DMA
pciide1: using apic 2 int 10 (irq 10) for native-PCI interrupt
wd3 at pciide1 channel 0 drive 0: <ST3500630AS>
wd3: 16-sector PIO, LBA48, 476940MB, 976773168 sectors
wd3(pciide1:0:0): using PIO mode 4, Ultra-DMA mode 5
ppb0 at pci0 dev 11 function 0 "NVIDIA nForce3 250 AGP" rev 0xa2
pci1 at ppb0 bus 1
vga1 at pci1 dev 0 function 0 "ATI Radeon 9800 Pro" rev 0x00
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
radeondrm0 at vga1: apic 2 int 11 (irq 11)
drm0 at radeondrm0
"ATI Radeon 9800 Pro Sec" rev 0x00 at pci1 dev 0 function 1 not configured
ppb1 at pci0 dev 14 function 0 "NVIDIA nForce3 250 PCI-PCI" rev 0xa2
pci2 at ppb1 bus 2
rl0 at pci2 dev 9 function 0 "Realtek 8139" rev 0x10: apic 2 int 9 (irq
9), address 00:e0:7d:d3:74:23
rlphy1 at rl0 phy 0: RTL internal PHY
pchb1 at pci0 dev 24 function 0 "AMD AMD64 0Fh HyperTransport" rev 0x00
pchb2 at pci0 dev 24 function 1 "AMD AMD64 0Fh Address Map" rev 0x00
pchb3 at pci0 dev 24 function 2 "AMD AMD64 0Fh DRAM Cfg" rev 0x00
kate0 at pci0 dev 24 function 3 "AMD AMD64 0Fh Misc Cfg" rev 0x00: core
rev JH-F3
isa0 at pcib0
isadma0 at isa0
com0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pcppi0 at isa0 port 0x61
midi0 at pcppi0: <PC speaker>
spkr0 at pcppi0
lpt0 at isa0 port 0x378/4 irq 7
wbsio0 at isa0 port 0x2e/2: W83627EHF rev 0x63
lm1 at wbsio0 port 0x290/8: W83627EHF
npx0 at isa0 port 0xf0/16: reported by CPUID; using exception 16
usb1 at ohci0: USB revision 1.0
uhub1 at usb1 "NVIDIA OHCI root hub" rev 1.00/1.00 addr 1
usb2 at ohci1: USB revision 1.0
uhub2 at usb2 "NVIDIA OHCI root hub" rev 1.00/1.00 addr 1
mtrr: Pentium Pro MTRR support
uaudio0 at uhub2 port 4 configuration 1 interface 0 "ABC PnP Audio
Device" rev 1.10/0.10 addr 2
uaudio0: audio rev 1.00, 17 mixer controls
audio0 at uaudio0
uhidev0 at uhub1 port 3 configuration 1 interface 0 "Darfon USB Combo
Keyboard" rev 1.10/3.02 addr 2
uhidev0: iclass 3/1
ukbd0 at uhidev0: 8 modifier keys, 6 key codes
wskbd1 at ukbd0 mux 1
wskbd1: connecting to wsdisplay0
uhidev1 at uhub1 port 3 configuration 1 interface 1 "Darfon USB Combo
Keyboard" rev 1.10/3.02 addr 2
uhidev1: iclass 3/0, 2 report ids
uhid0 at uhidev1 reportid 1: input=1, output=0, feature=0
uhid1 at uhidev1 reportid 2: input=4, output=0, feature=0
uhidev2 at uhub1 port 4 configuration 1 interface 0 "Logitech USB-PS/2
Optical Mouse" rev 2.00/27.20 addr 3
uhidev2: iclass 3/1
ums0 at uhidev2: 8 buttons, Z dir
wsmouse0 at ums0 mux 0
softraid0 at root
root on wd1a swap on wd1b dump on wd1b
WARNING: / was not properly unmounted
WARNING: NVRAM century is 32 but RTC year is 2009
/dev/wd3i: file system not clean; please fsck(8)

Reply | Threaded
Open this post in threaded view
|

Re: HowTo gpio with com-port?

Marc Balmer-2
Jan,

> I want to get some signals from a electronic circuit at my serial-
> port com0. I don't know how to attach the pin's from the serial port  
> with the gpioctl tool. I think it my hardware is not supported, but  
> I don't know exactly. In my dmesg there is nothing like this:
>
> "gpio0 at gscpcib0: 64 pins"
>
> What could I do to get the signals from my circuit or to get support  
> with gpio?

I am sorry, but doing this with the gpio framework is not possible.  
To make this
happen, it would require a small driver that wins over the standard  
serial port
driver during system auto configuration and that provides the modem  
control lines
as GPIO.  While I think such a driver would be fairly easy to write,  
it does not yet
exist to my best knowledge.

You can, however, open the serial port's tty device and query the  
modem control
signals.

- Marc Balmer

[...]

Reply | Threaded
Open this post in threaded view
|

Re: HowTo gpio with com-port?

Per-Erik Persson
In reply to this post by Younix
I spent some time trying to toggle the pins in the serial port in
various ways.
The easiest way for me was to install pyserial and to control the pins
in python takes only two or three lines of code.
This is neat if you just want to do some basic stuff.


Jan Klemkow wrote:
> Hello,
>
> I want to get some signals from a electronic circuit at my serial-port
> com0. I don't know how to attach the pin's from the serial port with
> the gpioctl tool. I think it my hardware is not supported, but I don't
> know exactly. In my dmesg there is nothing like this:

Please consider the environment before printing this email