Skip to main content
Bogdan
Senior
June 4, 2018
Question

GPIO strange behaviour STM32F427

  • June 4, 2018
  • 1 reply
  • 578 views
Posted on June 04, 2018 at 19:39

Hello,

i have a simple code where i just init some GPIO ports on a STM32F427VI  ( 100pin package).

The application controls via pin PA8 some transistor which switches on/off a relay after some delay...

I have noticed  if i configure PE2,  then PA8 does not work ( does not switch to HI).

If i comment out the red code shown bellow,  then PA8 works fine. Why is this? I have never encounter such problems with stm devices.

int main()

{

SystemInit();

GPIO_InitTypeDef GPIO_InitStruct;

RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOC| RCC_AHB1Periph_GPIOD | RCC_AHB1Periph_GPIOB |RCC_AHB1Periph_GPIOE, ENABLE);// GPIOA & GPIOB clock enable

GPIO_InitStruct.GPIO_Pin = GPIO_Pin_3 | GPIO_Pin_8;

GPIO_InitStruct.GPIO_Mode = GPIO_Mode_OUT;

GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;

GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz;

GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;

GPIO_Init(GPIOA, &GPIO_InitStruct);

GPIOA->BSRRL = GPIO_Pin_3 ; // PA3 Hi 

GPIOA->BSRRH = GPIO_Pin_8; // PA8 Low 

for(uint32_t o=0; o<0xFFFFFF; o++) { } // some delay

for(uint32_t o=0; o<0xFFFFFF; o++) { } // some delay

GPIOA->BSRRL = GPIO_Pin_8; // PA8 hi

GPIO_InitStruct.GPIO_Pin = GPIO_Pin_2;

GPIO_InitStruct.GPIO_Mode = GPIO_Mode_OUT;

GPIO_InitStruct.GPIO_OType = GPIO_OType_OD;

GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz;

GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL;

GPIO_Init(GPIOE, &GPIO_InitStruct);

return 0;

}

    This topic has been closed for replies.

    1 reply

    Bogdan
    BogdanAuthor
    Senior
    June 4, 2018
    Posted on June 04, 2018 at 22:34

    So i found out the problem, after some debuging, it seems the mcu was reset by the POR supervisor.

      In my circuit i have a mic803-31D3VM3 on the ST reset pin which has a treshold voltage of 3.08V, so when i switched on the PA8 port,  due to poor filtering on the breadboard circuit, my supply voltage falls for some 10th's of us from 3.21 to 3.06volts

    T J
    Senior III
    June 5, 2018
    Posted on June 05, 2018 at 00:14

    I use the MIC803, but at 2.9V and 1.2Seconds !