Routing ADC -> DAC in sgtl5000

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Routing ADC -> DAC in sgtl5000

1,616 Views
peacefulatom
Contributor II

Hello.

I want to pass signal from Mic to Line_out. From datasheet I knew, this coult be done through internal audio switch.

Full path is looks like: MIC_IN->MUX->ADC->SSS->DAC->LINE_OUT.

In driver I do something like this:
write(SGTL5000_CHIP_ANA_CTRL, SGTL5000_ADC_SEL_MIC << SGTL5000_ADC_SEL_SHIFT);
write(SGTL5000_CHIP_SSS_CTRL, SGTL5000_DAC_SEL_ADC << SGTL5000_DAC_SEL_SHIFT);

But no signal present at the output.

P.S. I know Line In -> HP out works good.

Thank You for any advice.

5 Replies

1,272 Views
reyes
NXP TechSupport
NXP TechSupport

Hi,

I believe that the problem is that you are missing some steps in the route configuration, while it works fine in the LINEIN to HP route because the signal in this route can bypass the ADC, DAP and DAC processing.

 

The proper way to set the MIC_IN to LINE_OUT route is as follows:

 

// Example: MIC_IN -> ADC -> DAP(optional) -> DAC -> LINEOUT

 

// Route MIC_IN to ADC

Modify CHIP_ANA_CTRL->SELECT_ADC 0x0000 // bit 2

 

{

// Route ADC to DAP (OPTIONAL)

Modify CHIP_SSS_CTRL->DAP_SELECT 0x0000 // bits 7:6

// Route DAP to DAC

Modify CHIP_SSS_CTRL->DAC_SELECT 0x0003 // bits 5:4

}

//Or

{

// Route ADC to DAC

Modify CHIP_SSS_CTRL->DAC_SELECT 0x0000 // bits 5:4

}

 

// Route DAC to LINE_OUT

Modify CHIP_ANA_CTRL->SELECT_HP 0x0000 // bit 6

 

 

If you do not believe it is an audio signal routing problem, then make sure that the LINEOUT_POWERUP bit (bit 0 from Register CHIP_ANA_POWER) is properly set.


Have a great day,
Jose

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

1,272 Views
peacefulatom
Contributor II

Hi, Jose Alberto Reyes Morales.

Thank You a lot for reply! But I ask You to help me more, please.

I did route like: MIC_IN -> ADC -> DAC -> LINEOUT:

But this command You wrote seems to be wrong:

// Route DAC to LINE_OUT

Modify CHIP_ANA_CTRL->SELECT_HP 0x0000 // bit 6

It routes only DAC to HP_OUT, but I want to get it at LINEOUT.

Please, look at the Internal Block Diagram at Figure 2. in SGTL5000.pdf Datasheet.

According to this picture the signal goes from DAC without muxing through CHIP_LINE_OUT_VOL to LINEOUT. Mean write CHIP_ANA_CTRL->SELECT_HP 0x0000 is not needed.

So I did only the commands:

// Route MIC_IN to ADC

Modify CHIP_ANA_CTRL->SELECT_ADC 0x0000 // bit 2

// Route ADC to DAC

Modify CHIP_SSS_CTRL->DAC_SELECT 0x0000 // bits 5:4

But not signal at LINEOUT. The CHIP_LINE_OUT_VOL is ok.

My final goal is to route MIC_IN -> LINEOUT while route LINEIN -> HP_OUT  is working simultaniously, I do not see in datasheet that it is imposible, but I can't achieve it in practice. Please say If I did not understand it properly.

Thank You, and Best Regards,

Dmitry.

0 Kudos

1,272 Views
reyes
NXP TechSupport
NXP TechSupport

Hi Dmitry,

 

Route Command from DAC to LINE_OUT (Modify CHIP_ANA_CTRL->SELECT_HP 0x0000 // bit 6) is not wrong, with this command you select both HP and LINEOUT, but you need to check CHIP_LINE_OUT_VOL to control the Line Out Volume.

 

However, route MIC_IN -> LINEOUT while route LINEIN -> HP_OUT cannot working simultaneously, if you check Figure 2 of the datasheet, you will see that MIC_IN and LINE_IN goes into a Multiplexer, which prevents to make it works simultaneously.


Have a great day,
Jose

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,272 Views
peacefulatom
Contributor II

Hello, Jose

I'm sorry, but seems It is not explicitly shown that is cannot working. According to the Figure 2 MIC_IN and LINE_IN goes into a Multiplexer, which prevents to go only to the ADC simultaneously.

Signal from LINE_IN goes through the upper line on the Figure 2 to the HP mux which passes it to the HP_OUT (Red line). At this time ADC mux could select MIC_IN to go to the ADC, DAC and LINE_OUT (Blue line). But this route I could not obtain. To route MIC_IN to LINE_OUT I had to do some workaround reading it from i2s bus to processor and write back, this method works simultaneously with red route (Green line).

sgtl5000routes.png

Green route is feasible and it similar to blue route. But blue route is failed to configure by me.

Thank You for help, Jose, I stopped trying for now.

0 Kudos

1,272 Views
reyes
NXP TechSupport
NXP TechSupport

Hi Dmitry,

 

I just confirmed with the applications engineers that the system cannot accept LINE-IN and MIC simultaneously, even if LINE_IN bypassed to HP_OUT.


Have a great day,
Jose

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos