2012-05-17 06:16 AM
Hi guys,
I'm using STM8S207S6 44 pin microcontroller. I need to use TIMER 1Channel 1 in output compare mode with pin output enable but pin doesn't work. Iinitialize pin in output mode and TIMER 1 Channel 1 with ST driver library: -TIM1_TimeBaseInit(39,TIM1_COUNTERMODE_UP,0xFFFF,0);
----> Set TIMER 1 base time
-TIM1_Cmd(ENABLE);
----> TIMER 1 enable
During machine cycle: -TIM1_OC1Init(TIM1_OCMODE_TOGGLE, TIM1_OUTPUTSTATE_ENABLE,TIM1_OUTPUTNSTATE_DISABLE, (u16)(time),TIM1_OCPOLARITY_LOW,TIM1_OCNPOLARITY_HIGH, TIM1_OCIDLESTATE_SET, TIM1_OCNIDLESTATE_SET );
----> Set Togglemode
-TIM1_ITConfig(TIM1_IT_CC1, ENABLE);
----> Enable OC TIMER 1 channel 1interrupt.
OC interrupt works but pin out doesn't change. What is the problem?Can you help me? Note: I use this sequence in timer 3 channel 1 too and all works better.Thank you very much. #stm8s-output-compare