AnsweredAssumed Answered

STM8S103F3 PC4 problem

Question asked by n nemowski on May 14, 2018
Latest reply on May 17, 2018 by n nemowski

I am using cheap Chinese board with STM8103F3 chip.

I want to use PC4,PC5,PC6 and PC7 pins as inputs connected do keys.

With PC5-PC7 there is no problem. I configured them as pull-up input with interrupt, but PC4 is different.

If I set interrupt for this pin, my program hungs.

I unset interrupt and read GPIOC->IDR = 0xe8, which means that PC4 IDR bit is always 0.

I read also CLK->CCOR =0x00 and TIM1->CR1 =0x00 so TIM1 and output clock is disabled.

But earlier I use ADC1 with analog input 3 (port D2; ADC1->CSR|=0x03;)

I don't use analog input 2 which is alternate function for PC4.

I checked voltage on the pin = 3,29V (so pull-up works).

So how to force PC4 to work like other PC5-PC7 pins with working ADC1 on another channel?