cancel
Showing results for 
Search instead for 
Did you mean: 

remap PD 0 and 1 - to GPIO inputs

john
Associate II
Posted on October 06, 2008 at 05:15

remap PD 0 and 1 - to GPIO inputs

4 REPLIES 4
john
Associate II
Posted on May 17, 2011 at 12:46

Update :-

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.

john
Associate II
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 ]

john
Associate II
Posted on May 17, 2011 at 12:46

FIXED :-

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

lior
Associate II
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.