Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
@gomi: You wrote "I you choose to go with the hardware way, it's better to use a legacy serial port, which has a direct IRQ access to the CPU, than going through the full serial over usb stack."
My current implementation idea was to send one UDP packet per second. I want to avoid to utilize a new serial port driver (did you need one?) and i think the network stack adds only very little latency. Was this an option within your solution? I can attach my stratum source to the serial port too, but i don't know if this is a legacy port (have to look into the motherboard spec first). I have more knowledge to handle IP data then serial port access.
If I understand you will be building a dedicated NTP server on PI box ?
In this case, you will need some way to discipline your local PC clock (make it slew faster/slower)
Since you're on a LAN (constant network latency), I would leave this to a local NTP client..
No not anymore. NTP is out of the game. I can achieve much more precision with doing it myself and i can keep control. Adjusting the timer frequency is one part of the game. I want to send a UDP packet (not NTP) to my PC and the (my) client handles the windows time sync (like yours) OR use the time information directly.
Using the PC serial port instead of using ethernet can reduce the hardware design a lot. The PI box is only for fast development. Later i can attach a small atmel avr. That's why i asked about the serial port.
I didn't really think to use a network stack as my GPS card was serial ;-)
Using a serial port is easy, you just set up a mask
SetCommMask(hPort, EV_RLSD | EV_ERR | EV_RXCHAR);
An wait for the interrupt
WaitCommEvent(hPort, &dwCommModemStatus, 0);
FYI here's my code, you need Windows 8 because of GetSystemTimePreciseAsFileTime
But you can replace with GetSystemTimeAsFileTime if needed to compile on pre-Win8.
I also have some Win 7 code that will do interpolation with performance counters if you need.
Code will set thread affinity on one core only and set real time priority.
Thanks a lot gomi. You can help me out with the Win7 code, if you are willing to share it. Now it's family time, so i will look into the code at later time. But i'm looking forward to do it. I think we had the same needs and it resolves in the same solution. Awesome!
Here's the Win7 code. To make it work with good precision, the code will compute a corrective scale factor for performance counter frequency, using an EMA(100) of measured values.
Be prepared to see some ugly stuff, never planned to make it public ;-)