Designer Reference Manual
Passive Infrared (PIR) Unit
258
REMOTE Source Code Files
For More Information On This Product,
Go to: www.freescale.com
MOTOROLA
REMOTE Source Code Files
EN = 0; // re-affirmation
RS = 1; // access data register
RW = 0; // write
NOP();NOP(); // ensure setup time
EN = 1; // enable write process
PTC.reg = value; // lcd data 0:4
PTD.reg = temp; // lcd data 5:7
NOP();NOP();NOP();//
NOP();NOP();NOP();//
NOP();NOP(); // ensure data setup time
EN = 0; // disable write
RW = 1; // write complete
Delay(_100US);
} // DataRegWrite()
//------------------------------------------------------------------------------
void SetCursorAddress( unsigned char value )
{
InstructionRegWrite( (unsigned char)(0x80|value) );
} // SetCursorAddress()
//------------------------------------------------------------------------------
//////////////////////////////////////////////////////////////////////////////
// This function ’string’ ie ’text_buffer’ is filled before this function //
// call. ’text_buffer’ is mainly filled using ’strcpy()’, although on a few //
// occasions I perform a manual copy as the string consists of a single //
// character. //
//////////////////////////////////////////////////////////////////////////////
void WriteText1( unsigned char address )
{
unsigned char ii;
unsigned char length;
SetCursorAddress(address); // write start position
length = (unsigned char)strlen(&text_buffer[0]);
///////////////
// write it! //
///////////////
for ( ii = 0; ii < length; ii++ )
{
WriteChar(text_buffer[ii]);
}
} // WriteText1()
//------------------------------------------------------------------------------
void WriteText2( unsigned char address, char *ptr, unsigned char clear )
{
unsigned char ii;
unsigned char length;
F
Freescale Semiconductor, Inc.
n
.