cancel
Showing results for 
Search instead for 
Did you mean: 

problem with pin configuration in STM8L-Discovery (broken pin?)

giu
Associate II
Posted on November 16, 2011 at 11:27

I configured the PC4 and PC7 ports both as inputs:

GPIO_Init(GPIOC, GPIO_Pin_7, GPIO_Mode_In_FL_No_IT);

GPIO_Init(GPIOC, GPIO_Pin_4, GPIO_Mode_In_FL_No_IT);

I would like to use these two pins with the ADC (channel 3 and 4 respectively) showing the voltage value on the on-board LCD. If I setup a program to do this with PC7 all behaves normally. If I do the same for PC4 when I apply a (constant) signal (say 0 V) the LCD goes mad and the program appears to reset.

Checking with a scope PC4 is stuck to 3 V while PC7 is at 0 V, both with the same configuration written before.

Could PC4 pin be somewhat broken or am I doing something wrong?

EDIT

Example:

void main(void)

{

GPIO_Init(GPIOC, GPIO_Pin_4, GPIO_Mode_In_FL_No_IT);;

 //Green light on

GPIO_Init( GPIOE, GPIO_Pin_7, GPIO_Mode_Out_PP_High_Fast);

    

/* Set System Clock divider to 1 */

CLK->CKDIVR = 0x00;

}

This code just turn the on-board green led ON. When I try to apply 0 V to PC4 the led starts blinking... I think it is a hardware failure
0 REPLIES 0