Does DMA serve both SRC channels

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
4 posts / 0 new
Last post
MLU.
Offline
Last seen:1 year 4 months ago
加入:2017-02-14 04:30
Does DMA serve both SRC channels

I am working on the APU driver code for DA14681/SDK1.0.8 since SDK1.0.8 doesn't have the related code ready yet.
My target is to route both PMC/I2S channels:PCM1_IN1[31-8], PCM1_IN2[31-8] to both SRC channels SRC_IN1,
SRC_IN2, and then through SRC hardware output to both SRC output channels:SRC_OUT1_REG[]/SRC_OUT2_REG[],
and then route both SRC output channels:SRC_OUT1_REG[]/SRC_OUT2_REG[] to DMA channels.
我通过DA14681数据表Rev.2.1(2016年7月15日)阅读,并在这里有疑问:
1)DMA是否支持SRC频道?

从460的第95页,
"20.1.1 I/O channels
SRC块将两个24位通道转换为
a stereo pair or as two mono channels. The PCM linear
data pairs are received on SRC_IN and the output is
2x24位在src_out左对齐“,
which says SRC support two channels; and from "Figure 56: Sample rate Converter block diagram", we have both channel registers:
PCM_IN1[], PCM_IN2[]/ SRC_IN1_REG[], SRC_IN2_REG[] /SRC_OUT1_REG,SRC_OUT2_REG

from Page 74 of 460, "Table 29: DMA served peripherals", it says the served peripheral includes PCM RX/TX, SRC RX/TX, but it
doesn't explicitly say Both PCM,SRC channels.

and from Page 426 of 460, "Table 756: DMA_REQ_MUX_REG (0x50003580)", it seems that only one DMA channel for SRC_TX,
so I wonder how to feed both SRC channels into one DMA channel, or it only support one SRC channel map to one DMA channel at one time.

从代码“hw_dma.h”
typedef enum {
HW_DMA_TRIG_SPI_RXTX = 0x0,
hw_dma_trig_spi2_rxtx = 0x1,
HW_DMA_TRIG_UART_RXTX = 0x2,
HW_DMA_TRIG_UART2_RXTX = 0x3,
HW_DMA_TRIG_I2C_RXTX = 0x4,
HW_DMA_TRIG_I2C2_RXTX = 0x5,
hw_dma_trig_usb_rxtx = 0x6,
HW_DMA_TRIG_I2S_LEFTRIGHT = 0x8,
HW_DMA_TRIG_PDM_LEFTRIGHT = 0 x9,
HW_DMA_TRIG_FTDF_RXTX = 0xA,
hw_dma_trig_ecc_rxtx = 0xb,
hw_dma_trig_adc = 0xc,
hw_dma_trig_none = 0xf.
hw_dma_trig;

I2S_LEFTRIGHT, PDM_LEFTRIGHT indicates both channels, but don't know how to feed both channels into one DMA channel, and does the PDM represent
SRC as well? or only means PDM?

2) A related question, since PCM and SRC has two channels as describled above,
从460的第431页,“表767:APU_MUX_REG(0x5000401C)”,
Bit Mode Symbol Description Reset
6 R / W PDM1_MUX_IN PDM1输入MUX
0 = src1_mux_in.
1 = PDM输入

5:3 R/W PCM1_MUX_IN PCM1 input mux
0 = off
1 = SRC1 output
2 = PCM输出寄存器

2:0 R/W SRC1_MUX_IN SRC1 input mux
0 = off
1 = PCM output
2 = SRC1 input registers
This table is confusing to me,
1)位2:0,设置为1以将PCM输出路由到SRC输入?
but from page 95 of 460, "Figure 56:Sample rate Converter block diagram", it says routing PCM_IN1/PCM_IN2 to SRC_IN,

2)位5:3,设置为1到SRC1输出的路由,设置为2到PCM输出寄存器的路由,
again, from page 95 of 460, "Figure 56:Sample rate Converter block diagram", it says routing SRC_OUT1 to SRC_OUT1_REG or to PCM_OUT

if my description is confusing as well, in other way, I want to implement the scenario of PCM_IN to USB:
来自“表44:典型的SRC用例”FR Page 96
describled. And
如何配置APU_MUX_REG将通道PCM_IN1_DATA - > SRC_OUT1_REG,PCM_IN2_DATA - > SRC_OUT2_REG分开?

关键词:
设备:
MT_dialog
Offline
Last seen:2个月2周前
工作人员
加入:2015-06-08 11:34
Hi mlu,

Hi mlu,

Yes, the DMA supports both of the SRC channels (its one module that supports 2 channels, that's why the datasheet indicates just one SRC in the DMA section), but since there is no implementation from the SDK side there are no proper enums for this, you will have to assign both of the SRC outputs, SRC_OUT1 and SRC_OUT2 to a different channel of the DMA, two different channel, two RX/TX pair and use only the RX.

关于第二个问题:

1)是,设置为1的位2:0将直接将PCM输出的两个通道直接路由到SRC。

2) The SRC outputs can be directly routed to the PCM or the output can be obtained via the SRC_OUT1_REG or the SRC_OUT2_REG.

3) In order to route both output channels of the PCM through the SRC to the DMA the APU_MUX_REG you should configure bits 2:0 SRC1_MUX_IN to 1=PCM output (this will configure the output of the PCM to be used as input in the SRC).

Thanks MT_dialog

MLU.
Offline
Last seen:1 year 4 months ago
加入:2017-02-14 04:30
Hi

Hi
谢谢你的回应。可以确认DMA支持SRC频道。
A few things may need further clarification:
1.你能在你的描述中解释一下:“两个rx / tx对并仅使用rx”
如果我将DMA_REQ_MUX_REG(0x50003580)设置为0x09,则它将将SRC_OUT1_REG向DMA通道0路由到DMA通道0,以及SRC_OUT2_REG到DMA通道1.(没有任何相关的“TX”),对右?
2. regarding second question, I may not understand correctly: Does you description of "PCM output directly to SRC" means SRC get input from PCM_DATA_IN pin/gpio?
(在数据表中,图56表示PCM_IN1 [31-8],PCM_IN2 [31-8],但在表767:APU_MUX_REG(0x5000401C)中,它表示PCM输出,可以与PCM_DATA_OUT PIN / GPIO相关)

2》if I set APU_MUX_REG (0x5000401C) to 0x09, ( 00001001b), I should be able to get SRC input from PCM_DATA_IN pin and SRC output to SRC_OUT1_REG/SRC_OUT2_REG, right?

谢谢,

Mingle Lu

MT_dialog
Offline
Last seen:2个月2周前
工作人员
加入:2015-06-08 11:34
Hi mlu,

Hi mlu,

1.通过“两个RX / TX对并仅使用RX”,以下是:

  1. You need to program the DMA_REQ_MUX_REG.DMA01_SEL to 0x9 (SRC) and do the same for DMA23_SEL (provided that you will pick the channel pairs 0/1,2/3)
  2. Then, you will need to switch-on only the "Rx" channels(by setting the 'DMA_ON' bit-field of DMAx_CTRL_REG), which means the channels 0 (for pair 0/1) and 2 (for pair 2/3), after having programmed the required registers of these channels respectively.

对于通道0,启动地址将是SRC1_OUT1_REG和通道2之一,起始地址将是SRC1_OUT2_REG之一。通过这种方式,您将拥有两个通道0和2获得相同的SRC请求信号,因此您将能够跟踪立体声样本。您不需要两对(1/3)的“TX”通道,因此您不应该打开它们(甚至不需要编程其各自的寄存器)。

2.为此,您只需要将其中一个选定的GPIO配置为PCM_DI模式(输入),并基于PCM配置,输入数据应放在PCM1_IN1_REG和PCM1_IN2_REG中。这些应该通过编程apu_mux_reg.src_in_mux来驱动到src输入mux到0x1(选择PCM输出)。

如果您只想获取SRC1_OUT1 / 2_REG输出样本并将其存储到内存,则无需更改APU_MUX_REG.PCM1_MUX_IN。如果您再次需要将SRC输出样本再次输出到另一个GPIO,则只需要将SRC输出样本输出。仅在这种情况下,您需要将APU_MUX_REG设置为0x9。如果您只想将SRC输出样本存储到内存中,APU_MUX_REG应只是设置为0x1。

Thanks MT_dialog