birayours
Newbie level 3
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.
so if u can help please thanks.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
#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.