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
8,600 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,219 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,039 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @dashdwan 

   Any updated information? Can you use my code and play music directly? If your MQS driver hardware works, you should can use my project directly! As I already use the same MQS pin as you.

Best Regards,

Kerry

0 Kudos
Reply
4,035 Views
dashdwan
Contributor III

Hi @kerryzhou 

I flashed this code to 0x60300000 address and tried it. But it did not work, I'm checking the PAM amplifier now, if it's some hardware issue. I'll update once it's done!

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

Hi @dashdwan 

  No, don't download to the 0X60300000, just download to the default 0X60000000, make the MQS works at first, it will help you to check your hardware.

Best Regards,

Kerry

0 Kudos
Reply
4,015 Views
dashdwan
Contributor III

Hi @kerryzhou 

Thanks a lot for sharing the code. I think it is working but we got some problem in the amplifier side.

Could you specify the following please?

  1. The power amplifier you are using
  2. How much volts of power supply you are using for this amplifier?

 

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

Hi @dashdwan 

   Thanks for your updated information.

   The code I share you works directly, so if you still can't hear muisc, it is related to your amplifier.

    Answer your issues:

  1. The power amplifier you are using

     As I share with you, I am using 74LVC244 chip as the driver, the detail data you can check the chip datasheet.

    2 How much volts of power supply you are using for this amplifier?

   You can see my previous reply, it is the 3.3V.

  Any new isssues, please create the new question post, and we will help you after the new year.

  From Jan. 1th to Jan. 3th is our New year holiday, so, any new question post, we will help you after back to work, thanks a lot for your understanding.

Wish it helps you!

Best Regards,

Kerry

0 Kudos
Reply
4,001 Views
dashdwan
Contributor III

Hi @kerryzhou 

Just one more query, is it possible to change the volume (amplitude) via MQS lines? If yes how to do that?

0 Kudos
Reply
3,909 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @dashdwan ,

  Happy New Year!

  Answer your question:

is it possible to change the volume (amplitude) via MQS lines? 

=>No, RT 10xx MQS IP can't change the volume, so you need to design the hardware MQS driver circuit which can support the volume change.

 

Wish it helps you!

If you have new questions, please create the new question post, thanks.

Best Regards,

Kerry

0 Kudos
Reply
3,902 Views
dashdwan
Contributor III

Hi @kerryzhou 

Happy New Year!

Thanks for your support. I was able to get the feable audio from MQS lines and I'll try redesigning the amplifier circuitry.

0 Kudos
Reply
3,894 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @dashdwan ,

  Glad to hear you have already made it works with MQS!

   If your question is solved, please help to mark the correct answer, just to close this case, any new issues in the future, welcome to create the new question post.

 

Best Regards,

Kerry

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

Hi @dashdwan 

  AN13208 mentioned macro USE_MQS is used the SLN-LOCAL2-RD SDK, not the SLN-LOCAL2-IOT SDK.

kerryzhou_0-1639724905375.png

 

So, please download the related SDK, then do the modification, that SDK can support the MQS.

https://mcuxpresso.nxp.com/en/builder?hw=SLN-LOCAL2-RD

 

Wish it helps you!

Best Regards,

Kerry

 

0 Kudos
Reply
4,230 Views
dashdwan
Contributor III

Hi @kerryzhou 

Thanks for the reply. I'll try with it.

Just for clarifying, the program should be flashed to 0x60300000 itself right?

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

Hi @dashdwan 

  The program flash address, you totally can define it in the project.

kerryzhou_0-1639726421176.png

You just need to check project this address.

 

Wish it helps you!

Best Regards,

Kerry

 

0 Kudos
Reply
4,213 Views
dashdwan
Contributor III

Hi @kerryzhou 

I just tried flashing the program to 0x60300000 and 0x60200000, but in both cases the board doesn't boot up properly.

Tags (1)
0 Kudos
Reply
4,207 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @dashdwan 

  I know why you can't boot.

  As the sln_local2_rd board is using the QSPI flash, not the hyperflash, you may donwload to the SLN-LOCAL2-IOT, it is not matched in the hardware.

   You can check the xip folder, you will find it is the QSPI code:

const flexspi_nor_config_t qspiflash_config = {
.memConfig =
{
.tag = FLEXSPI_CFG_BLK_TAG,
.version = FLEXSPI_CFG_BLK_VERSION,
.readSampleClksrc=kFlexSPIReadSampleClk_LoopbackFromDqsPad,
.csHoldTime = 3u,
.csSetupTime = 3u,
// Enable DDR mode, Wordaddassable, Safe configuration, Differential clock
.sflashPadType = kSerialFlash_4Pads,
.serialClkFreq = kFlexSpiSerialClk_133MHz,
.sflashA1Size = 16u * 1024u * 1024u,
.lookupTable =
{
// Read LUTs
FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB, RADDR_SDR, FLEXSPI_4PAD, 0x18),
FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 0x0A, READ_SDR, FLEXSPI_4PAD, 0x04),
},
},
.pageSize = 256u,
.sectorSize = 4u * 1024u,
.blockSize = 256u * 1024u,
.isUniformBlockSize = false,
};

 

Best Regards,

Kerry

0 Kudos
Reply
4,203 Views
dashdwan
Contributor III

Hi @kerryzhou 

So how is it possible for me to test this program on the SLN-LOCAL2-IOT board?

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

Hi @dashdwan 

  A lot of hardware difference, I don't think you can test it with SLN-LOCAL2-IOT, it needs to run in the SLN-LOCAL2-RD board.

  Which just provide the schematic:

https://www.nxp.com/webapp/Download?colCode=SLN-LOCAL2-RD_HW_Design_Files&appType=license&location=n...

https://www.nxp.com/webapp/Download?colCode=SLN-LOCAL2-RD-SCH&appType=license&location=null

 

Best Regards,

Kerry

0 Kudos
Reply
4,185 Views
dashdwan
Contributor III

Hi @kerryzhou 

I actually need to check whether I can get output from the amplifier connected via MQS pins in SL-LOCAL2-IOT board. Is there any option to check it?

 

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

Hi @dashdwan 

  In fact, I have the RT1060 MQS code, I think you can refer to the MQS code directly if you need it.

  If you still need to use the SLN-LOCAL2-RD code, I think you can try to change the XIP code from QSPI flash to the hyperflash code, then you should can download it.

The XIP hyperflash code you can find it from the original SLN-LOCAL2-IOT code package.

 

Best Regards,

kerry

0 Kudos
Reply
4,166 Views
dashdwan
Contributor III

Hi @kerryzhou 

Could you please share that RT1060 MQS code? 

I tried to change the XIP code from QSPI flash to the hyperflash code in SLN-RD project, but that also doesn't boot up. 

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

Hi @dashdwan 

MQS which works on the SDK can be found in the attachment.

About the boot issues, I think it should still related to the code, maybe you need to also to modify the SLN-LOCAL2-RD related bootstrap and bootloader project and download it, but as the hardware have a lot of difference, I think you may can't make it work directly.

 

Best Regards,

Kerry

 

0 Kudos
Reply