LCD INTERFACING WITH STM-32 MBED PLATFORM In this tutorial you can find information about interfacing of different LCD panel with any (Here - STM32 NUCLEO-64) using Mbed platform and TextLCD.h library. Purpose of this program-- Basic Usage of library and interconnection description

Dependencies:   TextLCD

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 /* LCD INTERFACING BASIC PART  -- TEXT DISPLAY
00002 D4 TO D7 = PA3,PA2,PA10,PB3    === PORT PINS ====
00003 RS = PC0
00004 E = PC1
00005 R/W = GND
00006 PLATFORM :MBED ARM ONLINE
00007 HARDWARE : NUCLEO-64 / STM32\
00008 LCD : 20 *4 DISPLAY   MODULE RG2004A
00009 JAYDEEP SHAH -- radhey04ec@gmail.com
00010 */
00011 
00012 //NOTE YOU NEED TO IMPORT LIBRARY - TextLCD.h for using class  (4-bit interface)
00013 
00014 //Link : https://os.mbed.com/components/HD44780-Text-LCD/
00015 
00016 /* LCD PANNEL SUPPORT -- CHANGE ACCORDING IN TextLCD object
00017 Credit goes to : Simon Ford
00018 TextLCD::LCD16x2     16x2 LCD panel (default) 
00019 TextLCD::LCD16x2B    16x2 LCD panel alternate addressing 
00020 TextLCD::LCD20x2     20x2 LCD panel 
00021 TextLCD::LCD20x4     20x4 LCD panel
00022 TextLCD::LCD8x1    8x1 LCD panel
00023 TextLCD::LCD8x2    8x2 LCD panel
00024 TextLCD::LCD16x1  16x1 LCD panel
00025 TextLCD::LCD16x4  16x4 LCD panel
00026 TextLCD::LCD24x2  24x2 LCD panel
00027 TextLCD::LCD24x4  24x4 LCD panel (for KS0078 controller)
00028 TextLCD::LCD40x2  40x2 LCD panel
00029 TextLCD::LCD40x4  40x4 LCD panel (two controllers)
00030 */
00031 
00032 #include "mbed.h"  //MBED LIBRARY
00033 #include "TextLCD.h"  // LCD LIBRARY
00034  
00035 TextLCD lcd(PC_0, PC_1, PB_4, PB_5, PB_3, PA_10, TextLCD::LCD20x4); // rs, e, d4-d7  -- REGISTER SELECT / ENABLE / AND DATA-PIN
00036  
00037 int main() {  // MAIN THREAD START
00038 
00039     lcd.printf("Jaydeep Shah!\n");  // PRINT COMMAND -- TXT ON LCD
00040 }