I just spent some time being confused by the DMA manual for the c5515 ("TMS320C5515/14/05/04 DSP Direct Memory Access (DMA) Controller", SPRUFT2).
In the section on the start address for I/O space (2.4.3) it states:
The CPU uses word addresses and the DMA uses byte addresses. The following steps describe how to program the DMA controller with a byte address for a peripheral memory-mapped register:
- Identify the correct DMA byte address for the peripheral memory-mapped register. The starting DMA byte addresses for the memory-mapped register space of the DSP peripherals are given in Table 1.
- Load the 16 least significant bits (LSBs) of the byte address into DMACHmSSAL (for source) or
DMACHmDSAL (for destination).- Load the 16 most significant bits (MSB) of the byte address into DMACHmSSAU (for source) or
DMACHmDSAU (for destination).
Since my source address was one of the I2S0 receive registers at 0x2828 I did the following:
- Subtract the "CPU Start Word Address (I/O Space)", 0x2800 for I2S0 to produce a word offset of 0x28.
- Multiply the word offset by 2 to get a byte offset of 0x50.
- Add the "DMA Start Byte Address", which is also 0x2800 to produce a DMA byte address for the register of 0x2850.
This didn't work. After some experimentation I found that simply programming the CPU address, 0x2828, into the DMA worked. Since the registers are 16 bits wide it seems that the DMA use word addressing for the I2S0 peripheral.
Is this just the I2S peripheral, or is it a general case? Or am I just being dim and misreading the instructions?