Using MQS for PAM8302A amplifier in SLN-LOCAL2-IOT

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

Using MQS for PAM8302A amplifier in SLN-LOCAL2-IOT

Jump to solution
9,327 Views
dashdwan
Contributor III

I'm trying to obtain the speaker out at PAM8302A amplifier from SLN-LOCAL2-IOT board via MQS lines. I searched for sample codes, but couldn't find any. 

I got some inputs from the AN13208 application note, but when i defined the macro USE_MQS, it returns few errors. One of the errors was a missing file named ringbuffer.h.

I'm really stucked right now and would like to have support from you guys. 

It would be more helpful if you could provide any sample codes too.

Thanks in advance.

0 Kudos
Reply
1 Solution
8,946 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi  @dashdwan,

   I have finished the MQS testing on the SLN-LOCAL2-IOT, please check my attached code, you can download it directly to your SLN-LOCAL2-IOT board, my MQS driver circuit is:

MQS hardware.jpg

 

I also use the same MQS pin as you:

[G14] GPIO_AD_B0_05 is used as MQS_LEFT and [F11] GPIO_AD_B0_04 is used as MQS_RIGHT.

SLN-LOCAL2-IOT MQSconnection.jpg

 

Please also check the video about my test result, you can hear the music clearly.

 

Wish it helps you!

Please test my code on your side directly, if your MQS driver circuit has no issues, then you will hear the music like me.

Any new issues, welcome to create the new question post.

Best Regards,

Kerry

View solution in original post

0 Kudos
Reply
31 Replies
4,870 Views
dashdwan
Contributor III

Hi @kerryzhou 

I tried integrating this same code with SLN-LOCAL2-IOT (including the missing files like ringbuffer.h) but so many errors are popping up.

Is there any way out so that i check the MQS lines in this?

0 Kudos
Reply
4,849 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @dashdwan 

   The MQS code I share with you is based on the RT1060 SDK code, and I have tested it on the MIMXRT1060-EVK board, the MQS works OK.

  So, you can consider it use the SAI3 as the MQS interface.

  Wish it helps you!

Best Regards,

Kerry

0 Kudos
Reply
4,840 Views
dashdwan
Contributor III

Hi @kerryzhou 

Can you please help me to integrate this code to the SLN-LOCAL2-IOT SDK?

0 Kudos
Reply
4,762 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @dashdwan 

   As the SLN_LOCAL2_IOT board don't have the MQS hardware circuit, how do you test it?

  Today, I also help you to check with our solution team, they recommend you design a SLN-LOCAL2-RD board, then you can test the SLN-LOCAL2-RD SDK about teh MQS directly.

  About the SLN-LOCAL2_IOT, 1. board can't support the MQS directly. 2. code you need to integrate it by yourself. I already share you my MQS driver code, that works OK on the MIMXRT1060-EVK + MQS driver cirucuit.

 

Best Regards,

Kerry

0 Kudos
Reply
4,736 Views
dashdwan
Contributor III

Hi @kerryzhou 

I have connected an external circuit to the MQS pins which is then connected to the amplifier.

I tried porting the code you send to mine, now when i probed the MQS pins, i'm getting a 50% duty cycle square wave (seems like a clock). I checked the GPR2 registers, it's also as expected.

Why the data is not getting received at these pins? Can you please help me?

 

0 Kudos
Reply
4,719 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @dashdwan 

MQS (medium quality speaker) is used to convert the I2S audio data from SAI to PWM
signals that can drive external speaker directly. Its audio source comes from SAI-3 and its
output is connected to pads through IOMUX.

   So, if you already get the PWM wave, it means your MQS already works.

   You can input the a music data, then add the amplifer and the speaker, then you will hear it.

kerryzhou_0-1640310172268.png

Attached .mp4 is my previous test result.

You can check it, if you still have issues about it, you can give me your photo about your MQS connection, then I will help you to check it.

Best Regards,

Kerry

0 Kudos
Reply
4,653 Views
dashdwan
Contributor III

Hi @kerryzhou 

Sorry for the delayed response. 

I think there would be already some audio output from the SLN board (like "LED Demo","Okay"), right? But there's no change in the PWM signal received (50% duty cycle). I even tried connecting this to amplifier circuit, but can't hear a thing!

Should we configure the SAI3 lines somehow?

0 Kudos
Reply
4,638 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @dashdwan 

   I will migrate one MQS example based on the RT1060, after test it, I will let you know the result.

  Please keep patient.

 

Best Regards,

Kerry

0 Kudos
Reply
4,628 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @dashdwan 

  Please give me a photo about your SLN-LOCAL2-IOT connect to the MQS amplify circuit picture.

Best Regards,

Kerry

0 Kudos
Reply
4,662 Views
dashdwan
Contributor III

Hi @kerryzhou 

I have connected PAM8013 amplifier in this circuit. 

[G14] GPIO_AD_B0_05 is used as MQS_LEFT and [F11] GPIO_AD_B0_04 is used as MQS_RIGHT.

0 Kudos
Reply
8,947 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi  @dashdwan,

   I have finished the MQS testing on the SLN-LOCAL2-IOT, please check my attached code, you can download it directly to your SLN-LOCAL2-IOT board, my MQS driver circuit is:

MQS hardware.jpg

 

I also use the same MQS pin as you:

[G14] GPIO_AD_B0_05 is used as MQS_LEFT and [F11] GPIO_AD_B0_04 is used as MQS_RIGHT.

SLN-LOCAL2-IOT MQSconnection.jpg

 

Please also check the video about my test result, you can hear the music clearly.

 

Wish it helps you!

Please test my code on your side directly, if your MQS driver circuit has no issues, then you will hear the music like me.

Any new issues, welcome to create the new question post.

Best Regards,

Kerry

0 Kudos
Reply