|
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,60 @@ 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 | +.. _generic-adc-register-access: |
| 222 | + |
| 223 | +Register access |
| 224 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 225 | + |
| 226 | +The ADC IP supports **16 channels**, numbered from **0 to 15**. The **base |
| 227 | +registers** start at offset ``0x0`` and the **common (global) registers** start |
| 228 | +at address ``0x10``. Each **channel** has its own register block, starting from |
| 229 | +address ``0x100`` (for channel 0). Each subsequent channel is spaced by ``0x10`` |
| 230 | +(HDL register address) or ``0x40`` (Software addressing). |
| 231 | + |
| 232 | +Let's say the ADC IP base address is 0x44A0_0000. Here is how the channel offset |
| 233 | +is computed: |
| 234 | + |
| 235 | +.. math:: |
| 236 | +
|
| 237 | + \text{HDL}_{reg} = 0x100 + (n \times 0x10) \\ |
| 238 | +
|
| 239 | +.. math:: |
| 240 | +
|
| 241 | + \text{Software}_{addr} = IP_BaseAddr + (\text{HDL}_{reg} << 2) = 0x44A0\_0000 + 0x400 + (n \times 0x40) |
| 242 | +
|
| 243 | +This means the first register's address ( **``CHAN_CNTRL``**) is: |
| 244 | + |
| 245 | +- For **channel 0**: |
| 246 | + |
| 247 | + - ``0x0100`` (HDL register)=> ``0x44A0_0400`` (Software addressing) |
| 248 | + |
| 249 | +- For **channel 3**: |
| 250 | + |
| 251 | + - ``0x0130`` (HDL register) => ``0x44A0_04C0`` (Software addressing) |
| 252 | +- For **channel 15**: |
| 253 | + |
| 254 | + - ``0x01F0`` (HDL register) => ``0x44A0_07C0`` (Software addressing) |
| 255 | + |
| 256 | +If you want to access the **``CHAN_CNTRL_3``** register, its address is: |
| 257 | + |
| 258 | +- For **channel 0**: |
| 259 | + |
| 260 | + - ``0x0106`` (HDL register) => ``0x44A6_0418`` (Software addressing) |
| 261 | + |
| 262 | +- For **channel 5**: |
| 263 | + |
| 264 | + - ``0x0156`` (HDL register) => ``0x44A6_0558`` (Software addressing) |
| 265 | +In general, the address for the ``CHAN_CNTRL_3`` register of **channel *n*** can be calculated as: |
| 266 | + |
| 267 | +.. math:: |
| 268 | + |
| 269 | + \text{HDL}_{reg} = 0x100 + (n \times 0x10) + 0x06 \\ |
| 270 | +
|
| 271 | +.. math:: |
| 272 | + |
| 273 | + \text{Software}_{addr} = IP_base_addr + 0x400 + (n \times 0x40) + 0x18 |
| 274 | +
|
222 | 275 | Typical Register Map base addresses |
223 | 276 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
224 | 277 |
|
|
0 commit comments