EEVblog® Electronics Community Forum
Products => Computers => Topic started by: cdev on February 28, 2021, 09:42:40 pm
-
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.
-
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?
-
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 (https://www.advantech.com/products/1-2mlkb0/pcie-1756/mod_d82b814b-742f-41f9-89a2-3abc8b59120b)
-
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.
-
Is the i2c bus in PCs accessible from anywhere?
There 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.
-
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.
-
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..
-
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)
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?
I 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.
I wonder if some simple things like the power button are unintentionally very low jitter interrupt sources.
-
The PC changed too much from those IBM-PC Xt/At versions.
All which was once considered "bus interrupts" is CRAMMED IN THE SUPER I/O
The LPC bus is the "de facto" successor and manage all the
old interrupts on the ISA bus..
But... things got far too complicated thanks to ACPI and
modern Super I/O now are programmable and not by chance
they "freeze" and lock very easy..
Check the likes of modern ITE (like IT8586E), Nuvoton
and ENE ..
mostly they REQUIRE an advanced programmer like SVOD3
to 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
-
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.
-
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.
-
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.
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.
-
Perhaps it would be better to have a microcontroller with its own timing reference and send events with timestamps to the PC?
-
Perhaps it would be better to have a microcontroller with its own timing reference and send events with timestamps to the PC?
Thats 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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
<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 for 7 more years after external ADB ports were ditched in favor of USB!
-
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 like https://www.masterclock.com/products/pc-cards/pcie-gps (https://www.masterclock.com/products/pc-cards/pcie-gps).
-
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.
-
I'd really like to be able to measure arbitrary external events with a very good accuracy. The closer to the hardware the beter.
I 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.
-
I'd really like to be able to measure arbitrary external events with a very good accuracy. The closer to the hardware the beter.
I 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.
You 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.htm (https://www.meinbergglobal.com/english/products/pci-express-gps-clock.htm)
However 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.
-
I'd really like to be able to measure arbitrary external events with a very good accuracy. The closer to the hardware the beter.
I 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.
You 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.htm (https://www.meinbergglobal.com/english/products/pci-express-gps-clock.htm)
However 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.
That 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.
-
I think I hinted towards a job opening in the past which involves such projects... ;)
-
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.
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.
-
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.
-
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.
-
What makes you think this thing is compatible with a standard PC?
-
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.
-
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.