Dears,
I have LPC-E2294 board with 2X16 LCD.
I downloaded LPC2294 test code for IAR workbench but the LCD dosn’t display anything.
I think the problem in the following code
// LCD pinout
#define E_high IO0SET |= 0x20000000
#define E_low IO0CLR |= 0x20000000
#define RS_high IO0SET |= 0x10000000
#define RS_low IO0CLR |= 0x10000000
#define RW_high IO0SET |= 0x40000000
#define RW_low IO0CLR |= 0x40000000
#define LIGHT_LCD_ON IO0SET |= 0x00000400
#define LIGHT_LCD_OFF IO0CLR |= 0x00000400
#define TD2_high IO0SET |= 0x01000000
#define TD2_low IO0CLR |= 0x01000000
#define TD3_high IO0SET |= 0x00400000
#define TD3_low IO0CLR |= 0x00400000
#define TD4_high IO0SET |= 0x00002000
#define TD4_low IO0CLR |= 0x00002000
#define B1 IO0PIN & 0x00008000
#define B2 IO0PIN & 0x00010000
#define RD1 IO0PIN & 0x02000000
#define RD2 IO0PIN & 0x00800000
#define RD3 IO0PIN & 0x00200000
#define RD4 IO0PIN & 0x00001000
#define AIN0 IO0PIN & 0x08000000
#define DLS IO0PIN & 0x00000800
#define DISP_ON 0x0000000C //LCD control constants
#define DISP_OFF 0x00000008 //
#define CLR_DISP 0x00000001 //
#define CUR_HOME 0x00000002 //
#define ENTRY_INC 0x00000006 //
#define DD_RAM_ADDR 0x00000080 //
#define DD_RAM_ADDR2 0x000000C0 //
#define DD_RAM_ADDR3 0x00000028 //
#define CG_RAM_ADDR 0x00000040 //
//--------Send char to LCD-----------------------------
void SEND_CHAR (unsigned long c)
{
RW_low;
Delay_us(LCD_CHAR_SPEED); //Delay for LCD char
data = 0xffffff0f | c; //get upper nibble
IO0CLR |= 0x000000f0; //clear d4-d7
IO0SET = (IO0SET | 0x000000f0) & data; //set D4-D7
RS_high; //set LCD to data mode
_E();
data = (c << 4) & 0x000000f0; //get down nibble
IO0CLR |= 0x000000f0; //clear D4-D7
IO0SET = (IO0SET & 0xffffff0f) | data; //set D4-D7 (only PORTC4-PORTC7)
RS_high; //set LCD to data mode
_E();
}
Thanks in advance
BISO