How do i increase the volume of the speaker amplifier from LPC1769.

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

How do i increase the volume of the speaker amplifier from LPC1769.

762 Views
jameshoho
Contributor I

Need help please. I need some starting guide with the config. i know we need to configure the port0 pin 28. But I cannot figure out the register to set. And also how to adjust the volume.

0 Kudos
Reply
2 Replies

646 Views
jameshoho
Contributor I

Hi Kerry,

Thanks for the reply!

But according to the datasheet as shown below it says that i do not need a application. But i need to generate clock into P0.27.

pastedImage_2.png

As shown below i need to set the P0.28 as user input to control the volume . And i need to set P0.27 to GPIO function and to generate a constant clock pulse into it.

pastedImage_4.png

I had try to generate a clock pulse into P0.27 but when i do a pin read of the pin i keep getting a 1 which is high.

I do not get it why it is always showing me a 1.

MY CODE 

CURRENT_TIME = getTicks();

      if (RESET_INITIAL)

      {

            RESET_INITIAL = 0;

            INITIAL_TIME = CURRENT_TIME;

      }

       if (CURRENT_TIME - INITIAL_TIME >=1000)

     {

         high = ! high;

            if(high==1)

              {

                   FIO_SetValue(0, 1<<27);

                  printf("High %d\n",((GPIO_ReadValue(0)>>28) & 0x00));

               }   

          if(high==0)

              {

                   FIO_ClearValue(0, 1<<27);

                  printf("Low %d\n",((GPIO_ReadValue(0)>>28) & 0x00));

               }   

       RESET_INITIAL = 1;

}

I had set P0.27 as GPIO output port.

Please kindly advice.

Thanks

0 Kudos
Reply

646 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi James Ho,

    If you want to control and increase the volume of the speaker, just software configuration is not enough, you still need to combine with the hardware.

   Now, take MCB1769 as an example, the hardware you can design it like this:

pastedImage_1.png

  About the software control, enable the internal pull up, then just need to control the P0[28] GPIO function.

  About the GPIO configuration, you can refer to the LPC1769 code, there has a example for your reference:

int main (void)
{                
  uint32_t i, j;

  /* SystemClockUpdate() updates the SystemFrequency variable */
  SystemClockUpdate();

  LPC_GPIO2->FIODIR = 0x000000FF;        /* P2.xx defined as Outputs */
  LPC_GPIO2->FIOCLR = 0x000000FF;        /* turn off all the LEDs */

  while(1)
  {
    for(i = 0; i < 8; i++)
    {
      LPC_GPIO2->FIOSET = 1 << i;
      for(j = 1000000; j > 0; j--);
    }
    LPC_GPIO2->FIOCLR = 0x000000FF;
    for(j = 1000000; j > 0; j--);
  }
}

You just need to modify it to P0[28].


Have a great day,
Kerry

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

0 Kudos
Reply