General purpose input/output Interrupt pins in desktop PCs? - Page 1
Forum section: electronics / general

author: cdev
author_rank: Super Contributor
timestamp: February 28, 2021, 09:42:40 pm
content: I need some more knowlege about GPIOS in desktop PCs hat I can talk to and query the state of from software. Some I know about (often used in NTP 1PPS - a timing application.. Serial and Parallel port pins, (but most desktop PCs no longer have LPR or serial ports) Keyboard LEDs. Can people think of any more of them?I used to have a book that covered this subject well for the IBM-PC. But I have not seen it in some time. Is the i2c bus in PCs accessible from anywhere??Ideally something that is already there that I don't need a special anything to use.

author: daqq
author_rank: Super Contributor
timestamp: February 28, 2021, 09:49:30 pm
content: You can use USB-serial converters. If you use the FTDI stuff, they do have modes that basically give you a bunch of GPIOs.Maybe try looking into the fan control PWM and feedback with some unholy hack?And then there's the analog sound I/O. If you manage to modulate your signals so you can AC couple them then you should be able to determine their presence. edit: Or maybe look for the rising/falling edge via the ADC?

author: brucehoult
author_rank: Super Contributor
timestamp: February 28, 2021, 10:12:51 pm
content: Most people have no use for it, so manufacturers don't include it.The cheap but not super-fast way is to just plug in an "Arduino". A Mega 2650 gives a lot of GPIOs for not much money. So does a Teensy 4.There are PCIe cards. This one with 64 GPIOs is $224 on Mouser:https://www.advantech.com/products/1-2mlkb0/pcie-1756/mod_d82b814b-742f-41f9-89a2-3abc8b59120b

author: ejeffrey
author_rank: Super Contributor
timestamp: March 01, 2021, 04:35:33 am
content: You mentioned PPS signals where you often care about jitter. Serial and parallel port control pins can have quite low jitter so this was a motivation for their use in that application. Whether you care about jitter or not will strongly define what options you have.

author: magic
author_rank: Super Contributor
timestamp: March 01, 2021, 09:28:11 pm
content: Quote from: cdev on February 28, 2021, 09:42:40 pmThere is an I2C bus on every VGA/DVI/HDMI output but it needs drivers and software. Tends to work on Linux, usually.But for GPIOs it's either LPT/COM or PCI cards and USB dongles. There are some GPIOs on various chips on the motherboard, but never broken out on consumer hardware.

author: Whales
author_rank: Super Contributor
timestamp: March 01, 2021, 09:53:50 pm
content: Do you need this to work on some lines of modern motherboards, or all lines of modern motherboards? Is this a job that you could measure on a separate device (eg USB attached micro) and then only send the results to the computer, or you really need the computer doing the time-sensitive heavy lifting?PS2 is a serial interface that (at least used to?) interrupt the CPU when data arrives. You will probably have to send actual mouse/keyboard equivalent packets, but depending on what you're doing that might be fine.Some occasional motherboards still have IRda headers, just not populated. Look on motherboards for LPC and other legacy IO chips and read their datasheets.I wonder if some simple things like the power button are unintentionally very low jitter interrupt sources.

author: cdev
author_rank: Super Contributor
timestamp: March 01, 2021, 11:56:00 pm
content: Can the IRDA headers be treated like other GPIOs? Will have to look into that. I do have a couple of black three terminal IR devices I have removed from RTLSDR dongles so they could run cooler. I also have a Dangerous Prototypes IR Blaster. (USB IR sniffer/transceiver/utility)I want a fast interrupt that can be used for the pps line with the kernel pps discipline. This means it has to be fast. It will be connected to the pulse that is used to delineate the moment the seconds change. I have a blade server with eight "real" gigabit ethernet connections (which will be running NTP and freebsd and I am going to connect it up to a low jitter 1pps source. (A Samsung UCCM GPSDO)I need to find the suitable internal interrupt pin to use. Its a former firewall appliance machine and it has an architecture that's totally appropriate for that (and perhaps doing networking experiments) and less so for other things. It has Mni PCIE v3 expansion and not much else in the way of expansion. It turns out it has SVGA video expoed at an internal jack which can be turned into a VGA jack via a DB-9..

author: cdev
author_rank: Super Contributor
timestamp: March 02, 2021, 12:16:04 am
content: It has USB for its keyboard (plus it has a RJ-45 console jack, which I suppose is a real serial port, but one I dont want to lose)Quote from: Whales on March 01, 2021, 09:53:50 pmI plan on plugging the console into the Raspberry Pi 3b thats currently doing the job I plan to put it to work doing, serving time to my network. Then I can use minicom or similar to enable the console.PS2 is a serial interface that (at least used to?) interrupt the CPU when data arrives. You will probably have to send actual mouse/keyboard equivalent packets, but depending on what you're doing that might be fine.This box didnt come with a keyboard port at all, (or video but it turns out one can be arranged ) as its supposed to be more secure without one.Some occasional motherboards still have IRda headers, just not populated. Look on motherboards for LPC and other legacy IO chips and read their datasheets. It has a very densely populated Intel LGA 775 MB that has lots of stuff on it that I don't recognize. I bought it cheap because it was being removed from service but it appears to be just months old. There are a lot of them on the market.Quote from: Whales on March 01, 2021, 09:53:50 pm

author: PKTKS
author_rank: Super Contributor
timestamp: March 02, 2021, 11:09:59 am
content: The PC changed too much from those IBM-PC Xt/At versions.All which was once considered "bus interrupts" isCRAMMED IN THE SUPER I/OThe LPC bus is the "de facto" successor and manage all theold interrupts on the ISA bus..But... things got far too complicated thanks to ACPI andmodern Super I/O now are programmable and not by chancethey "freeze" and lock very easy..Check the likes of modern ITE (like IT8586E), Nuvotonand ENE ..mostly they REQUIRE an advanced programmer like SVOD3to load their firmware and pre select capabilities.in which I2C/SPI/SMB/ROM-BIOS (called legacy) and other stuff.Very confusing and problematic (and expensive) stuff.Paul

author: ejeffrey
author_rank: Super Contributor
timestamp: March 02, 2021, 06:10:40 pm
content: The accepted way for peripherals to generate interrupts on modern systems is message signaled interrupts sent over PCIe. You can either find an onboard peripheral that has interrupt requests in its definition (such as a SuperIO serial/parallel port) which will in turn be emulated over PCIe messages or you can get a PCIe expansion card that supports interrupt generation.Latency/jitter will never be as good as the hardware interrupt lines of old school PCs, but it will almost by definition be good enough for any purpose on the computer -- it can't do much of anything externally visible with less latency than those interrupt signals. One advantage of message signaled interrupts is actually that they have better latency for most applications than pin signaled interrupts because they cannot jump in front of IO from the same device, which means drivers can assume the memory transaction that the interrupt signals has completed by the time the ISR starts rather than having to poll the hardware for that.Probably a better/more modern approach is to have a complete clock system on the PCIe card that handles the PPS discipline and then provides time via IO which the kernel can discipline its own clock to. I see that there are GPS time cards available that do this, but I have no idea how the kernel drivers for that work.

author: cdev
author_rank: Super Contributor
timestamp: March 03, 2021, 12:55:22 am
content: My current desktop pc has a "SuperIO" card providing it a real serial port. But thats not the PC I am asking this question for.

author: cdev
author_rank: Super Contributor
timestamp: March 03, 2021, 01:01:55 am
content: Yes, I very much do care about jitter, I'm hoping to be able to make meaningful records which will be timestamped and logged on this machine, and I managed to pick up a huge hard drive for it as well.Quote from: ejeffrey on March 01, 2021, 04:35:33 am

author: NiHaoMike
author_rank: Super Contributor
timestamp: March 03, 2021, 01:39:01 am
content: Perhaps it would be better to have a microcontroller with its own timing reference and send events with timestamps to the PC?

author: cdev
author_rank: Super Contributor
timestamp: March 03, 2021, 10:09:49 pm
content: Quote from: NiHaoMike on March 03, 2021, 01:39:01 amThats kind of what I am planning to do with my GPSDO, if the right (fast) interrupt can be found. Even a serial port would do.

author: ogden
author_rank: Super Contributor
timestamp: March 03, 2021, 10:22:36 pm
content: Anything based on USB will have jitter. In case of desktop PC no brainer solution: pci-express rs232 board - and you have your hardware (input) interrupts.

author: Syntax Error
author_rank: Frequent Contributor
timestamp: March 04, 2021, 10:14:45 am
content: I'm not quite sure what you need but, there is a Windows compatible 32 bit driver called GIVEIO.SYS which is often used for those 'bitbang' programmers connected to the parallel printer port. It gives access to the individual IO lines, rather like the FTDI chip driver.The driver is a dependancy for Atmel's AVRDUDE. If you have the Arduino IDE installed then you may already have GIVEIO.SYS installed?However... I could NOT find any reliable documentation for Windows GIVEIO.SYS... anywhere. It just seems to exist undocumented? So if anyone has a legitimate document link then please post below. Thanks.

author: Refrigerator
author_rank: Super Contributor
timestamp: March 04, 2021, 10:26:40 am
content: If i remember correctly the DB25 plug (aka the printer port) can be used as GPIO.But you only find those on very old motherboards.

author: SeanB
author_rank: Super Contributor
timestamp: March 04, 2021, 11:50:05 am
content: They tend to be there on even new motherboards, but often all you have available is the pin connector, with a tiny tight pitch spacing, and it looks like almost nobody has the cable with the DB25 socket on it to use. Often the port is there and disabled in BIOS, and more modern boards it is not brought out at all to the surface, instead the balls of the BGA package are not connected.

author: mon2
author_rank: Frequent Contributor
timestamp: March 13, 2021, 09:00:25 pm
content: Jumping in here...1) do you wish to build a product to sell?2) on serial / parallel ports - our company has designed and built these adapters for the past 30+ years. For pci ? pcie bus? EPP1.7? EPP1.9? PS2?3) be aware that on a protected operating system such as windows 10, etc. - you will need a kernel mode driver to read/write to the respective serial or parallel port.We can show you how to use a freeware kernel mode driver to perform this task. Did this recently last December for HP to allow for in-system programming of the microwire eeprom on Windows 10.Shout back if we understand your requirement. The idea of USB is also valid but understand that using the parallel port is still much faster due to the overhead latency on the USB interface.A possible work around if using USB is to allow for the external USB device to sample your signal / buffer the data and then offload to the host. That is, much like the FX2LP by Cypress or their USB 3.0 USB interface, etc. Then you will need to use USB APIs to chat with the USB function.A few options here...but parallel port is very well documented already.

author: tooki
author_rank: Super Contributor
timestamp: March 17, 2021, 06:25:49 am
content: Quote from: cdev on February 28, 2021, 09:42:40 pm<tangential> I know that modern Macs use various GPIOs and i2c to connect to various peripherals (sensors, LEDs, etc., in addition to all the internal USB bus*), but I doubt one can control them even if you did perform microsoldering to get to them electrically.*fun fact: Apple laptops used the old ADB (Apple Desktop Bus) for internal keyboards and trackpads for7 more yearsafter external ADB ports were ditched in favor of USB!

author: Gribo
author_rank: Frequent Contributor
timestamp: March 17, 2021, 03:07:47 pm
content: If you need accurate timestamps, IEEE 1588v2 solutions exists, usually in the form of a timing server with its own GPSDO or atomic clock setup.Or, if you have a PCIe slot, something likehttps://www.masterclock.com/products/pc-cards/pcie-gps.

author: cdev
author_rank: Super Contributor
timestamp: March 18, 2021, 01:25:13 pm
content: There is one mini pci-e slot available and an onboard serial port, using the standard serial port header. One serial port is connected to a controllable front panel LCD with a four direction switch pad. It seems as if this LCD may only use ond of the two serial ports. There may even be three serial ports. The GPSDO that I want to use is a Samsung, one of the better GPSDO's, with very good accuracy and low jitter. Given that the PC has eight low latency gigabit NICs. They support the kernel PPS discipline and PTP. I think this machine would be a good server to provide routing and firewalling services and multiple subnet connectivity. IT will allow me to minimize the number of dumb switches on my network in order to bring devices closer to the Internet in terms of latency.I have not used this specific kind of machine before. Specifically, I have not seen eight gigabit NIC hardware used as an NTP server before and I'm curious about the accuracy. It will be running FreeBSD.Even if I use the on-board serial port header. I would like to access additional GPIOs if I can find them, because I can think of many uses for them. USB introduces too much latency to be as useful as I would wish for timing. The extra pins in a real serial port are better.I'd really like to be able to measure arbitrary external events with a very good accuracy. The closer to the hardware the better.

author: tszaboo
author_rank: Super Contributor
timestamp: March 18, 2021, 01:52:34 pm
content: Quote from: cdev on March 18, 2021, 01:25:13 pmI would buy a National Instruments (or equivalent) digital input card.Or, if you just want a super accurate RTC, I would desolder it from the motherboard, replace it with a micro, and route the PPS signal to this micro. And do some steering in its firmware.

author: nctnico
author_rank: Super Contributor
timestamp: March 18, 2021, 05:05:12 pm
content: Quote from: NANDBlog on March 18, 2021, 01:52:34 pmYou can buy cards from Meinberg which do just that. No need for soldering or any development.https://www.meinbergglobal.com/english/products/pci-express-gps-clock.htmHowever some kind of time-stamped sampling system is much better. Don't expect sub milli-second time accuracy from a PC platform especially with other software running on it. For any kind of accuracy (absolute or for synchronising multiple PCs) you'd need to use at least PTP (with timestamping in the networking hardware) instead of NTP.

author: tszaboo
author_rank: Super Contributor
timestamp: March 19, 2021, 09:16:48 pm
content: Quote from: nctnico on March 18, 2021, 05:05:12 pmThat looks great, I can appreciate the engineering behind it, and now I want to build a card like that.I mean, complex system with PCI-e, high speed digital, RF, and possibly low power on one card. Love it.

author: nctnico
author_rank: Super Contributor
timestamp: March 20, 2021, 12:42:02 am
content: I think I hinted towards a job opening in the past which involves such projects...

author: cdev
author_rank: Super Contributor
timestamp: March 20, 2021, 07:36:02 pm
content: The hardware I am using is a repurposed top brand firewall appliance. There are lots of them being taken out of service and loaded with software like pfsense. Thats what I have got. I know it must be based on a commercial motherboard, probably Intel. What I would like to do is be able to access and boot arbitrary boot images on USB disks to install otherOS's than the FreeBSD-based firewall that it came loaded with, which is proving to be difficult to replace. I am going to try removing the BIOS battery for a length of time and see if that allows me to boot another image and install another OS. Its worth a try. I suspect the original motherboard is an Intel one, maybe a special order custom MB. It has a 2.66 MB 4 core LGA773 CPU and 8 gigabit NICs plus an expansion slot which can be used to add 2 10 GBps NICs. (probably mellanox) The machine uses a server chassis and it weighs quite a bit. And as I was saying I hope to be able to access the serial port so as to get precise timing. I paid around $100 for it and it seems pretty new.it has a 2.6 GHz CPU It also has an interesting LCD which is for initial configuration.. I'd like to find out which HW manufacturer's board is used in it, because there is an awful lot of server hardware there which looks like it probably supports interesting applications. It has an internal SSD disk. And they seem to be available cheap on the used market. At the very least the 8 port gigabit lan is unusual and nice to have.. Its an ideal firewall box.Currently I am trying to figure out how to boot an arbitrary OS image of my choice.The bios appears to be locked . It just wants to boot the BSD firewall distro every time its booted. Even if I stick with it, I would still like to put a fresh install on the box.Quote from: mon2 on March 13, 2021, 09:00:25 pm

author: nctnico
author_rank: Super Contributor
timestamp: March 20, 2021, 10:13:34 pm
content: IMHO you are going to need a steep learning curve into protected BIOSses. Removing the battery is not going to help.Besides that it would be useful to just name the brand & model of the hardware you are using and posts some photos so people can identify headers with possible I/O ports. Without that info the only answers you'll get are highly academic because they aren't targeted at the actual hardware you have. It is even possible that your machine isn't compatible with an off-the-shelve OS.

author: cdev
author_rank: Super Contributor
timestamp: March 21, 2021, 02:23:31 am
content: it's a Checkpoint CPAP-SG4800-NGTX-HPP-HA-LCM with a 2.66 GHz CPU and 8 gb memory and 8x1gb nic and it's a firewall network appliance.When it boots, I am unable to boot off of USB sticks made in the usual way.. (dd if=file.iso of=usbstick.img)however I can run the firewall os which is based on freebsd. the vendor was able to load pfsense onto it.

author: nctnico
author_rank: Super Contributor
timestamp: March 21, 2021, 09:57:01 am
content: What makes you think this thing is compatible with a standard PC?

author: cdev
author_rank: Super Contributor
timestamp: March 21, 2021, 01:07:39 pm
content: Other people are able to load x86_64 based OS's like freeBSD/pfsense onto them, but perhaps there is some magic incantation they know but I don't, yet. Or perhaps the bootable images I have made as I have always made them before, are missing something besides the bootable flag and a correct checksum.I only paid around $100 for my server. Which seems very cheap for such an obviously useful router platform that's overbuilt. The intel NICs it contains are supposed to be the best for networking research. Lowest latency.

author: nctnico
author_rank: Super Contributor
timestamp: March 22, 2021, 07:38:52 pm
content: For $100 (or even less) you can buy an ex-lease workstation which can run any PC compatible OS. Quad port Intel network cards aren't expensive either. IMHO you have bought a piece of boutique hardware for way too much money.Why didn't you try to re-create the steps other people have taken to install different software? Given it is a firewall you very likely need factory signed software to get it to install in order to make sure the device can not be compromised by third parties even if they have physical access to the device. Chances are high it is only useful for its intended purpose: a firewall. I would not buy such a specialist piece of hardware.