TimeHATV6 i226 NIC with PPS In/Out for RPi5
Raspberry Pi 5 PCIe HAT with I226 NIC
The Raspberry Pi 5 PCIe HAT is designed to bring precision timing and advanced network functionality to the Raspberry Pi 5 platform. Leveraging the PCIe interface via an FPC connection, this HAT expands the Pi's capabilities by integrating a high-performance I226 Ethernet NIC, precise timing inputs and outputs via SMA connectors, and a GNSS module slot for global time synchronization. It's a powerful tool for building small form-factor PTP (Precision Time Protocol) clients, ideal for time-sensitive networking applications.
Included in box
- TimeHAT
- 40 pin spacer
- 16-pin FPC PCIe cable
- Spacers, nuts, and screws for mounting to RPI5
Github Repo
For Discussions and issues or information not found in the instructions below, please visit our Github: https://github.com/Time-Appliances-Project/TimeHAT
Jeff Geerling also has a Github repo that relates to this product: https://github.com/geerlingguy/time-pi
Key Features
I226 Ethernet NIC
The HAT features an Intel I226 NIC connected to the Raspberry Pi 5 over the PCIe interface, delivering fast, reliable Ethernet connectivity. This makes it suitable for applications requiring high-speed networking combined with precise timing.
Precision Timing via SMA Ports
The HAT includes two SMA connectors for timing signal input and output:
- SMA Input (SDP1 on I226): Allows the HAT to receive a 1PPS (one pulse per second) signal, which can be used as a reference to discipline the NIC's internal clock.
- SMA Output (SDP0 on I226): Provides a 1PPS output signal from the NIC, which can be used to measure precise time intervals or synchronize external equipment.
- Spare U.FL (SDP3 on I226): A raw unbuffered connection from SDP3 on the I225 goes to a spare U.FL, can be used as input or output. WARNING: This is also a strapping pin on the I226. If you have this connected when the card boots up, it may make the Ethernet connectivity not work.
These timing features enable the HAT to act as either a PTP client or a PTP grandmaster, providing precise time synchronization for your network.
OCP M.2 GNSS Slot (2242 Form Factor)
The HAT includes an M.2 slot designed for OCP-compliant GNSS modules, allowing you to add GNSS functionality to your Raspberry Pi setup:
- UART Connection: The GNSS module communicates with the Pi via the standard Pi HAT header.
- 1PPS from GNSS to SDP2 on I226: The 1PPS signal from the GNSS module connects directly to the NIC, allowing the NIC to discipline itself to GPS time. This feature is essential for building a reliable grandmaster clock, providing accurate time sourced directly from satellites.
Built-in TCXO
For enhanced timing stability, the HAT includes a high-precision Temperature-Compensated Crystal Oscillator (TCXO).
- Improved Holdover Performance: The TCXO ensures that the NIC's timing remains stable even during network loss.
- Improved stability: Using a TCXO backed NIC, you can adjust the disciplining parameters to reduce timing jitter recovered over PTP
-
TCXO Used: ECS-TXO53-S3-33-250-BN-TR
+/- 280ppb stability across temperature
Applications
This HAT is designed for a variety of precision timing and networking applications:
- PTP Client or Grandmaster: Use the HAT to synchronize your network devices with sub-microsecond accuracy.
- GNSS Disciplined Clock: Leverage the GNSS module to create a highly accurate, satellite-synchronized clock.
- 1PPS Signal Measurement: Measure and verify 1PPS signals for precise timekeeping in your system.
- Edge Networking: Deploy the HAT in edge computing environments where precise timing is crucial.
Why This HAT is Special
The Raspberry Pi 5 PCIe HAT combines high-speed networking with advanced timing features in a compact, easy-to-deploy form factor. It allows makers, hobbyists, and professionals to build small yet powerful PTP solutions using the versatile Raspberry Pi 5 ecosystem. The HAT's ability to act as both a PTP client and a grandmaster, combined with GNSS support and a TCXO, makes it a unique offering in the world of precision timing hardware.
What This Enables
- Home Labs: Create a PTP client network for your home lab with ease.
- IoT Gateways: Build precise IoT gateways that require synchronized time across devices.
- Research and Development: Ideal for experimenting with PTP, GNSS, and timing protocols in various network configurations.
Whether you're building a precise timekeeping device or exploring the world of networked time protocols, the Raspberry Pi 5 PCIe HAT is your gateway to advanced timing applications. Designed to integrate seamlessly with the Raspberry Pi 5, this HAT empowers you to bring professional-grade timing and networking to your projects.
Usage Steps
Pre-setup steps
A. Install linuxptp
sudo apt install linuxptpB. Download testptp
cd ~ ; mkdir testptp; cd testptp
wget https://raw.githubusercontent.com/torvalds/linux/refs/heads/master/tools/testing/selftests/ptp/testptp.c
wget https://raw.githubusercontent.com/torvalds/linux/refs/heads/master/include/uapi/linux/ptp_clock.h
sudo cp ptp_clock.h /usr/include/linux/ptp_clock.hC. Compile testptp
gcc -Wall -lrt testptp.c -o testptpD. Install testptp
sudo cp testptp /usr/bin/E. Verify testptp works
sudo testptp -d /dev/ptp0 -lShould see:
pi@raspberrypi:~/testptp $ sudo testptp -d /dev/ptp0 -l
name SDP0 index 0 func 0 chan 0
name SDP1 index 1 func 0 chan 0
name SDP2 index 2 func 0 chan 0
name SDP3 index 3 func 0 chan 0Fix 1PPS input to only use rising edge, New Method, much easier
Procedure documented on Github: https://github.com/Time-Appliances-Project/TimeHAT
Configure 1PPS Output
1. Setup SDP0 (SMA1, closest to HAT header) as periodic output
sudo testptp -d /dev/ptp0 -L0,2
sudo testptp -d /dev/ptp0 -p 1000000000Read 1PPS SMA Input
A. Setup SDP1 (SMA2, furthest from HAT header) as timestamp input
sudo testptp -d /dev/ptp0 -L1,1B. Read timestamps
Use -1 to read forever and ctrl+C to stop, using 5 here as demo. Note: I226 driver passes both edges to Linux, so both rising and falling edges will be listed. A fix for this is listed below, requires patching and building kernel.
sudo testptp -d /dev/ptp0 -e 5Access GNSS UART
A. Enable UART, but not serial console for Raspberry Pi. Use raspi-config, 3. Interface Options -> I6 Serial port.
sudo raspi-configLogin shell -> No
Serial port hardware -> Yes
Finish
rebootB. Once rebooted, you'll need to link GNSS UART to a ttySX name for tools to use it
sudo ln -s /dev/ttyAMA0 /dev/ttyS10C. Simple serial check using tio, use ctrl+t q to quit
tio -b 38400 /dev/ttyS10Use gpsd / cgps to see GPS status
A. Install gpsd and cgps
sudo apt-get install gpsd gpsd-clientsB. Configure gpsd to point to /dev/ttyAMA0, the GNSS UART
sudo vim /etc/default/gpsdC. Add /dev/ttyAMA0 to GPSD_OPTIONS, and set baud rate
GPSD_OPTIONS="/dev/ttyAMA0 -s 38400"D. Enable gpsd on startup
sudo systemctl enable gpsdE. Start gpsd now
sudo systemctl start gpsdF. Use cgps to see the GPS status, use ctrl+c to exit
sudo cgpsUse pygpsclient to see GPS status (requires monitor)
A. Install pygpsclient
https://github.com/semuconsulting/PyGPSClient
python3 -m pip install --upgrade pygpsclientB. Once installed, run it with pygpsclient in terminal
pygpsclientC. Select /dev/ttyS10 as serial port, set baud rate as 38400, then click USB/UART button.
Automatic Discipline to GNSS module, including TOD
Procedure is documented at Github. After setting this up, the NIC PHC will be automatically updated by the GPS when available, and cgps can be used to monitor the GPS. This is my personal preference for setting up TimeHAT with GPS to discipline the NIC.
https://github.com/Time-Appliances-Project/TimeHAT
Manual Discipline to 1PPS from GNSS module
Note: To have this work properly, you'll need to install the PPS fix below
A. Install GPS and make sure it's locked properly. You should also see a blinking LED on the M.2 module if 1PPS is being generated.
B. Enable PPS input on GNSS -> I226 SDP2 pin
sudo testptp -d /dev/ptp0 -L 2,1C. Set NIC PHC based on system time to get Time-Of-Day
sudo phc_ctl eth1 "set;" adj 37D. Use ts2phc to discipline NIC from 1PPS
sudo ts2phc -c /dev/ptp0 -s generic --ts2phc.pin_index 2 -m -l 7