cancel
Showing results for 
Search instead for 
Did you mean: 

Why is '' TIM6 Update event occurs each TIM6CLK/256'' ?

Nature Shirled
Associate
Posted on February 26, 2017 at 02:47

Hello! This is a code of cubemx for f4 discovery board. Can anyone tell me why TIM6 Update event occurs each TIM6CLK/256 ? This timer is a trigger for DAC to generator wave . Thanks !!!!

0690X00000606MEQAY.png
3 REPLIES 3
Posted on February 26, 2017 at 03:24

I don't know, does the data table or sine wave have 256 entries?

The period is 2048 ticks of TIMCLK, that would be impacted by the APB clock

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on February 26, 2017 at 04:25

no.the data table has 6 value only. const uint8_t aEscalator8bit[6] = {0x0, 0x33, 0x66, 0x99, 0xCC, 0xFF};

I don't undertand 256 is meaning. I think that 0690X00000606O4QAI.png

and TIM6 Update event occurs each 0x7FF / TIM6CLK = 2048/ 84MHz. Is this true? Clive One! help me please.

S.Ma
Principal
Posted on February 26, 2017 at 09:57

My two cents here...

Set ADC with DMA cycling through 0x00, 0x1F (square wave with small amplitude due to slew rate) and look with a scope on the DAC output to see the sample true frequency. 

Prior to use non probing trigger signal, maybe using another timer with similar settings and outputing a pulse on a GPIO channel, then wire it to the DAC Trigger input pin and observe the periodicity. 

Last option, if the output sampling rate is 256 times too slow, change 0x7FF by 0x007? (blind patch)