7 years, 2 months ago.

7 segment display for NUCLEO F401RE

Hello everybody! I'm working on a project based on a ST Nucleo F401RE board, i need to show some decimal values through a seven segment display. My question is: which display is the most suitable for my F401RE board? Considering that i'm not an expert i would like to use a display for which there are already mbed libraries and how to use guides. Thank you in advance!

1 Answer

7 years, 2 months ago.

Check out the component page for LED displays here. There are several really cheap display controller modules available on ebay, for example the TM1637. They are easier to use and less expensive than buying a one or two digit seven segment display, wiring them up and writing the driver code yourself... The serial interfaces also save you some pins.

Hi, first of all thank you for your help! Instead using a 7 segment display i'dd like to use a SunFounder HD44780 LCD display with I2C communication. I saw you wrote a library for hd44780 display, so can you tell me if this display is easy to use with my nucleo f401re. Moreover I wouldn't use an external supply so i need to know how many mA this display consume to know if i can power it directly through the 5V pin of my nucleo. Thank you in advance!

posted by Luca Peluso 11 Feb 2017

I assume you plan to use this display. It seems to come with an I2C portexpander LCM1602. The notebook page for the HD44780 library provides the information you need to use the I2C portexpander version. Basically you import the library, modify the config file to select the LCM1602 portexpander, write your main to declare an I2C interface on the proper pins and use it as parameter for the LCD display declaration, use the LCM1602 default slave address 0x4E as parameter, recompile and upload the code. Something like this:

#include "mbed.h"
#include "TextLCD.h"
 
// I2C Communication
I2C i2c_lcd (PB_9, PB_8); // SDA, SCL
 
//I2C Portexpander PCF8574
TextLCD_I2C lcd (&i2c_lcd, 0x4E, TextLCD::LCD16x2); // I2C bus, PCF8574 Slaveaddress, LCD Type
 
int main() {
...
    

Select one of the available I2C ports on the F401 (check the platform page) and wire it up to the display, make sure you have pull-up resistors installed. The U5V output on the F401 should be OK to power the display. Note that the U5V supply is only available when the USB cable to the STLINK interface is hooked up.

posted by Wim Huiskamp 11 Feb 2017