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.
I read through DA14681 Datasheet Rev. 2.1(15-July-2016) and have questions here:
1) Does DMA support both SRC channels?

from Page 95 of 460,
"20.1.1 I/O channels
The SRC block converts two 24 bits channels either as
a stereo pair or as two mono channels. The PCM linear
data pairs are received on SRC_IN and the output is
2x24 bits left aligned on 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.

from code "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,
from page 431 of 460, " Table 767: APU_MUX_REG (0x5000401C) ",
Bit Mode Symbol Description Reset
6 R/W PDM1_MUX_IN PDM1 input mux
0 = SRC1_MUX_IN
1 = PDM input

5:3 R/W PCM1_MUX_IN PCM1 input mux
0 = off
1 = SRC1 output
2 = PCM output registers

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) bit 2:0, set to 1 to route PCM output to SRC input?
but from page 95 of 460, "Figure 56:Sample rate Converter block diagram", it says routing PCM_IN1/PCM_IN2 to SRC_IN,

2) bit 5:3, set to 1 to route to SRC1 output, set to 2 to route to PCM output register,
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:
from "Table 44: Typical SRC use cases " fr Page 96
describled. And
how do I config APU_MUX_REG to route both channel PCM_IN1_DATA--> SRC_OUT1_REG, PCM_IN2_DATA--> SRC_OUT2_REG seperately?

Keywords:
Device:
MT_dialog
Offline
Last seen:2 months 2 weeks ago
工作人员
加入: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.

Regarding the second question:

1) Yes, bit 2:0 set to 1 will route the both of the channels of the PCM output directly to the 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
Thanks for the response. it is good to be confirmed that DMA support both SRC channels.
A few things may need further clarification:
1. Could you explain a bit more on your description:" two RX/TX pair and use only the RX"
and if I set DMA_REQ_MUX_REG (0x50003580) to 0x09, then It will route SRC_OUT1_REG to DMA channel 0, and SRC_OUT2_REG to DMA channel 1. ( and nothing related 'tx'), right?
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?
( in datasheet, Figure 56 says PCM_IN1[31‐8], PCM_IN2[31‐8], but in Table 767: APU_MUX_REG (0x5000401C), it says PCM output which may be related as 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?

Thanks,

Mingle Lu

MT_dialog
Offline
Last seen:2 months 2 weeks ago
工作人员
加入:2015-06-08 11:34
Hi mlu,

Hi mlu,

1. By means of "Two Rx/Tx pairs and use only the Rx", the following is meant:

  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.

For channel 0, the start address will be the one of SRC1_OUT1_REG and for channel 2, the start address will be the one of SRC1_OUT2_REG. By this way, you will have both channels 0 and 2 getting the same SRC request signal, and therefore you will be able to track the stereo samples. You don't need the "Tx" channels of the two pairs(1/3), so you should not switch them on (you don't even need to program their respective registers).

2. For this, you need only to configure one of the selected GPIOs to PCM_DI mode (input) and based on the PCM configuration, the incoming data should be placed into the PCM1_IN1_REG and PCM1_IN2_REG. These should be driven to SRC input mux by programming APU_MUX_REG.SRC_IN_MUX to 0x1 (selecting PCM output).

你不需要改变APU_MUX_REG。PCM1_MUX_IN, if you just want to get the SRC1_OUT1/2_REG output samples and store them to memory. You only need to do that if you again need to output the SRC output samples through the PCM again to another GPIO. Only in that case will you need to set APU_MUX_REG to 0x9. If you just want to store the SRC output samples to memory, APU_MUX_REG should be just set to 0x1.

Thanks MT_dialog