cancel
Showing results for 
Search instead for 
Did you mean: 

Help with GPIO on STM32F4 discovery

marittiello1
Associate II
Posted on April 24, 2013 at 23:09

Hi,

i'm studying about GPIOs on STM32F4 Discovery but in the User Manual i don't understand very well how GPIOs work.

Can someone helps me to understand how it works?

GPIOs should be 9 ports of 16 bits that SoC uses to communicate with external Connectors and in general with peripheral on board, like LEDs.

Is it correct? and 

Has the SoC STM32F407VG of the STM32F4 Discovery 100 pinout?

A doubt about the PIN PA9, which can turn on the green LED but it can be used with Alternate Function as USART.

When i use this PIN for USART what happened to green LED?

Every GPIO has two weak resistance (pull-up/pull-down) and we can use a pin with open-drain or push-pull configuration. How do these two resistance work?

Thanks and sorry for my english.
4 REPLIES 4
Posted on April 25, 2013 at 01:25

I wouldn't classify the STM32 as an SoC, it's a micro controller with a couple of peripherals.

Some parts have less pins, the die has more pads some are just not bonded out to pins.

You can program the GPIOs as inputs/output, the Data Manual describes the pin usage possibilities.

PA9 is not going to be useable for the USART, there is a huge 4u7 capacitor hung on it. It's designed to be used as part of the USB interface.

The resistors work like any others, they are fabricated in polysilicon, nominally 50K
Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
marittiello1
Associate II
Posted on April 25, 2013 at 01:51

Thanks for your reply, but i don't understand how one pin can control a LED and how the same pin can be a part a usart/usb or other. 

About the resistors why you turn on the pull up or the pull down resistor?

Posted on April 25, 2013 at 02:15

The Green LED is a side effect of driving the pin, or VBUS being present. If you are not connecting the Micro-AB USB connector you can control the LED.

It's not usable as a USART on the F4-Discovery board. The capacitor interferes with the signal.

The pins can have multiple functions, and can be attached to different peripherals. There exact function is controlled by a multiplexor in the silicon. Think of it like a rotary switch connecting different circuits, one at a time.

Open-Drain drivers only clamp a pin to ground, to get a high state the pin must be pulled up with a resistor to the supply, either externally or internally. Similarly if you have a button driving an input, that button could connect to ground or power when depressed, and pulled to the other rail when not. Perhaps you can Google interfacing methods, or pick up a book?

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
marittiello1
Associate II
Posted on April 25, 2013 at 03:08

Thanks again, do you know any books/websites speaking about that?

I'm studying on the user manuals to understand GPIO, but it isn't very clear if you ever work with micro controller or similar and i already have many problems to fully understand it.