Skip to the content
2 layers75 × 100 mmTimestamper, the printed circuit board in 3D

CPLD VHDL project for precise time stamping of events

Size
75 × 100 mm
Copper layers
2
Thickness
1.6 mm
Parts
115
Nets
116
Pads
417
Tracks, vias
757, 255
Pours
21
Routed
Yes
KiCad
KiCad 5 (file 20171130)
Created
27 Feb 2019
Updated
6 Apr 2019

Overview

Timestamper is an open-source printed circuit board by tomwimmenhove, from the tomwimmenhove/timestamper repository on GitHub, published under the GPL-3.0 licence. It is a 2-layer board of 75 × 100 mm with 115 parts on 116 nets, routed with 757 tracks and 255 vias.

It is built around the ATMEGA328-AU, CH340G and 74LVC1G14Z, with the 74HC04D, CDCE925PW and LMV7219M5 among its other parts. Its parts include 40 capacitors, 36 resistors, 12 ICs, 11 diodes and 7 connectors. It belongs with the AVR (ATmega, ATtiny) and FPGA and CPLD boards of this library.

Main components

10

README

README.md

The Timestamper

This project lets you get get exact timestamps of 'events' (electric pulses on an input).

TimeStamper image

Hardware

The hardware (schematic and PCB) are designed in KiCad 5, and can be found in the ./hardware/cpld/ directory. The 'heart' of the design is a Xilinx XC9572XL CPLD. This CPLD implements a capture-counter which timestamps the arrival of events with a resolution of 10ns. This CPLD is programmed in VHDL using Xilinx's ISE 14.7 (https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/design-tools/v2012_4---14_7.html).

The VHDL project resides in the ./hardware/cpld/ directory. The XC9572XL can be programmed using the xc3sprog (http://xc3sprog.sourceforge.net/) utility. Both the 'ft232h' (with a serial FT232H UART chip) and the 'sysfsgpio' (sysfsgpio on the Raspberry Pi) have been successfully used to program the chip.

Firmware

The firmware runs on an Atmel Atmega328p, which makes it compatible with the arduino. This way, using the default bootloader for, for example, the Arduino pro mini 3.3v @8Mhz, we can easily program the firmware using avrdude. The firmware simply reads the captured values from the CPLD and passes them on to a CH340G serial to USB UART. The firmware can be found in ./firmware/atmega328/

Software

The software just outputs the values from the device onto stdout. See ./software/

Theory of operation

The board is fed 3 signals:

  • A (very stable) 10MHz reference clock (I.E. from an OCXO or atomic rubidium reference)
  • A precise PPS signal, indicating the start of a UTC second. (I.E. from a GPS timing receiver)
  • An event signal that needs to be precisely timestamped.

The 10Mhz is fed into a PLL (A Texas Instruments CDCE925), and multiplied to 100MHz, which is then fed to the CPLD. Inside the CPLD, this clocks a 27-bit counter. This counter is (synchronously) reset on the rising edge of the PPS signal. The event signal is sampled at every clock pulse, and when a rising-edge is detected, the current count is stored inside into a register and the capture counter is 'disarmed'. The CPLD then notifies the Atmega328P through an interrupt which, in turn, reads the value from the CPLD, places it in a buffer, and instructs the CPLD te re-arm the capture logic. The capture value is then simply sent out of the USB UART to the PC. We now have the fractional part of the timestamp on the PC. This can be combined with the current time on the PC to form a complete timestamp. NOTE: This assumes that the time on the PC that is reading the timestamps is well within a 500ms tolerance.

Links and other stuff

See https://www.febo.com/pages/soekris/ for details on making an accurate NTP server. In addition, a Motorola m12+ GPS timing receiver together with a saw-tooth correction circuit is used to provide both a UTC time-source for the NTP server, as well as a PPS pulse for the Timestamper board. The Timestamper board also contains an 'auxiliary' output, which could be programmed to output a 33MHz clock that could be fed into the Soekris' motherboard to provide an even more accurate NTP time source (untested).

Parts

115
QtyValueFootprintReferences
26100nCapacitor_SMD:C_0603_1608MetricC1, C10, C11, C12, C13, C14, C16, C17, C18, C21, C22, C23, C24, C26, C27, C29 +10
7100Resistor_SMD:R_0603_1608MetricR5, R6, R7, R8, R9, R14, R17
6270Resistor_SMD:R_0603_1608MetricR22, R23, R24, R25, R26, R27
6330Resistor_SMD:R_0603_1608MetricR28, R29, R30, R31, R32, R33
6LEDLED_SMD:LED_0603_1608MetricD5, D6, D8, D9, D10, D11
510kResistor_SMD:R_0603_1608MetricR1, R10, R11, R18, R19
510nCapacitor_SMD:C_0603_1608MetricC9, C20, C25, C28, C32
422pCapacitor_SMD:C_0603_1608MetricC15, C19, C36, C37
4Conn_01x01MountingHole:MountingHole_3.2mm_M3_PadMH1, MH2, MH3, MH4
4Conn_CoaxialConnectors_Molex:Molex_SMA_Jack_Edge_MountJ1, J2, J3, J6
333Resistor_SMD:R_0603_1608MetricR12, R13, R15
351Resistor_SMD:R_0805_2012MetricR3, R4, R36
374LVC1G14Package_TO_SOT_SMD:SOT-353_SC-70-5U5, U6, U12
2220Resistor_SMD:R_0603_1608MetricR2, R16
22k2Resistor_SMD:R_0603_1608MetricR34, R35
2PESD5V2S2UTDiode_SMD:D_SOT-23_NKAD1, D4
10Resistor_SMD:R_0603_1608MetricR21
10Capacitor_SMD:C_0603_1608MetricC40
1100kResistor_SMD:R_0603_1608MetricR20
110uCapacitor_SMD:C_0603_1608MetricC2
112MHzCrystal:Crystal_HC49-4H_VerticalY1
11uCapacitor_SMD:C_0603_1608MetricC35
122uCapacitor_SMD:C_0805_2012MetricC7
15v6Diode_SMD:D_SMBD3
174HC04Package_SO:TSSOP-14_4.4x5mm_P0.65mmU11
18MHzCrystal:Crystal_HC49-4H_VerticalY2
1AP1117-33Package_TO_SOT_SMD:SOT-223-3_TabPin2U1
1ATMEGA328-AUPackage_QFP:TQFP-32_7x7mm_P0.8mmU10
1CCapacitor_SMD:C_0603_1608MetricC6
1CDCE925Package_SO:TSSOP-16_4.4x5mm_P0.65mmU3
1CH340GPackage_SO:SOIC-16_3.9x9.9mm_P1.27mmU8
1ISPConnector_IDC:IDC-Header_2x03_P2.54mm_VerticalJ5
1JTAGConnector_IDC:IDC-Header_2x05_P2.54mm_VerticalJ4
1LInductor_SMD:L_0603_1608MetricL1
1LMV7219?Package_TO_SOT_SMD:SOT-23-5U7
1PESD3V3S2UTDiode_SMD:D_SOT-23_NKAD7
1PESD5V0U2BTTVSDiode_SMD:D_0603_1608MetricD2
1Polyfuse_SmallResistor_SMD:R_1206_3216MetricF1
1TLV71318PDBVPackage_TO_SOT_SMD:SOT-23-5U2
1USBLC6-2SC6Package_TO_SOT_SMD:SOT-23-6U4
1USB_B_MicroConnector_USB:USB_Micro-B_Molex_47346-0001J7
1XC9572XL-VQ44Package_QFP:PQFP-44_10x10mm_P0.8mmU9

The 114 most common of 115 parts.

Similar boards

  • 4 layers149 × 95 mmMobo, the printed circuit board in 3D

    Mobo

    opulo-inc/lumenpnp

    The LumenPnP is an open source pick and place machine.

    399 parts3.7k
  • 2 layers180 × 160 mmIidx pico, the printed circuit board in 3D

    Iidx pico

    FireBite/iidx_pico_pcb_v2

    101 parts
  • 4 layers112 × 57 mmUniversalboxArm1-0, the printed circuit board in 3D

    UniversalboxArm1-0

    Solartraveler/UniversalboxArm

    PCB for experimenting with a STM32

    170 parts2
  • 4 layers150 × 120 mmKicad project, the printed circuit board in 3D

    Kicad project

    emlab-fi/cube_electronics

    Cube electronics - Main Board and Interface Board

    244 parts
  • 2 layers83.6 × 83.2 mmElectronix, the printed circuit board in 3D

    Electronix

    katp-hyphen/MICROMOUSE

    132 parts
  • 2 layers233.4 × 280 mmCft dfp, the printed circuit board in 3D

    Cft dfp

    alexiosc/cft

    The CFT homebrew minicomputer

    227 parts6GPL-3.0

Questions

How big is the Timestamper PCB?

It measures 75 × 100 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Timestamper use?

115 parts, built around the ATMEGA328-AU, CH340G, 74LVC1G14Z and 74HC04D. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Timestamper KiCad files?

From the tomwimmenhove/timestamper repository on GitHub, at the commit this page was made from: the board is hardware/pcb/timestamper.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.

Can I use the Timestamper design in my own project?

Its repository publishes it under the GPL-3.0 licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).