Pull-up Configuration on STM8L151C6
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-02-28 12:31 AM
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
This discussion is locked. Please start a new topic to ask your question.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-02-28 3:57 AM
Posted on February 28, 2013 at 12:57
Got he problem, PC0 and PC1 does not have pull-ups.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-02-28 8:28 PM
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
