remap PD 0 and 1 - to GPIO inputs
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2008-10-05 8:15 PM
Posted on October 06, 2008 at 05:15
remap PD 0 and 1 - to GPIO inputs
This discussion is locked. Please start a new topic to ask your question.
4 REPLIES 4
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 3:46 AM
Posted on May 17, 2011 at 12:46Update :- note, the order in which you do things is important ! This works (for me): RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOD, ENABLE); RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO, ENABLE); GPIO_PinRemapConfig(GPIO_Remap_PD01, ENABLE); GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU; GPIO_Init(GPIOD, &GPIO_InitStructure); John.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 3:46 AM
Posted on May 17, 2011 at 12:46
Hi,
I see there were some problems with the remap feature for PD0/PD1, but STone says it is fixed in the release silicon. I am trying to use PD0 and PD1 as GPIO, input, pull-up. It does not seam to work - they are always read as zero, even with nothing connected (and it is configured with the pull-up). Has anyone done this successfully, and can they let me see the code they used to do it ? Thanks. I currently have :- GPIO_PinRemapConfig(GPIO_Remap_PD01, ENABLE); RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOD, ENABLE); GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz; GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU; GPIO_Init(GPIOD, &GPIO_InitStructure); Thanks, John. [ This message was edited by: john.walsh on 01-10-2008 11:21 ]Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 3:46 AM
Posted on May 17, 2011 at 12:46FIXED :- I was missing: RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOD | RCC_APB2Periph_AFIO, ENABLE); ie. the AFIO enable. Yours, John. re: PD0 PD1 OSC_IN OSC_OUT remap
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 3:46 AM
Posted on May 17, 2011 at 12:46
which package of microcontroller do u use?
is this eval board? This is available only on 36-, 48- and 64-pin packages (PD0 and PD1 are available on 100-pin and 144-pin packages, no need for remapping). if it is ok then check the bit 15 in the register AFIO_MAPR.