9 years, 4 months ago.

Nucleo F411RE - Which pins are they???

Hello everyone,

TRYING to get one of those I2C (PCF8574) 20x4 LCD to work. I know the address is 0x4E. What is confusing is the literature for the F411RE Nucleo board. Are the I2C pins PB_8/PB_9 or PA_2/PA_3??? I thought they were PB_8/PB_9 then I saw: /media/uploads/WingNut/capture1.jpg

The way they ENLARGED and BOLDFACED PA_2/PA_3, you'd think those are the pins they want you to use. SO, which is it??

Thanks, Duane

1 Answer

9 years, 4 months ago.

Hi Duane,

I think you are refering to the Description Splash screen when you select the target device to build for.

The list there are just examples and not equivalences. If you click on the 'Pinout' leaf you will get a definative answer.

However example below works for me (I Used D14,D15 on the 'Arduino' Connector CN9 SCL and SDA respectively).

/* Code here before function */ I2C i2c(I2C_SDA, I2C_SCL); /* Code ends */

Regards, Martin

Accepted Answer

Hi Martin,

Thanks for your reply. My only problem with the 'Pinout' tab is that it ONLY lists the Pinout for the Arduino connectors, and NOT the FULL breakout headers. I didn't choose the board for the Arduino connectors. I would have been perfectly happy the they WEREN'T there. It just confuses things.

Anyway, I did as you did. Not being familiar with C++ Why do you have to write 'I2C' twice before the Open Paren? The F411RE is capable of (3) I2C's. I think because of the Arduino connector, you don't have access to the other two. Maybe I need to look for another Dev board to work with.

Thanks, Duane

posted by Duane Brantley 10 Dec 2014

Yes, the formatting & line breaks on that splash screen are screwed up. Starting at the top

  • SERIAL_TX is PA_2
  • I2C_SCL is PB_8 etc

It's clearer here: http://developer.mbed.org/platforms/ST-Nucleo-F411RE/

Looks to me like all three I2C's are available on the Arduino headers:

I2C i2c1(I2C_SDA, I2C_SCL); 
I2C i2c2(D3, D6);
I2C i2c3(D5, D7);

There are alternative pin-names for all, but only the first I2C has "meaningful" labels defined in the board's PinNames.h. The first I2C port could also be referenced by the Arduino header names D14, D15 & also by the STM32F411 GPIO's PB_9, PB_8.

As per https://developer.mbed.org/handbook/I2C, you'll have to provide pull-up resistors on all lines.

It's better to use the Arduino labels (or, where they exist, the "port" labels) as it makes the code more portable across different devices.

posted by David Lowe 11 Dec 2014