cancel
Showing results for 
Search instead for 
Did you mean: 

Pull-up Configuration on STM8L151C6

wynand
Associate II
Posted on February 28, 2013 at 09:31

Good day,

I configure PortB PB2, PB3 and PB4 as inputs, pull-up, no ext int. These pins work 100% no problem. I also configure PortC, PC0 and PC1 precisely the same as the above pins but the pull-ups is not connected. Can anybody tell me what to do to get the pull-ups activated. See my configuration code below.

#define ADDR_GPIO_PORT     GPIOB

#define ADDR1_GPIO_PIN  GPIO_Pin_2

#define ADDR2_GPIO_PIN  GPIO_Pin_3

#define ADDR3_GPIO_PIN  GPIO_Pin_4

#define ADDRn_GPIO_PORT     GPIOC

#define ADDR4_GPIO_PIN  GPIO_Pin_0

#define ADDR5_GPIO_PIN  GPIO_Pin_1

  GPIO_Init( ADDR_GPIO_PORT, ADDR1_GPIO_PIN, GPIO_Mode_In_PU_No_IT);

  GPIO_Init( ADDR_GPIO_PORT, ADDR2_GPIO_PIN, GPIO_Mode_In_PU_No_IT);

  GPIO_Init( ADDR_GPIO_PORT, ADDR3_GPIO_PIN, GPIO_Mode_In_PU_No_IT);

  GPIO_Init( ADDRn_GPIO_PORT, ADDR4_GPIO_PIN, GPIO_Mode_In_PU_No_IT);

  GPIO_Init( ADDRn_GPIO_PORT, ADDR5_GPIO_PIN, GPIO_Mode_In_PU_No_IT);

Kind regards

Wynand
2 REPLIES 2
wynand
Associate II
Posted on February 28, 2013 at 12:57

Got he problem, PC0 and PC1 does not have pull-ups.

np1
Associate II
Posted on March 01, 2013 at 05:28

Hi,

PC0, PC1 it support for I2C interface, so you can not pull up.

Read datasheet to clear what pin can do and can not do.

Thinh