📄 p18_lcd.html
字号:
You may override the default value by either defining the same constant in your Project.inc file or by changing the default value in the module's source.<BR><BR>Default value = 1
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="LCD.E.Port"></A><H3>
LCD.E.Port</H3>
<DL>
<DD> The port the E-pin is connected to. The data will be latched in the LCD on a falling edge of the E-pin.<BR><BR> You may override the default value by either defining the same constant in your Project.inc file or by changing the default value in the module's source.<BR><BR>Default value = PORTA
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="LCD.E.Pin"></A><H3>
LCD.E.Pin</H3>
<DL>
<DD> The port the E-pin is connected to. The data will be latched in the LCD on a falling edge of the E-pin.<BR><BR> You may override the default value by either defining the same constant in your Project.inc file or by changing the default value in the module's source.<BR><BR>Default value = 2
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="LCD.DATA"></A><H3>
LCD.DATA</H3>
<DL>
<DD> The port the data pins are connected to. The 4 high bits of the LCD data bits (DB4-DB7) have to be connected to the high nibble of this port (RX4-RX7).<BR><BR> You may override the default value by either defining the same constant in your Project.inc file or by changing the default value in the module's source.<BR><BR>Default value = PORTD
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="LCD.T_PowerUp"></A><H3>
LCD.T_PowerUp</H3>
<DL>
<DD> The power-up time of the LCD in micro seconds. The initialisation routine will wait this time, to ensure, that the LCD is powered up.<BR><BR> You may override the default value by either defining the same constant in your Project.inc file or by changing the default value in the module's source.<BR><BR>Default value = .20000
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="LCD.T_Instruction"></A><H3>
LCD.T_Instruction</H3>
<DL>
<DD> The maximum time the LCD needs to execute any instruction. Within the initialisation of the LCD, the busy flag can not be read, so it has to wait for the maximum execution time, to ensure that the command has been executed. All other routines check the LCD's busy flag instead.<BR><BR> You may override the default value by either defining the same constant in your Project.inc file or by changing the default value in the module's source.<BR><BR>Default value = .5000
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="LCD.Clear_CMD"></A><H3>
LCD.Clear_CMD</H3>
<DL>
<DD> This command clears the LC-Display<BR><BR>Default value = 0x01
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="LCD.EntryMode_CMD"></A><H3>
LCD.EntryMode_CMD</H3>
<DL>
<DD> This command sets the entry mode. Available bits are LCD.IncreaseCursor_BIT and LCD.ShiftDisplay_BIT.<BR><BR><BR>Default value = 0x04
<P>
<P>
<DD><DL>
<DT><B>Example:</B><DD><CODE><TABLE BORDER="0"><TR> <TD><CODE> </CODE></TD> <TD><CODE><FONT COLOR="#0000FF"><B>movlw </B></FONT></CODE></TD> <TD><CODE><FONT COLOR="#AA22AA">LCD.Clear_CMD | LCD.IncreaseCursor_BIT </FONT></CODE></TD></TR><TR> <TD><CODE> </CODE></TD> <TD><CODE><FONT COLOR="#0000FF"><B>call </B></FONT></CODE></TD> <TD><CODE><FONT COLOR="#AA22AA">LCD.SendCMD </FONT></CODE></TD></TR></TABLE></CODE></DD></DL>
</DD>
<DD><DL>
<DT><B>Description:</B><DD> This sets the mode to increase the cursor after a write, without shifting the Display </DD></DL>
</DD>
<DL>
</DL>
</DL>
<HR>
<A NAME="LCD.IncreaseCursor_BIT"></A><H3>
LCD.IncreaseCursor_BIT</H3>
<DL>
<DD> If set, the cursor will increase after each write, otherwise it will be decreased.<BR><BR>Default value = 0x02
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="LCD.ShiftDisplay_BIT"></A><H3>
LCD.ShiftDisplay_BIT</H3>
<DL>
<DD> If set, the display will be shifted after each write, otherwise it will not be shifted.<BR><BR>Default value = 0x01
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="LCD.Mode_CMD"></A><H3>
LCD.Mode_CMD</H3>
<DL>
<DD> This command sets the mode of the display. Available bits are LCD.DisplayOn_BIT, LCD.CursorOn_BIT and LCD.BlinkingON.<BR><BR><BR>Default value = 0x08
<P>
<P>
<DD><DL>
<DT><B>Example:</B><DD><CODE><TABLE BORDER="0"><TR> <TD><CODE> </CODE></TD> <TD><CODE><FONT COLOR="#0000FF"><B>movlw </B></FONT></CODE></TD> <TD><CODE><FONT COLOR="#AA22AA">LCD.ShiftDisplay_BIT | LCD.DisplayOn_BIT </FONT></CODE></TD></TR><TR> <TD><CODE> </CODE></TD> <TD><CODE><FONT COLOR="#0000FF"><B>call </B></FONT></CODE></TD> <TD><CODE><FONT COLOR="#AA22AA">LCD.SendCMD </FONT></CODE></TD></TR></TABLE></CODE></DD></DL>
</DD>
<DD><DL>
<DT><B>Description:</B><DD> This will TurnOn the display, without showing a cursor. </DD></DL>
</DD>
<DL>
</DL>
</DL>
<HR>
<A NAME="LCD.DisplayOn_BIT"></A><H3>
LCD.DisplayOn_BIT</H3>
<DL>
<DD> When set display will be on, otherwise display will be off<BR><BR>Default value = 0x04
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="LCD.CursorOn_BIT"></A><H3>
LCD.CursorOn_BIT</H3>
<DL>
<DD> When set cursor is shown, otherwise cursor is hidden<BR><BR>Default value = 0x02
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="LCD.BlinkingOn_BIT"></A><H3>
LCD.BlinkingOn_BIT</H3>
<DL>
<DD> When set cursor will blink (if visible), otherwise cursor will be solid black.<BR><BR>Default value = 0x01
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="LCD.Shift_CMD"></A><H3>
LCD.Shift_CMD</H3>
<DL>
<DD> This command shifts the LC-Display Available bits are LCD.DisplayShift_BIT and LCD.ShiftRight_BIT<BR><BR>Default value = 0x10
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="LCD.DisplayShift_BIT"></A><H3>
LCD.DisplayShift_BIT</H3>
<DL>
<DD> When set, the display will be shifted, otherwise the cursor will be shifted.<BR><BR>Default value = 0x08
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="LCD.ShiftRight_BIT"></A><H3>
LCD.ShiftRight_BIT</H3>
<DL>
<DD> When set the shift direction will be right, otherwise left.<BR><BR>Default value = 0x04
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="LCD.Function_CMD"></A><H3>
LCD.Function_CMD</H3>
<DL>
<DD> This sets the function of the LC-Display. Available bits are LCD.EightBit_BIT, LCD.TwoLines_BIT and LCD.X5Y10_BIT.<BR><BR><BR>Default value = 0x20
<P>
<P>
<DD><DL>
<DT><B>Example:</B><DD><CODE><TABLE BORDER="0"><TR> <TD><CODE> </CODE></TD> <TD><CODE><FONT COLOR="#0000FF"><B>movlw </B></FONT></CODE></TD> <TD><CODE><FONT COLOR="#AA22AA">LCD.Function_CMD | LCD.TwoLines_BIT </FONT></CODE></TD></TR><TR> <TD><CODE> </CODE></TD> <TD><CODE><FONT COLOR="#0000FF"><B>call </B></FONT></CODE></TD> <TD><CODE><FONT COLOR="#AA22AA">LCD.SendCMD </FONT></CODE></TD></TR></TABLE></CODE></DD></DL>
</DD>
<DD><DL>
<DT><B>Description:</B><DD> This sets the LCD to a 4-bit interface, activates the second line, and configures the controller for a 5x7 dot LCD. </DD></DL>
</DD>
<DL>
</DL>
</DL>
<HR>
<A NAME="LCD.EightBit_BIT"></A><H3>
LCD.EightBit_BIT</H3>
<DL>
<DD> If set, the communication is set to eight bit interface, otherwise four bit interface<BR><BR>Default value = 0x10
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="LCD.TwoLines_BIT"></A><H3>
LCD.TwoLines_BIT</H3>
<DL>
<DD> If set, the second line of the LCD will be turned on, otherwise only the first line will be visible.<BR><BR>Default value = 0x08
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="LCD.X5Y10_BIT"></A><H3>
LCD.X5Y10_BIT</H3>
<DL>
<DD> If set, the controller within the LCD will interface a 5x10 dot LCD, otherwise it will interface to a 5x7 dot LCD.<BR><BR>Default value = 0x04
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="LCD.SetCursor_CMD"></A><H3>
LCD.SetCursor_CMD</H3>
<DL>
<DD> This sets the data cursor to a certain position.<BR><BR><BR>Default value = 0x80
<P>
<P>
<DD><DL>
<DT><B>Example:</B><DD><CODE><TABLE BORDER="0"><TR> <TD><CODE> </CODE></TD> <TD><CODE><FONT COLOR="#0000FF"><B>movlw </B></FONT></CODE></TD> <TD><CODE><FONT COLOR="#AA22AA">LCD.SetCursor_CMD | LCD.Line1_ADR </FONT></CODE></TD></TR><TR> <TD><CODE> </CODE></TD> <TD><CODE><FONT COLOR="#0000FF"><B>call </B></FONT></CODE></TD> <TD><CODE><FONT COLOR="#AA22AA">LCD.SendCMD </FONT></CODE></TD></TR></TABLE></CODE></DD></DL>
</DD>
<DD><DL>
<DT><B>Description:</B><DD> This sets the current cursor position to the beginning of the second line.</DD></DL>
</DD>
<DL>
</DL>
</DL>
<HR>
<A NAME="LCD.Line0_ADR"></A><H3>
LCD.Line0_ADR</H3>
<DL>
<DD> This is the address of the first character in the first line<BR><BR>Default value = 0x00
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="LCD.Line1_ADR"></A><H3>
LCD.Line1_ADR</H3>
<DL>
<DD> This is the address of the first character in the second line<BR><BR>Default value = 0x40
<P>
<DL>
</DL>
</DL>
<HR>
<P>
<!-- ============ FIELD DETAIL =========== -->
<A NAME="field_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Field Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="LCD.Buffer.Line0"></A><H3>
LCD.Buffer.Line0</H3>
<DL>
<DD> This is the off screen buffer for the first line of the LCD, it is 17 bytes long.
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="LCD.Buffer.Line1"></A><H3>
LCD.Buffer.Line1</H3>
<DL>
<DD> This is the off screen buffer for the second line of the LCD, it is 17 bytes long.
<P>
<DL>
</DL>
</DL>
<HR>
<P>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="LCD.Init"></A><H3>
LCD.Init</H3>
<PRE>
<B>LCD.Init</B>()</PRE>
<P>
<DL>
<DD> This function initializes the LCD.<BR>
<P>
<P>
<DD><DL>
<DT><B>Used SFRs:</B><DD>INTCON ,T0IE T0CON </DD></DL>
</DD>
<DD><DL>
<DT><B>Calls subroutines:</B><PRE> Delay.Wait Delay.Mikros Delay.Start8 Delay.Start16 CD.SendCMDNoBusy LCD.SendCMD LCD.BUSY_CHECK
</PRE>
</DD></DL>
<DD><DL>
<DT><B>Stacklevel:</B><DD>3</DD></DL>
</DD>
<DD><DL>
<DT><B>Status:</B><DD> Tested</DD></DL>
</DD>
</DL>
<HR>
<A NAME="LCD.SendCMDNoBusy"></A><H3>
LCD.SendCMDNoBusy</H3>
<PRE>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -