I've been reading about PPS in linux and GPS synchronization.

I stumbled on some sources recommending using a USB GPS, I'm nto quite sure I understand how the interrupt signal is passed through.

The PPS, so the computer can timestamp it very accurately is typically put on DCD in a serial connection. But I don't understand how this is transmit when using USB.


1 Answer 1


Each USB UART chipset communicates that differently ovet the USB.

And how they do it in detail will not be relevant.

All you need to care is that the USB serial chips have a DCD input pin, and that the USB drivers for those chips provide you with a standard serial port interface so your code running on PC will see modem status events identically, no matter if it is a an actual physical serial port or virtual USB serial interface.

Simply put, all communication between a USB serial chip is done in USB data packets, and just like there are USB data packets that are used to transfer the actual serial data bytes and information related to data bytes such as parity or framing errors, there are USB data packets that indicate changes in the modem status and handshake lines.

  • \$\begingroup\$ so if i want to emulate the USB packet created from a LOW (assuming active low) on the DCD pin. How could I do this with a microcontroller? \$\endgroup\$ Commented Mar 12, 2023 at 13:00
  • \$\begingroup\$ First you must write the microcontroller to be a USB device which enumerates itself as serial port of some kind, like standard USB ACM/CDC device. Then you look at what kind of protocol CDC uses to send any data or status info, and then you have that info what kind of status packet to send. \$\endgroup\$
    – Justme
    Commented Mar 12, 2023 at 13:41
  • \$\begingroup\$ It's already connected via /dev/ttyACM#. I guess this means through the CDC driver then, so I'll look what the protocol says. Though, I will say I had tried this before. But DCD doesn't really get mentioned in the context of USB as far as I could see \$\endgroup\$ Commented Mar 13, 2023 at 8:02
  • \$\begingroup\$ If you already opened the serial port in Linux, you need to use the corresponding API calls for that opened port. It does not depend in any way what kind of port it is, USB or integrated UART or PCI card. It will just work identically from the TTY driver to your software. \$\endgroup\$
    – Justme
    Commented Mar 13, 2023 at 8:26
  • \$\begingroup\$ Not sure I understand entirely, is there anywhere I can read more? It is interpreted as a ttyACM port, and attribute walk shows the driver is "cdc_acm". Not really sure how to proceed from here. \$\endgroup\$ Commented Mar 13, 2023 at 9:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.