STM8S103 TIM1 Setup External Event Counter
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2017-12-29 5:08 PM
Posted on December 30, 2017 at 02:08
Hi,
Please, could someone help me to setup TIM1 to count pulses at rising edges? I try this code, but doesn't works.
TIM1_DeInit();
TIM1_TimeBaseInit(0, TIM1_COUNTERMODE_UP, 581, 0);
TIM1_ICInit(TIM1_CHANNEL_1, TIM1_ICPOLARITY_RISING, TIM1_ICSELECTION_DIRECTTI, TIM1_ICPSC_DIV1, 0x00);
TIM1_TIxExternalClockConfig (TIM1_TIXEXTERNALCLK1SOURCE_TI1ED, TIM1_ICPOLARITY_RISING, 0);
TIM1_ClearFlag(TIM1_FLAG_CC1 | TIM1_FLAG_UPDATE);
TIM1_Cmd(ENABLE);
This discussion is locked. Please start a new topic to ask your question.
0 REPLIES 0
