title: STM32 Rotary Encoder config
body: <p>I am trying to use timer 8 in Encoder mode and my setup is as follows.
  Pins PC8 and PC9 (timer8) are connected to a cheap 3 terminal encoder that has C pin grounded so pullups are activated on these pins.</p>
  
  <pre><code>TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure;
  GPIO_InitTypeDef GPIO_InitStructure;
  RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOC, ENABLE);
  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8 | GPIO_Pin_9;
  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
  GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
  GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
  GPIO_Init(GPIOC, &amp;GPIO_InitStructure);
  RCC_APB2PeriphClockCmd(RCC_APB2Periph_TIM8, ENABLE);
  TIM_TimeBaseStructure.TIM_Period = 0x0FFF;
  TIM_TimeBaseStructure.TIM_Prescaler = 0;
  TIM_TimeBaseStructure.TIM_ClockDivision = 0;
  TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;
  TIM_EncoderInterfaceConfig(TIM8,TIM_EncoderMode_TI1,TIM_ICPolarity_Falling,
  TIM_ICPolarity_Falling);
  TIM_TimeBaseInit(TIM8, &amp;TIM_TimeBaseStructure);
  TIM_Cmd(TIM8, ENABLE);
  </code></pre>
  
  <p>I then read the counter with <code>temp=TIM_GetCounter(TIM8);</code></p>
  
  <p>I have tried all the possible modes and falling/rising combos I can and am getting nothing.
  Does the Timer channel have any effect. It is using channels 3 and 4</p>