Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Need help on LPC210X with LCD

Status
Not open for further replies.

birayours

Newbie level 3
Joined
Jan 13, 2012
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Ethiopia
Activity points
1,298
Can any one show me how to create a moving text on any LCD with LPC210X, I've done it in mikro c but am new to IAR for Arm workbench with Proteus
so if u can help please thanks.
 

Its similar to mikro c. if u know about "fio" or "gpio" of lpc210x then u must be able to do this easily.
 

What i was trying to say was i never had experience in ARM7 but am not new to PIC. so pls am such in need of your help to show me some example in LPC210X with LCD in IAR for ARM workbench with Proteus design. Thank you.
 

Here's simple example code for LPC2103 to interface with LCD. I've tested it on hardware and it works well.

Code:
#include <LPC2103.H>

#include "lcd.h"

#define RS (1 << 17) //RS Pin
#define RW (1 << 18) // RW Pin
#define EN (1 << 19) // EN Pin

/*Data Pin of LCD*/
#define LCD_D0 (1 << 20) 
#define LCD_D1 (1 << 21)
#define LCD_D2 (1 << 22)
#define LCD_D3 (1 << 23)
#define LCD_D0 (1 << 24)
#define LCD_D1 (1 << 25)
#define LCD_D2 (1 << 26)
#define LCD_D3 (1 << 27)

#define LCD_DATA_MASK (LCD_D1 | LCD_D4 | LCD_D2 | LCD_D3 | LCD_D4 | LCD_D5 | LCD_D6 | LCD_D7)

void lcd_cmd(unsigned char command)
{
  	int i;
  	unsigned int temp=0;
  	temp = (command<<20)&LCD_DATA_MASK; // since LCD_D0 is p0.20
	IOCLR = RS;
  	IOCLR = RW;
	IOCLR = LCD_DATA_MASK;
  	IOSET = temp1;  	
  	IOSET = EN;
	for(i=0;i<1000;i++);
  	IOCLR = EN;  
}

void lcd_clear(void)
{
  lcd_cmd(0x01);
}

void lcd_data( unsigned char dat)
{
  	int i;
  	unsigned char temp=0;

  	temp = (dat<<20)&LCD_DATA_MASK;
  	IOSET |= RS;
  	IOCLR |= RW;
	IOCLR = LCD_DATA_MASK;
  	IOSET = temp;
  	IOSET |= EN;
  	for(i=0;i<10000;i++);	
  	IOCLR |= EN;
  
}
void set_lcd_port_output(void)
{
  IODIR |= ( EN | RS | RW | LCD_DATA_MASK);
}
void init_lcd(void)
{
  	set_lcd_port_output();
  	lcd_cmd(0x38);
	lcd_cmd(0x0c);
	lcd_cmd(0x01);
}
void lcd_display2(unsigned char *str)
{
	lcd_cmd(0xc0);//goto second line of LCD
	while(*str!='\0')
	{
		lcd_data(*str++);
	}
}
void lcd_display1(unsigned char *str)
{
	lcd_cmd(0x80);//go to first line of LCD
	while(*str!='\0')
	{
		lcd_data(*str++);
	}
}

Use CODE tags when posting your code.
 
Last edited by a moderator:
Thank u so much for the help, it was helpful, thanks again!!!!!!:cool:
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top