cancel
Showing results for 
Search instead for 
Did you mean: 

PA9 is high voltage level when configured as input pull-down mode

liliangbao
Associate II

Hello, everyone.

    I use STM32L496 on my board, and use PA9 as a GPIO for input, without any external resister.

    Software program is based on HAL. I have a sample demo like this:

    int main(void)
    {
        HAL_Init();
        BSP_Init();

        while(1)
        {
            delay_ms(1000);
        }
    }

    While, in the BSP_Init(), like this:

    void BSP_Init(void)
    {
        GPIO_InitTypeDef GPIO_InitStruct = {0};

        __HAL_RCC_GPIOA_CLK_ENABLE();

        GPIO_InitStruct.Pin       = GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_11
        GPIO_InitStruct.Mode   = GPIO_MODE_INPUT;
        GPIO_InitStruct.Pull      = GPIO_NOPULL;     // or GPIO_PULLDOWN
        GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
        HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);

    }

 

    But, on the board, I measured PA9 has a high voltage level, but PA10 and PA11 is low. If do not call BSP_Init(), PA9 is high level,too. If a change GPIO_InitStruct.Pull to GPIO_PULLDOWN, the result is same as above. I checked the register, three pin has the same configure. And no other place configure these pin.

    Is there same mistake about my use? It's been bothering me for a long time. Does anyone provide any help, Thanks very much!

1.png2.png

1 ACCEPTED SOLUTION

Accepted Solutions

A) Show us all relevant schematic (U1 TX2)
B) Check PCB trace from shortcut to VCC
C) Explain how exactly did you measured "high level" on pin without pullup/down. It is little bit tricky to measure floating input !

View solution in original post

4 REPLIES 4
SofLit
ST Employee

Hello, 

In your schematics there is the signal called "U1 TX2". What kind of signal is this: input or output? The voltage you are measuring could be sourced by this signal.

Could you please share the schematics?

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

A) Show us all relevant schematic (U1 TX2)
B) Check PCB trace from shortcut to VCC
C) Explain how exactly did you measured "high level" on pin without pullup/down. It is little bit tricky to measure floating input !

Thank you for reply.  "U1 TX2" is input, and it connect nothing. I will check carefully.

Thank you for reply.  I will check carefully according to your recommendation.