This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/MSP430F5359: Click and pop sound in audio hardware

Expert 1165 points
Part Number: MSP430F5359
Other Parts Discussed in Thread: LM4951A

Tool/software: Code Composer Studio

Hello, 

I'm using a audio PWM  for Voice output . For that i compressed the sound signal and stored it in the flash. The stored voice don't have any click and pop but the hardware is producing click and pop in audio. I using LM4951A in sound circuit with low pass filter as shown below. With the Rf=20ohm. what can i do to remove click and pop sound in hardware?

  • Hello Kary,
    if I understand your setup description correctly, you're generating a PWM signal using one of the 16bit Timers, to convert the stored audio data to the input signals for the audio power amp.
    If this is the case, one probable reason for the click and pop sounds might be the updates of the Timer PWM/CCR register values. The PWM is not safe versus CCR updates during active PWM. The compare logic might trigger on update, as it is continuously comparing the CCRx content versus the Timer value. As the write process has a certain latency and not all bits transition instantly and immediately without any delay, there might be wrong compare results, which of course results in errors of the generated PWM signal.
    A safe update sequence is more complex, than just writing into CCRx. You'd need to wait until e.g. overflow, freeze the PWM state by switching to mode 0, where the OUT bit is defining the PWM state, update the CCRx, and only after reactivate the PWM upon CCRx compare.

    Best regards,
    Peter
  • Below is my Timer B configuration for palyback:


    /* Setup Timer0_A for playback */ // Use SMCLK as Timer0_A source, enable overflow interrupt TBCTL = TBSSEL_2 + TBIE; // Set output resolution (8 bit. Add 10 counts of headroom for loading TBCCR1 TBCCR0 = 255; TBCCR4 = 255 >> 1; // Default output ~Vcc/2 // Reset OUT1 on EQU1, set on EQU0. Load TBCCR1 when TBR counts to 0. TBCCTL4 = OUTMOD_7 + CLLD_1; // Start Timer_B in UP mode (counts up to TBCCR0) TBCTL |= MC0; // Activate LPM during DMA playback, wake-up when finished __bis_SR_register(LPM0_bits + GIE); // Enable interrupts, enter LPM0 __no_operation(); // Power-down MSP430 modules TBCTL = 0; // Disable Timer_B PWM generation

  • when i use DAC12 there is still pop and click sound.
  • Hello Kary,
    I am not sure whether I understand your replies correctly.
    1. The code snippet on your timer related code: Does this mean, that even in case you just configure the Timer PWM for a stable value, you still hear clicks and pop sounds?
    If this is the case, then we need to dig further into the PWM signals. There must be a reason for the audible effects, means you must be able to detect it in the PWM signals with the scope. If you find those errors in the PWM signals, you should then try to figure out the origin of those. The PWM is generated automatically. As long as the settings for the timer are not changed and the clock source for the Timer is stable, there should be no change on the PWM. Thus check also the clock source.
    In your code example you're enabling also the Timer interrupt. What is the purpose? For the PWM generation the interrupts are not required.
    2. You stated in your following post, that even with the DAC you hear the click and pops. If this is really the case with a stable DAC setting, then there's something wrong with your code, as with the DAC, even if the clock for the DAC update would deviate, as long as the setting for DAC output level is the same, there should be no noise in the signal.

    But I would recommend solving one issue after another and not open multiple construction areas at the same time. So please perform the checks on the timer based PWM, as suggested above, and let me know your findings. Many thanks in advance.

    Best regards
    Peter
  • Hello Kary,
    could you please let me know the status on your side? Do you still need support on this, or have you been able to resolve it?

    Best regards
    Peter

**Attention** This is a public forum