2013-12-16 10:53 PM
Hello,
I started a new design with the STM32F103ZE. I am trying to activate TIM1 with no success. I activated TIM4 and it works well. I am using PortA PA9 & PA10 as USART_TX & RX , is there any conflict with PA8 & PA11 -TIM1_CH1 & TIM1_CH4 ? Any suggestions ? Thanks2013-12-17 02:26 AM
Hi
You said you are trying to use timer 1. What are you trying to do with timer 1 (eg PWM)? ''I activated TIM4 and it works well.'' What was timer4 doing? ''is there any conflict with PA8 & PA11 -TIM1_CH1 & TIM1_CH4 ? '' No. To use the timer output, you have to select alternate function for that port bit. In addition, you have to select, enable and configure one of the timer 'OutputComp' (see the block diagram) Even though you are selecting Timer1, Timer1 can be used with 1 of 4 OCs BUT each OC can only be used for a single timer (refered to as the 'Channel' in TIM1_CHx) In addition, the outputs are tied to specific channels PA8 can only output channel 1 linked to Timer1 PA11 can only output channel 4 linked to Timer 1 Do not forget that the port bit must be configured correctly. (Long gone are the days when the DataSheets gave decent explanations, even in those days we still moaned how bad they were! LOL)2013-12-17 05:38 AM
Hi ,
Thanks for replying. I am aware of how the Timers work. I am using TIM4 as TIM_OCMode_PWM1. I tried the same configuration for TIM1 as TIM_OCMode_PWM1 and it doesn't work. I think I don't need to use it as AF , I tried it also .2013-12-17 06:10 AM
Hi
As I said, the timers have a limited number of OC (OutputCompare/Control) Make sure Timer1 is not using the same OC as timer 4. Make sure the output port bit is configured to alternate function and select the correct function. (The data sheet says that USART1 can be output on PA8 and PA11 but different parts of the USART PA8 is USART CK PA11 is USART CTS but you are looking for TIM1_CH1 or TIM1_CH4)