|
|
| (One intermediate revision by the same user not shown) |
| Line 1: |
Line 1: |
| − | [[category: ARM Tutorials]] | + | #REDIRECT [[LPC1768: Lcd 8bit]] |
| − | [[User:Amruta|Amruta]] ([[User talk:Amruta|talk]]) 12:21, 17 March 2015 (IST)
| + | |
| − | ----
| + | |
| − | =Basics=
| + | |
| − | | + | |
| − | In this tutorial we will interface LCD to LPC1768.
| + | |
| − | | + | |
| − | Here we will not go in details of LCD.
| + | |
| − | | + | |
| − | Still if you want to know it, [[A1.8051_Interfacing:LCD_16x2#LCD_UNIT|click here]].
| + | |
| − | | + | |
| − | =Schematic=
| + | |
| − | [[File:Schematic LPC1768 LCD.svg|x500px|center|Schematic]]
| + | |
| − | | + | |
| − | =Code=
| + | |
| − | | + | |
| − | There is lot of stuff that can be done with the LCDs, to start with we will simple display a couple of strings on the 2 lines of the LCD.
| + | |
| − | | + | |
| − | For that initialize the LCD with LCD_Init(), here 8 bit mode, 2 lines and 16 characters per line.
| + | |
| − | | + | |
| − | The LCD_DisplayString() will disply the specified string.
| + | |
| − | | + | |
| − | To explore more go through [[LCD|LCD API Reference]].
| + | |
| − | | + | |
| − | <syntaxhighlight>
| + | |
| − | /* note: Refer lcd.h file for Pin connections */
| + | |
| − | | + | |
| − | #include "lpc17xx.h" //Device Specific header file
| + | |
| − | #include "lcd.h" //Explore Embedded LCD library
| + | |
| − | | + | |
| − | /* start the main program */
| + | |
| − | int main()
| + | |
| − | {
| + | |
| − | /* Setup and initialize the microcontroller system */
| + | |
| − | SystemInit();
| + | |
| − |
| + | |
| − | /* Initialize the lcd before displaying any thing on the lcd */
| + | |
| − | LCD_Init(8,2,16);
| + | |
| − | | + | |
| − | /* Display "hello, world" on first line*/
| + | |
| − | LCD_DisplayString("Hello World");
| + | |
| − | | + | |
| − | /*Go to second line and display "good morning" */
| + | |
| − | LCD_GoToLine(2);
| + | |
| − | LCD_DisplayString("Good Morning");
| + | |
| − | | + | |
| − | while(1);
| + | |
| − | | + | |
| − | }
| + | |
| − | </syntaxhighlight>
| + | |
| − | | + | |
| − | | + | |
| − | {{DISQUS}}
| + | |