2006-05-01 08:54 PM
2006-04-27 11:16 PM
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 Ludovic2006-05-01 08:54 PM
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