AnsweredAssumed Answered

Pull-up Configuration on STM8L151C6

Question asked by weyers.wynand on Feb 28, 2013
Latest reply on Mar 1, 2013 by nguyen_phu.thinh.001
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

Outcomes