TICK SOUND COMES WHEN DISABLE TCC MODULE.

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Im playing some frequency between 15K to 20 K via TCC module. Whenever I disable the TCC after playing, the Tick sound comes at last.

 

I want to get rid of this tick sound..

 

Kindly help.

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A TCC on its own won't make any sound - so please describe how you are creating the sound.

 

Post your schematic (aka "circuit diagram") - see Tip #1 for instructions.

 

Please give a fuller description of what this "Tick sound" is ?

 

Do you have an oscilloscope to see what's happening?

If so, post a screenshot.

 

Perhaps post a minimal but complete code example which illustrates the issue. Again, see Tip #1 for instructions.

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Are you stopping at the zero crossover or mid-waveform?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Tick sound is same as saying tick.

 

Im generating some sound via speaker through TCC0.

 

below is the code 

 

 

void tcc_config_diff(int period)
{
    struct tcc_config config_tcc;
    
    tcc_get_config_defaults(&config_tcc,TCC0);
    config_tcc.compare.wave_generation=TCC_WAVE_GENERATION_SINGLE_SLOPE_PWM;
    config_tcc.compare.wave_ramp = TCC_RAMP_RAMP1;
    config_tcc.counter.reload_action=TCC_RELOAD_ACTION_RESYNC;
    config_tcc.counter.clock_source=TCC_PWM_USONIC_CLK;      
    config_tcc.counter.clock_prescaler= TCC_CLOCK_PRESCALER_DIV16;
    config_tcc.counter.period=period;
    config_tcc.compare.match[0]=period/2;
    config_tcc.pins.enable_wave_out_pin[TCC_MATCH_CAPTURE_CHANNEL_0]=true;
    config_tcc.pins.wave_out_pin[TCC_MATCH_CAPTURE_CHANNEL_0]=PIN_PA08E_TCC0_WO0;
    config_tcc.pins.wave_out_pin_mux[TCC_MATCH_CAPTURE_CHANNEL_0]=MUX_PA08E_TCC0_WO0;
    tcc_init(&tcc_instance_diff, TCC0, &config_tcc);
    tcc_enable(&tcc_instance_diff);
}

 

 

tcc_config_diff(1000);
    enable_speaker();

while(1)

{

for(I=0;i<100;i++)

{

            period= ((256*i)/10);
            tcc_set_top_value(&tcc_instance_diff,  period);
            tcc_set_compare_value(&tcc_instance_diff, 0, period/2);

             delay_ms(100);

}

tcc_disable(&&tcc_instance_diff);

disable_speaker();

 

When I do either tcc_disable or disable speaker the tick sound comes.

Also the frequency I'm generating is not stable and exact.

 

I want exact frequency with stability.

Kindly help to reach the goal.

 

Also please look into my DMA thread which is again big issue for me.