cancel
Showing results for 
Search instead for 
Did you mean: 

TIM1 and TIM on STR712

ludo98
Associate II
Posted on May 02, 2006 at 05:54

TIM1 and TIM on STR712

2 REPLIES 2
ludo98
Associate II
Posted on April 28, 2006 at 08:16

Hello, i have a question about the TIM1 and TIM2 of STR712.

i would like to produce a signal with the TIM1 and TIM2 configurated in PWMO mode.

I would like the signal of the ouput of the timer TIM pin.

10

+-----+

| |

| |_______________

<--------------------->

255

following my code:

for PWM0 (TIM1) :

GPIO_Config (GPIO1 , 1<<7, GPIO_AF_PP );

TIM_Init ( TIM1 );

TIM_PrescalerConfig ( TIM1,0x1 );

TIM_PWMOModeConfig ( TIM1, 10, TIM_LOW, 255, TIM_HIGH );

TIM_CounterConfig ( TIM1, TIM_START );

the signal is output is the following:

10

+-----+

| |

| |_______________

<--------------------->

255

for PWM1 (TIM2) :

GPIO_Config (GPIO0 , 1<<13, GPIO_AF_PP );

TIM_Init ( TIM2 );

TIM_PrescalerConfig ( TIM2,0x1 );

TIM_PWMOModeConfig ( TIM2, 10, TIM_LOW, 255, TIM_HIGH );

TIM_CounterConfig ( TIM2, TIM_START );

the signal is output is the following:

10

+-----+

| |

_______________| |

<--------------------->

255

the signals are reversed. My question is it's Normal?

Thanks

Ludovic

ludo98
Associate II
Posted on May 02, 2006 at 05:54

hello,

thanks for your answer. the problem has been resolved.: at the output of the TIM1 a component( transistor) inverse the signal. now i play an wav file with th TIM1 at 8Khz frequency but have a correct sound but it's a little metal. Have you some advice to reduce this phenomen ?

thanks

since regards

Ludovic