ADC FMC board clock synchronization mechanism
The fmc-adc-100m14b4cha board is equipped with an on-board crystal oscillator from Silicon Labs. The Si570 crystal oscillator IC (datasheet) can be programmed via the I2C interface to provide frequencies in the range 10MHz - 1.4GHz. This crystal oscillator drives the clock pins of the ADC chip on-board the mezzanine cards. When using multiple ADC mezzanine cards in a large experimental facility, it may be necessary to make sure the measurements they provide are synchronized. This synchronization can be provided via White Rabbit (WR).
This page contans the specifications and implementation details of the mechanism used to synchronize multiple ADC mezzanine cards with a sub-nanosecond(ns) accuracy.
Functional specification
In order to synchronize two or more ADC mezzanine cards with sub-ns accuracy, the clock synchronization mechanism (CSM) should be perform as follows:
- It is assumed that the ADC FMCs are equipped with an Si570 pre-calibrated from factory to output a 100MHz frequency. Since the WR core offers a clock that is stable to within /-2 ppm, and the output frequency of the Si570 can be changed to within/-3500 ppm simply by changing the values of the RFREQ registers (see datasheet), it is enough to only change one or more of the RFREQ registers whenever the Si570 clock and the White Rabbit clocks are out of sync.
- Upon initialization (FPGA device reset), the CSM will read the RFREQ register of the Si570. This process is performed only once, upon device reset, and considering the previous specification, changes in frequency will from that moment on be made by adjusting the value of RFREQ.
- A dedicated I2C controller will be implemented in hardware to handle reading from and writing to the Si570.
- The CSM will be accessible externally via the Wishbone bus, offering control and status registers (CSRs) accessible to the user. The Wishbone bus in use is the auxiliary WR Wishbone bus. Therefore one will need to read/write through the WR core to access the device.
- In order to comply with the previous specification, the CSM will implement a simple Wishbone slave interface.
- A debug mode will be implemented, offering the user direct access to the Si570's registers via the I2C interface. When in debug mode, the Si570 registers will be controlled exclusively via the Wishbone interface. When not in debug mode, the Si570 registers will be controlled exclusively by the CSM.
- Since the WR core is capable of disciplining various external clocks via its internal software PLL, the clock from the Si570 will be input to the WR core and uses timing data from the WR core to adjust the RFREQ registers of the Si570.
- If WR is in sync with an uplink node or is the System Timing Master (thus providing the synchronization based on the high-precision reference clock), the CSM is enabled and tracks the Si570 clock against the WR clock continuously.
- If WR is not in synchronization with the uplink node, the CSM should be disabled.
- When the CSM is disabled or if the WR core is out of sync, the Si570 clock is left free-running, keeping the settings last written before the CSM was disabled.
Block diagram of the design
Register description
All registers shall be byte-sized registers (8 bits wide). An address map and details about the registers are given below.
Address map
Address offset | Register | Reset value | Description |
---|---|---|---|
0x0 | CSMCR | 0x00 | CSM Control Register |
0x4 | I2CCSR | 0x00 | CSM I2C Control and Status Register |
0x8 | I2CTXR | 0x00 | CSM I2C Transmitter Register |
0xC | I2CRXR | 0x00 | CSM I2C Receiver Register |
These registers are further detailed below.
CSMCR
Bit | Name | Description |
---|---|---|
7 | CSMEN | Enable/disable CSM operation (1 - enable / 0 - disable) |
6 | DBGEN | Enable/disable debug mode (1 - enable / 0 - disable) |
5..0 | - | Not implemented (write - 0, read - undefined) |
I2CCSR
Bit | Name | Description |
---|---|---|
7 | STA | When 1, generate a start or repeated start condition |
6 | STO | When 1, generate stop condition |
5 | RDWR | States whether the transfer is a read or a write (1 - read / 0 - write) |
4 | ACK | Controls whether an ACK or NACK should be sent when reading from Si570 (1- ACK / 0 - NACK) |
5..1 | - | Not implemented (write - 0, read - undefined) |
0 | TFD | Status: transfer done (1 - transfer complete / 0 - transfer in progress) |
I2CTXR
Bit | Name | Description |
---|---|---|
7..1 | TXB [7..1] | Address byte - the address of the Si570. Data byte - write data bits 7..1 |
0 | TXB [0] | Address byte - the type of transfer. Data byte - write data bit 0 |
I2CRXR
Bit | Name | Description |
---|---|---|
7..0 | RXB [7..0] | Received data bits 7..0 |