cancel
Showing results for 
Search instead for 
Did you mean: 

Issues with Port E - STM32F3DISCOVERY

airanzo
Associate II
Posted on October 28, 2016 at 14:57

Hi,

I�m not allowed to configure some port E pins.

   RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOE, ENABLE);

   GPIO_InitTypeDef   GPIO_InitStructure;

   GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2 | GPIO_Pin_3 | GPIO_Pin_4| GPIO_Pin_5;

   GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;

   GPIO_InitStructure.GPIO_Speed = GPIO_Speed_10MHz;

   GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;

   GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;

   GPIO_Init(GPIOE, &GPIO_InitStructure);

   

   GPIOE->ODR |= GPIO_ODR_2;

   GPIOE->ODR |= GPIO_ODR_3;

   GPIOE->ODR |= GPIO_ODR_4;

   GPIOE->ODR |= GPIO_ODR_5;

- Pins 2 and 3 are configured to Output in the Moder register and set in the ODR (led turn on, everything�s right)

- Pins 4 and 5 are configured to Output in the Moder register and set in the ODR. BUT they are also set in the IDR!! (led doesnt light).

I know PE4 and PE5 are connected to the LSM303DLHC accelerometer in the discovery, might this be the problem ? What have i do to make available PE4 and PE5 ?

regards,

#stm32f3discovery
3 REPLIES 3
Posted on October 28, 2016 at 17:57

..might this be the problem ?

Would depend if the other chip is attempting to drive them also, review the schematic and data sheets,

What have i do to make available PE4 and PE5 ?

Remove the other chip or cut the traces? Check for solder bridges as they relate to those pins if applicable.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
airanzo
Associate II
Posted on October 28, 2016 at 18:49

Hello clive

Thanks for your reply. Do you think the accelerometer could drive the pins even if there´s not a line for it in code ?

i copy my program (it´s just to try to find out what´s happening in the port E)

int main(void)

{

   RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOE, ENABLE);

   GPIO_InitTypeDef   GPIO_InitStructure;

   GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2 | GPIO_Pin_3 | GPIO_Pin_4| GPIO_Pin_5;

   GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;

   GPIO_InitStructure.GPIO_Speed = GPIO_Speed_10MHz;

   GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;

   GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;

   GPIO_Init(GPIOE, &GPIO_InitStructure);

   

   GPIOE->ODR |= GPIO_ODR_2;

   GPIOE->ODR |= GPIO_ODR_3;

   GPIOE->ODR |= GPIO_ODR_4;

   GPIOE->ODR |= GPIO_ODR_5;

}

I´m using the Discovery like shipped, no soldering has been done. I need to use these pins because they 5V tolerant, for a ultrasonic sensor

Posted on October 28, 2016 at 21:07

Do you think the accelerometer could drive the pins even if there´s not a line for it in code ?

It is an autonomous chip, your lack of action on the STM32 side might well be irrelevant. You should review the data sheet of the accelerometer to understand what it's reset defaults are. Look to be interrupt outputs, which would potential clash with your use.

Determine if the traces run through the part. Looks to me like they run to the header and then to the accelerometer so would be cuttable on the top side of the board. Check for yourself.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..