<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://wiki.mcselec.com/bavr/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://wiki.mcselec.com/bavr/index.php?action=history&amp;feed=atom&amp;title=CONFIG_LCDPIN</id>
		<title>CONFIG LCDPIN - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.mcselec.com/bavr/index.php?action=history&amp;feed=atom&amp;title=CONFIG_LCDPIN"/>
		<link rel="alternate" type="text/html" href="http://wiki.mcselec.com/bavr/index.php?title=CONFIG_LCDPIN&amp;action=history"/>
		<updated>2026-04-27T22:42:14Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.18.6</generator>

	<entry>
		<id>http://wiki.mcselec.com/bavr/index.php?title=CONFIG_LCDPIN&amp;diff=496&amp;oldid=prev</id>
		<title>Admin: Created page with &quot;= &lt;span class=&quot;f_Header&quot;&gt;Action&lt;/span&gt; =  Override the LCD-PIN select options.  &lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&lt;/span&gt;  &lt;span style=&quot;font-family: Arial;&quot;&gt;&amp;nbsp;&lt;/span...&quot;</title>
		<link rel="alternate" type="text/html" href="http://wiki.mcselec.com/bavr/index.php?title=CONFIG_LCDPIN&amp;diff=496&amp;oldid=prev"/>
				<updated>2013-02-08T09:20:19Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;= &amp;lt;span class=&amp;quot;f_Header&amp;quot;&amp;gt;Action&amp;lt;/span&amp;gt; =  Override the LCD-PIN select options.  &amp;lt;span style=&amp;quot;font-family: Arial;&amp;quot;&amp;gt; &amp;lt;/span&amp;gt;  &amp;lt;span style=&amp;quot;font-family: Arial;&amp;quot;&amp;gt; &amp;lt;/span...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= &amp;lt;span class=&amp;quot;f_Header&amp;quot;&amp;gt;Action&amp;lt;/span&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
Override the LCD-PIN select options.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-family: Arial;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-family: Arial;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;span class=&amp;quot;f_Header&amp;quot;&amp;gt;Syntax&amp;lt;/span&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;f_Syntax&amp;quot;&amp;gt;CONFIG LCDPIN&amp;amp;nbsp;&amp;lt;/span&amp;gt;= PIN , DB4= PN,DB5=PN, DB6=PN, DB7=PN, E=PN, RS=PN &amp;amp;nbsp;[WR=PIN] [BUSY=PIN] [MODE=mode]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;f_Syntax&amp;quot;&amp;gt;CONFIG LCDPIN&amp;amp;nbsp;&amp;lt;/span&amp;gt;= PIN , PORT=PORTx, E=PN, RS=PN&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-family: Arial;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-family: Arial;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;span class=&amp;quot;f_Header&amp;quot;&amp;gt;Remarks&amp;lt;/span&amp;gt; =&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0px; margin: 0px 0px 0px 4px;&amp;quot;&amp;gt;&lt;br /&gt;
{| width=&amp;quot;604&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;1&amp;quot; border=&amp;quot;1&amp;quot; style=&amp;quot;border: 2px solid rgb(0, 0, 0); border-spacing: 0px; border-collapse: collapse;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;vertical-align: top;&amp;quot;&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; width=&amp;quot;16%&amp;quot; style=&amp;quot;width: 93px; border: 1px solid rgb(0, 0, 0);&amp;quot; | &lt;br /&gt;
PN&lt;br /&gt;
&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; width=&amp;quot;100%&amp;quot; style=&amp;quot;width: 502px; border: 1px solid rgb(0, 0, 0);&amp;quot; | &lt;br /&gt;
The name of the PORT pin such as PORTB.2 for example.&lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;vertical-align: top;&amp;quot;&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; width=&amp;quot;16%&amp;quot; style=&amp;quot;width: 93px; border: 1px solid rgb(0, 0, 0);&amp;quot; | &lt;br /&gt;
PORTX&lt;br /&gt;
&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; width=&amp;quot;100%&amp;quot; style=&amp;quot;width: 502px; border: 1px solid rgb(0, 0, 0);&amp;quot; | &lt;br /&gt;
When you want to use the LCD in 8 bit data, pin mode, you must specify the PORT to use.&lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;vertical-align: top;&amp;quot;&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; width=&amp;quot;16%&amp;quot; style=&amp;quot;width: 93px; border: 1px solid rgb(0, 0, 0);&amp;quot; | &lt;br /&gt;
PIN&lt;br /&gt;
&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; width=&amp;quot;100%&amp;quot; style=&amp;quot;width: 502px; border: 1px solid rgb(0, 0, 0);&amp;quot; | &lt;br /&gt;
A port pin that is connected to the busy pin. The busy pin is only supported by the 20x4VFD display.&lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;vertical-align: top;&amp;quot;&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; width=&amp;quot;16%&amp;quot; style=&amp;quot;width: 93px; border: 1px solid rgb(0, 0, 0);&amp;quot; | &lt;br /&gt;
MODE&lt;br /&gt;
&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; width=&amp;quot;100%&amp;quot; style=&amp;quot;width: 502px; border: 1px solid rgb(0, 0, 0);&amp;quot; | &lt;br /&gt;
A mode for the 20x4VFD display. Options&amp;amp;nbsp;:&lt;br /&gt;
&lt;br /&gt;
0&amp;amp;nbsp;: 4 bit parallel upper nibble first&lt;br /&gt;
&lt;br /&gt;
1&amp;amp;nbsp;: 4 bit parallel lower nibble first&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-family: Arial;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can override the PIN selection from the Compiler Settings with this statement, so a second configuration lets you not choose more pins for a second LCD display.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-family: Arial;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The config command is preferred over the option settings since the code makes clear which pins are used. The CONFIG statement overrides the Options setting.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
The PIN and MODE are only for the 20x4VFD display. See also&amp;amp;nbsp;[[LCDAUTODIM]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-family: Arial;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The WR pin is optional. When you select the WR pin, an alternative library will be used. This library uses the WR pin and reads the BUSY signal from the LCD.&lt;br /&gt;
&lt;br /&gt;
The library lcd4busy_anypin will be used, which is based on Luciano's LUC_lcd4busy library.&lt;br /&gt;
&lt;br /&gt;
Notice that since 2040 version, the compiler will generate LCD port pin info which you can use for your own libs.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
By default the WR pin is optional and the WR signal of the LCD should be connected to ground. This saves the pin for other purposes. When you have enough pins, you better use the WR-pin.&lt;br /&gt;
&lt;br /&gt;
If you do not connect the WR pin to ground but to a pin, and you do not specify the WR pin, but you set the logic level to 0 in your code, you have to use an INITLCD command after you have set the WR pin to 0.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-family: Arial;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;span class=&amp;quot;f_Header&amp;quot;&amp;gt;See also&amp;lt;/span&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
[[CONFIG LCD|CONFIG LCD]]&amp;amp;nbsp;,&amp;amp;nbsp;[[CONFIG LCDMODE|CONFIG LCDMODE]]&amp;amp;nbsp;,&amp;amp;nbsp;[[CONFIG LCDBUS|CONFIG LCDBUS]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-family: Arial;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-family: Arial;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;span class=&amp;quot;f_Header&amp;quot;&amp;gt;Example&amp;lt;/span&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;source lang=&amp;quot;bascomavr&amp;quot;&amp;gt;&lt;br /&gt;
'-----------------------------------------------------------------------------------------&lt;br /&gt;
'name : lcd.bas&lt;br /&gt;
'copyright : (c) 1995-2005, MCS Electronics&lt;br /&gt;
'purpose : demo: LCD, CLS, LOWERLINE, SHIFTLCD, SHIFTCURSOR, HOME&lt;br /&gt;
' CURSOR, DISPLAY&lt;br /&gt;
'micro : Mega8515&lt;br /&gt;
'suited for demo : yes&lt;br /&gt;
'commercial addon needed : no&lt;br /&gt;
'-----------------------------------------------------------------------------------------&lt;br /&gt;
 &lt;br /&gt;
$regfile = &amp;quot;m8515.dat&amp;quot; ' specify the used micro&lt;br /&gt;
$crystal = 4000000 ' used crystal frequency&lt;br /&gt;
$baud = 19200 ' use baud rate&lt;br /&gt;
$hwstack = 32 ' default use 32 for the hardware stack&lt;br /&gt;
$swstack = 10 ' default use 10 for the SW stack&lt;br /&gt;
$framesize = 40 ' default use 40 for the frame space&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
$sim&lt;br /&gt;
'REMOVE the above command for the real program !!&lt;br /&gt;
'$sim is used for faster simulation&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
'note : tested in PIN mode with 4-bit&lt;br /&gt;
 &lt;br /&gt;
'Config Lcdpin = Pin , Db4 = Portb.1 , Db5 = Portb.2 , Db6 = Portb.3 , Db7 = Portb.4 , E = Portb.5 , Rs = Portb.6&lt;br /&gt;
Config Lcdpin = Pin , Db4 = Porta.4 , Db5 = Porta.5 , Db6 = Porta.6 , Db7 = Porta.7 , E = Portc.7 , Rs = Portc.6&lt;br /&gt;
'These settings are for the STK200 in PIN mode&lt;br /&gt;
'Connect only DB4 to DB7 of the LCD to the LCD connector of the STK D4-D7&lt;br /&gt;
'Connect the E-line of the LCD to A15 (PORTC.7) and NOT to the E line of the LCD connector&lt;br /&gt;
'Connect the RS, V0, GND and =5V of the LCD to the STK LCD connector&lt;br /&gt;
 &lt;br /&gt;
Rem with the config lcdpin statement you can override the compiler settings&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
Dim A As Byte&lt;br /&gt;
Config Lcd = 16x2 'configure lcd screen&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
'other options are 16 * 4 and 20 * 4, 20 * 2 , 16 * 1a&lt;br /&gt;
'When you dont include this option 16 * 2 is assumed&lt;br /&gt;
'16 * 1a is intended for 16 character displays with split addresses over 2 lines&lt;br /&gt;
 &lt;br /&gt;
'$LCD = address will turn LCD into 8-bit databus mode&lt;br /&gt;
' use this with uP with external RAM and/or ROM&lt;br /&gt;
' because it aint need the port pins !&lt;br /&gt;
 &lt;br /&gt;
Cls 'clear the LCD display&lt;br /&gt;
Lcd &amp;quot;Hello world.&amp;quot; 'display this at the top line&lt;br /&gt;
Wait 1&lt;br /&gt;
Lowerline 'select the lower line&lt;br /&gt;
Wait 1&lt;br /&gt;
Lcd &amp;quot;Shift this.&amp;quot; 'display this at the lower line&lt;br /&gt;
Wait 1&lt;br /&gt;
For A = 1 To 10&lt;br /&gt;
Shiftlcd Right 'shift the text to the right&lt;br /&gt;
Wait 1 'wait a moment&lt;br /&gt;
Next&lt;br /&gt;
 &lt;br /&gt;
For A = 1 To 10&lt;br /&gt;
Shiftlcd Left 'shift the text to the left&lt;br /&gt;
Wait 1 'wait a moment&lt;br /&gt;
Next&lt;br /&gt;
 &lt;br /&gt;
Locate 2 , 1 'set cursor position&lt;br /&gt;
Lcd &amp;quot;*&amp;quot; 'display this&lt;br /&gt;
Wait 1 'wait a moment&lt;br /&gt;
 &lt;br /&gt;
Shiftcursor Right 'shift the cursor&lt;br /&gt;
Lcd &amp;quot;@&amp;quot; 'display this&lt;br /&gt;
Wait 1 'wait a moment&lt;br /&gt;
 &lt;br /&gt;
Home Upper 'select line 1 and return home&lt;br /&gt;
Lcd &amp;quot;Replaced.&amp;quot; 'replace the text&lt;br /&gt;
Wait 1 'wait a moment&lt;br /&gt;
 &lt;br /&gt;
Cursor Off Noblink 'hide cursor&lt;br /&gt;
Wait 1 'wait a moment&lt;br /&gt;
Cursor On Blink 'show cursor&lt;br /&gt;
Wait 1 'wait a moment&lt;br /&gt;
Display Off 'turn display off&lt;br /&gt;
Wait 1 'wait a moment&lt;br /&gt;
Display On 'turn display on&lt;br /&gt;
'-----------------NEW support for 4-line LCD------&lt;br /&gt;
Thirdline&lt;br /&gt;
Lcd &amp;quot;Line 3&amp;quot;&lt;br /&gt;
Fourthline&lt;br /&gt;
Lcd &amp;quot;Line 4&amp;quot;&lt;br /&gt;
Home Third 'goto home on line three&lt;br /&gt;
Home Fourth&lt;br /&gt;
Home F 'first letteer also works&lt;br /&gt;
Locate 4 , 1 : Lcd &amp;quot;Line 4&amp;quot;&lt;br /&gt;
Wait 1&lt;br /&gt;
 &lt;br /&gt;
'Now lets build a special character&lt;br /&gt;
'the first number is the characternumber (0-7)&lt;br /&gt;
'The other numbers are the rowvalues&lt;br /&gt;
'Use the LCD tool to insert this line&lt;br /&gt;
 &lt;br /&gt;
Deflcdchar 1 , 225 , 227 , 226 , 226 , 226 , 242 , 234 , 228 ' replace ? with number (0-7)&lt;br /&gt;
Deflcdchar 0 , 240 , 224 , 224 , 255 , 254 , 252 , 248 , 240 ' replace ? with number (0-7)&lt;br /&gt;
Cls 'select data RAM&lt;br /&gt;
Rem it is important that a CLS is following the deflcdchar statements because it will set the controller back in datamode&lt;br /&gt;
Lcd Chr(0) ; Chr(1) 'print the special character&lt;br /&gt;
 &lt;br /&gt;
'----------------- Now use an internal routine ------------&lt;br /&gt;
_temp1 = 1 'value into ACC&lt;br /&gt;
!rCall _write_lcd 'put it on LCD&lt;br /&gt;
End&lt;br /&gt;
&amp;lt;/source&amp;gt;&amp;lt;br/&amp;gt;{{Languages}}&lt;br /&gt;
&lt;br /&gt;
[[Category:BASCOM Language Reference]]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>