Difference between revisions of "Lcd 8-bit With Explore M3"
(Created page with "Category:Explore M3 Bare Metal In this tutorial we will see how to interface lcd in 8-bit mode using the explore Embedded bare metal libraries.<br> At the end will see how...") |
|||
Line 44: | Line 44: | ||
</html> | </html> | ||
<br><br> | <br><br> | ||
− | + | [[File:01LCD 8bit.png]] | |
=Demo= | =Demo= |
Latest revision as of 11:15, 5 May 2016
In this tutorial we will see how to interface lcd in 8-bit mode using the explore Embedded bare metal libraries.
At the end will see how to use the libraries for 1x16, 2x16 and 4x20 LCD's.
The libraries can be used on different platforms like Keil, ARM GCC, GCC And Eclipse etc.
Contents
[hide]Prerequisites
Please check this tutorial for detailed explanation on LCD.
If you are doing it for the first time, then check the below links to setup the project for generating the .bin file.
Hardware Connection
RS | RW | EN | D0 | D1 | D2 | D3 | D4 | D5 | D6 | D7 |
---|---|---|---|---|---|---|---|---|---|---|
5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
Code
LCD 1x16
Below is the sample code for 1x16 Lcd in 8-bit mode.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "lcd.h" | |
int main() | |
{ | |
int count = 0; | |
SystemInit(); | |
/* RS RW EN D0 D1 D2 D3 D4 D5 D6 D7*/ | |
LCD_SetUp(5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); | |
LCD_Init(2,16); //1x16 | |
LCD_DisplayString("Explore Lcd 1x16"); | |
while(1); | |
} |
LCD 2x16
Below is the sample code for 2x16 Lcd in 8-bit mode.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "lcd.h" | |
int main() | |
{ | |
SystemInit(); | |
/* RS RW EN D0 D1 D2 D3 D4 D5 D6 D7*/ | |
LCD_SetUp(5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); | |
LCD_Init(2,16); //2x16 Lcd | |
LCD_DisplayString("Explore M3"); | |
LCD_GoToLine(1); | |
LCD_DisplayString("Lcd2x16 4-Bit"); | |
while(1); | |
} |
LCD 4x20
Below is the sample code for 4x20 Lcd in 8-bit mode.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "lcd.h" | |
int main() | |
{ | |
SystemInit(); | |
/* RS RW EN D0 D1 D2 D3 D4 D5 D6 D7*/ | |
LCD_SetUp(5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); | |
LCD_Init(4,20); // 4x20 Lcd | |
LCD_DisplayString("Explore Embedded\n"); | |
LCD_DisplayString("LCD 4-bit Mode\n"); | |
LCD_DisplayString("20 x 4 \n"); | |
LCD_DisplayString(":) :O"); | |
while(1); | |
} |
