M-Link CSR v1.0
Standard set of board identification, status and control registers used with M-Link (PCI-Express or Ethernet) interface.
- 0x41a37c29 dig_csr variant
- 0x50b1d9c7 mlink_csr, tadc_csr variant
Register Map
address space 0x00 - 0x1F
Registers are 16 bit wide. 32-bit and 64-bit data is packed as following:
Reg # |
64-bit word |
0x70 |
bits 15:0 |
0x71 |
bits 31:16 |
0x72 |
bits 47:32 |
0x73 |
bits 63:48 |
Mandatory registers
Reg 0x00, 16 bit, CTRL, R/W
- [0] - softclear (clear statistics)
[11:1] - board specific
- [12] - disable 0xFEFE address decode
[14:13] - board specific
[15] - board specific (run enable)
Reg 0x02, 16 bit, DEVICE_ID, RO
[15:8] - Device ID
[7:0] - reserved
Reg 0x10~0x13, 1-Wire ID, 64 bits, RO
Reg 0x14 - 1-Wire Temperature, RO
Reg 0x15 - PCB Version, RO
- [15:8] - major version
- [7:0] - minor version
Reg 0x16, F/W Version, RO
- [15:8] major version number (binary)
- [7:0] minor version number (binary)
Reg 0x17, F/W Revision, RO
- [15:0] firmware revision number (binary)
Reg 0x1C~0x1F - Uptime, milliseconds, 64 bits, RO
mlink_csr, tadc_csr variant
Reg 0x00 - Control, R/W
- [0] - softclear
- [1] - counters lock - move from here !!!
- [15:2] - reserved
Reg 0x03 - [deprecated]] Live Magic, R/W
Reg 0x08~0x09 - Live Magic, 32 bits, R/W
dig_csr variant
Reg 0x00 - Control (RCTRL), R/W
- [0] - softclear
- [1] - counters lock
- [2] - stream reset
[14:3] - reserved
- [15] - run
Reg 0x01 - RLAT, R/W
Reg 0x02 - Device ID, status, RO
- [15:8] - Device ID
- [7:0] - status
Reg 0x03 - RTRIG, R/W
Reg 0x04 - ADC Info, R/O
Reg 0x06 - [deprecated] Serial ID MSB, RO
Reg 0x08 - Live Magic, R/W
Reg 0x0A - ADC channel memory depth, in kilosamples, RO
Reg 0x0B - [deprecated] 1-Wire Temperature, RO
Reg 0x0C - [deprecated] F/W Version, RO
Reg 0x0D - [deprecated] F/W Revision, RO
Reg 0x0E - [deprecated] Serial ID LSB, RO
Reg 0x0F - status_0f, RO
Temperature sensor reading (DS18B20)
Value in degrees Celsius is calculated by the code:
int rawTemp = regRead(REG_TEMPERATURE) & 0xFFF; if (rawTemp & 0x800) rawTemp = -(rawTemp&0x7FF); double temp = 0.0625 * rawTemp;