MQS Example for RT1176

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

MQS Example for RT1176

Jump to solution
909 Views
TimTTP
Contributor II

Hi, are there any examples for using MQS with the RT1176? I have found an example on the forums for the RT106S which has provided a basis to work from, alongside the SAI DMA audio examples for the RT1170 EVK. However, integrating the MQS is proving difficult and the documentation is quite unclear on exactly how things need to be configured.

Thanks

0 Kudos
Reply
1 Solution
811 Views
TimTTP
Contributor II

Thanks for your help, Kerry. I was able to get this working during the week with some changes to update the MQS demo for the RT1060.

For anyone coming across this in the future, you can take the RT1170 SAI eDMA demo from the SDK and make the following changes:

// Change the SAI definitions to use SAI3
#define DEMO_SAI              SAI3
#define DEMO_SAI_CHANNEL      (0)
#define DEMO_SAI_IRQ          SAI3_TX_IRQn
#define DEMO_SAITxIRQHandler  SAI3_TX_IRQHandler
#define DEMO_SAI_TX_SOURCE kDmaRequestMuxSai3Tx
// Enable the SAI 3 Clock
void BOARD_EnableSaiMclkOutput(bool enable)
{
    if (enable)
    {
        IOMUXC_GPR->GPR2 |= IOMUXC_GPR_GPR2_SAI3_MCLK_DIR_MASK;
    }
    else
    {
        IOMUXC_GPR->GPR2 &= (~IOMUXC_GPR_GPR2_SAI3_MCLK_DIR_MASK);
    }
}
// Enable the MQS clock and set the registers before initiating DMA transfer
CLOCK_EnableClock(kCLOCK_Mqs);
IOMUXC_MQSEnterSoftwareReset(IOMUXC_GPR, true);
IOMUXC_MQSEnterSoftwareReset(IOMUXC_GPR, false);
IOMUXC_MQSEnable(IOMUXC_GPR, true);
IOMUXC_MQSConfig(IOMUXC_GPR, kIOMUXC_MqsPwmOverSampleRate64, 0u); 

Change the pin initialisation to activate the MQS left and right pin functions through IOMUXC and it *should* pretty much work.

Tim

View solution in original post

4 Replies
872 Views
TimTTP
Contributor II

Hi Kerry,

Thank you very much for your help. I understand the need to use the SAI3 module but have been having issues getting it working. I think some of the code in the sample file you have provided above are related to the RT1060 SDK as I am having errors when building it. I'll see if I can work them out.

Could you please confirm as well that only the MQS pins need to be configured as outputs? In our design we are using the SAI pins for other functions but in all of the audio examples I've seen the SAI pins are always configured as outputs.

Thanks,

Tim

0 Kudos
Reply
864 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @TimTTP ,

   If you choose the pin as the MQS pin, it is the output.

  You just need to configure the related to pin as the MQS function.

kerryzhou_0-1700534816709.png

to the SAI function, you also can configure it to the RX, not only TX.

kerryzhou_1-1700534910745.png

 

Maybe you mean the SAI data pin RX and TX share it together, to this situation, you don't need worry about it, if you configure the pin as the RX, then it will be input.

About the RT1170 MQS demo, you can try to migrate it based on the RT1170 SDK SAI demo, if you meet any issues about, just kindly let me know, as it is not difficult.

 

Wish it helps you!

Kerry

 

0 Kudos
Reply
812 Views
TimTTP
Contributor II

Thanks for your help, Kerry. I was able to get this working during the week with some changes to update the MQS demo for the RT1060.

For anyone coming across this in the future, you can take the RT1170 SAI eDMA demo from the SDK and make the following changes:

// Change the SAI definitions to use SAI3
#define DEMO_SAI              SAI3
#define DEMO_SAI_CHANNEL      (0)
#define DEMO_SAI_IRQ          SAI3_TX_IRQn
#define DEMO_SAITxIRQHandler  SAI3_TX_IRQHandler
#define DEMO_SAI_TX_SOURCE kDmaRequestMuxSai3Tx
// Enable the SAI 3 Clock
void BOARD_EnableSaiMclkOutput(bool enable)
{
    if (enable)
    {
        IOMUXC_GPR->GPR2 |= IOMUXC_GPR_GPR2_SAI3_MCLK_DIR_MASK;
    }
    else
    {
        IOMUXC_GPR->GPR2 &= (~IOMUXC_GPR_GPR2_SAI3_MCLK_DIR_MASK);
    }
}
// Enable the MQS clock and set the registers before initiating DMA transfer
CLOCK_EnableClock(kCLOCK_Mqs);
IOMUXC_MQSEnterSoftwareReset(IOMUXC_GPR, true);
IOMUXC_MQSEnterSoftwareReset(IOMUXC_GPR, false);
IOMUXC_MQSEnable(IOMUXC_GPR, true);
IOMUXC_MQSConfig(IOMUXC_GPR, kIOMUXC_MqsPwmOverSampleRate64, 0u); 

Change the pin initialisation to activate the MQS left and right pin functions through IOMUXC and it *should* pretty much work.

Tim

882 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @TimTTP ,

  Thank you for your interest in the NXP MIMXRT product, I would like to provide service for you.

  Your mentioned RT106S MQS demo is from my side, I create it.

  To the RT1170, the MQS situation is totally the same, still from SAI3, in fact, you can enable the SAI3, then enable the MQS related configuration, and you also need the external MQS driver circuit.

   The code, you still can refer to the RT106X, 

I attach the main code to your reference, you can try to add it to the RT1170 SAI code.

Please take easy, I think MQS is really very easy, as it is just based on the SAI3 module.

If you still have issues about it, just kindly let me know.

 

Best Regards,

kerry

 

0 Kudos
Reply