Hitachi Network Adapter H8 User Manual page 37

Lowcost evaluation board
Table of Contents

Advertisement

HTEB1
User manual
u8 LCDReadStatus(void)
{
u8 status;
CLEAR_LCD_RS;
SET_LCD_RW;
LCD_DATA_CTRL = LCD_IN;
SET_LCD_EN;
status = LCD_DATA_PORT;
CLEAR_LCD_EN;
LCD_DATA_CTRL = LCD_OUT;
return status;
}
void LCDInit(void)
{
u16 cnt=0;
CLEAR_LCD_RS;
CLEAR_LCD_RW;
CLEAR_LCD_EN;
PCR7 |= 0x30;
PCR2 |= 0x01;
LCD_DATA_CTRL = LCD_OUT;
LCDWriteCmd(0x38); // 8Bit-IF, 2 Lines, 5x7 character font
while(--cnt);
LCDWriteCmd(0x38); // 8Bit-IF, 2 Lines, 5x7 character font
while(--cnt);
LCDWriteCmd(0x38); // 8Bit-IF, 2 Lines, 5x7 character font
while(--cnt);
LCDWriteCmd(0x38); // 8Bit-IF, 2 Lines, 5x7 character font
while(--cnt);
// LCDWriteCmd(0x01); // Display Clear
// LCDReadStatus();
// LCDWriteCmd(0x0f); // DisplayOn, CursorOn, BlinkingOn
LCDWriteCmd(0x0c); // DisplayOn, CursorOff, BlinkingOff
LCDReadStatus();
LCDWriteCmd(0x06); // Enter Mode, AutoIncrement
LCDReadStatus();
LCDWriteCmd(0x14); // MoveCursor right
LCDReadStatus();
LCDWriteCmd(0x80); // Set DD RAM Address = 0x00
LCDReadStatus();
}
// writesomedata from 1st position in #line (0/1)
void LCDWriteLine(u8 line, const u8 *data)
{
LCDWriteCmd(0x80 + line*0x40);
while (*data)
{
LCDWriteData(*data);
data++;
}
}
void Delay(void)
{
long z = 0x200000;
while(--z);
}
const u8 Text1[17]
= "
const u8 Text2[17]
= "
const u8 Text3[17]
= "
const u8 Text4[17]
= " Tiny-H8/3664F
const u8 Text5[17]
= "LowCostEvalBoard";
Issue 0.2
// get the LCD status register
// init LCD
// Set RS+RW = Output
// Set EN = Output
// Set DDR to Output
// select line
// "manual" delay
embesso
";
presents
";
HITACHI
";
";
Page 37
07/2002

Advertisement

Table of Contents
loading

This manual is also suitable for:

H8/tiny 3664fHteb1

Table of Contents