|
33 | 33 | * - :git-hdl:`library/common/up_adc_channel.v` |
34 | 34 | - Verilog source for the ADC Channel regmap. |
35 | 35 |
|
36 | | - |
37 | 36 | Architecture |
38 | 37 | -------------------------------------------------------------------------------- |
39 | 38 |
|
@@ -219,6 +218,51 @@ see :ref:`axi_adc adc-channel` section. |
219 | 218 | To find the instantiation of this module search for ``up_adc_channel`` inside |
220 | 219 | the IP's directory. |
221 | 220 |
|
| 221 | +Register access |
| 222 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 223 | + |
| 224 | +The ADC IP supports **16 channels**, numbered from **0 to 15**. The **base |
| 225 | +registers** start at offset ``0x0`` and the **common (global) registers** start |
| 226 | +at offset ``0x10``. Each **channel** has its own register block, starting from |
| 227 | +offset ``0x100`` (for channel 0). Each subsequent channel is spaced by ``0x10`` |
| 228 | +(HDL addressing) or ``0x40`` (WORD aligned). |
| 229 | + |
| 230 | +Let's say the ADC IP base address is 0x44A0_0000. Here is how the channel offset |
| 231 | +is computed: |
| 232 | + |
| 233 | +.. math:: |
| 234 | +
|
| 235 | + \text{Address}_{HDL} = 0x44A0\_0000 + 0x100 + (n \times 0x10) \\ |
| 236 | + \text{Address}_{WORD} = 0x44A0\_0000 + 0x400 + (n \times 0x40) |
| 237 | +
|
| 238 | +This means the first register's address ( **``CHAN_CNTRL``**) is: |
| 239 | + |
| 240 | +- For **channel 0**: |
| 241 | + - ``0x44A0_0100`` (HDL addressing) |
| 242 | + - ``0x44A0_0400`` (WORD aligned addressing) |
| 243 | +- For **channel 3**: |
| 244 | + - ``0x44A0_0140`` (HDL addressing) |
| 245 | + - ``0x44A0_0500`` (WORD aligned addressing) |
| 246 | +- For **channel 15**: |
| 247 | + - ``0x44A0_01F0`` (HDL addressing) |
| 248 | + - ``0x44A0_07C0`` (WORD aligned addressing) |
| 249 | + |
| 250 | +If you want to access the **``CHAN_CNTRL_3``** register, its address is: |
| 251 | + |
| 252 | +- For **channel 0**: |
| 253 | + - ``0x44A6_0106`` (HDL addressing) |
| 254 | + - ``0x44A6_0418`` (WORD aligned addressing) |
| 255 | +- For **channel 5**: |
| 256 | + - ``0x44A6_0156`` (HDL addressing) |
| 257 | + - ``0x44A6_0558`` (WORD aligned addressing) |
| 258 | + |
| 259 | +In general, the address for the ``CHAN_CNTRL_3`` register of **channel *n*** can be calculated as: |
| 260 | + |
| 261 | +.. math:: |
| 262 | +
|
| 263 | + \text{Address}_{HDL} = 0x44A6\_0000 + 0x100 + (n \times 0x10) + 0x06 \\ |
| 264 | + \text{Address}_{WORD} = 0x44A6\_0000 + 0x400 + (n \times 0x40) + 0x18 |
| 265 | +
|
222 | 266 | Typical Register Map base addresses |
223 | 267 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
224 | 268 |
|
|
0 commit comments