Interfacing of LCD With STM32F1 (ARM CORTEX) Microcontroller

by embeddedbymedhavi in Circuits > Microcontrollers

3 Views, 0 Favorites, 0 Comments

Interfacing of LCD With STM32F1 (ARM CORTEX) Microcontroller

LCD1.jpg

Introduction of STM32F1:

The STM32F103xx medium-density performance line family incorporates the high-performance ARM Cortex-M3 32-bit RISC core operating at a 72 MHz frequency, high-speed embedded memories (Flash memory up to 128 Kbytes and SRAM up to 20 Kbytes), and an extensive range of enhanced I/Os and peripherals connected to two APB buses. All devices offer two 12-bit ADCs, three general purpose 16-bit timers plus one PWM timer, as well as standard and advanced communication interfaces: up to two I2Cs and SPIs, three USARTs, an USB and a CAN.

Component Used:

board.jpg
lcd.jpg
c1.png

1) STM32F103 Board:

FEATURES of STM32F1:

Circuit is given above.

2) LCD 16X2

LCD (Liquid Crystal Display) :

LCD screen is an electronic display module and find a wide range of applications. A 16x2 LCD display is very basic module and is very commonly used in various devices and circuits. These modules are preferred over seven segment and other multi segment LED's. The reasons being: LCDs are economical; easily programmable; have no limitation of displaying special & even custom character (unlike in seven segments), animation and so on. A 16x2 LCD means it can display 16 characters per line and there are 2 such lines. In this LCD each character is displayed in 5x7 pixel matrix. This LCD has two registers, namely, Command and Data.

The command register stores the command instructions given to the LCD. A command is an instruction given to LCD to do a predefined task like initializing it, clearing its screen, setting the cursor position, controlling display etc. The data register stores the data to be displayed on the LCD. The data is the ASCII value of the character to be displayed on the LCD. Click to learn more about internal structure of a LCD.

Block Diagram of LCD:

L1.gif

LCD stands for liquid crystal display. They come in many sizes 8x1 , 8x2 ,10x2, 16x1 , 16x2 , 16x4 , 20x2 , 20x4 ,24x2 , 30x2 , 32x2 , 40x2 etc . Many multinational companies like Philips Hitachi Panasonic make their own special kind of lcd's to be used in their products. All the lcd’s performs the same functions (display characters numbers special characters ASCII characters etc).Their programming is also same and they all have same 14 pins (0-13) or 16 pins (0 to 15).

ALL LCDs have Eight(8) Data pinsVCC (Apply 5v here)GND (Ground this pin)RS (Register select)RW (read - write)EN (Enable)V0 (Set Lcd contrast)8-Data pins carries 8-bit data or command from an external unit such as microcontroller.

Lcd have two registers:
1) Command Register 2) Data Register

Command Register: When we send commands to lcd these commands go to Command register and are processed their. Commands with their full description are given in the picture below. When RS=0 Command Register is Selected.

Data Register: When we send Data to lcd it goes to data register and is processed their. When RS=1 Data Register is selected.

Pin Diagram of LCD:

L2.png

Pin Description:

LCD PIN DECRIPTION.jpg

16×2 LCD Module Commands:

lcd commands.jpg

16×2 LCD module has a set of preset command instructions. Each command will make the module to do a particular task. These commands are very important for displaying data in LCD. The list of commands given below:

Software Used:

keil.jpg
stm32cubemx.jpg

1) KEIL u Vision 4:

2) STM32CubeMX:

Pin Diagram OF STM32F103

pin diagram.png

Mode of STM32F1

stm32f1.jpg

1) Operating Mode

2) Programming Mode

How to Burn Code in STM32F1 Using Seial to USB

stm32f1a.jpg

How to Work on STM32F1 Microcontroller Using CubeMX and Keil for LCD

Interfacing of LCD 16x2 with STM32F1 (ARM Cortex) Microcontroller using KEIL Compiler

Code of STM32F1 With LCD

Any Query related Embedded System , IOT and Raspberry PI go to

You Tube Channel:

My Channel

My Blog:

embeddedbymedhavi