<?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=LCD4E2</id>
		<title>LCD4E2 - 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=LCD4E2"/>
		<link rel="alternate" type="text/html" href="http://wiki.mcselec.com/bavr/index.php?title=LCD4E2&amp;action=history"/>
		<updated>2026-04-18T05:53:36Z</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=LCD4E2&amp;diff=1213&amp;oldid=prev</id>
		<title>Admin: Created page with &quot;The built in LCD driver for the PIN mode is written to support a worst case scenario where you use random pins of the microprocessor to drive the LCD pins.  &lt;span style=&quot;font-...&quot;</title>
		<link rel="alternate" type="text/html" href="http://wiki.mcselec.com/bavr/index.php?title=LCD4E2&amp;diff=1213&amp;oldid=prev"/>
				<updated>2013-02-13T10:07:38Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;The built in LCD driver for the PIN mode is written to support a worst case scenario where you use random pins of the microprocessor to drive the LCD pins.  &amp;lt;span style=&amp;quot;font-...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;The built in LCD driver for the PIN mode is written to support a worst case scenario where you use random pins of the microprocessor to drive the LCD pins.&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;
This makes it easy to design your PCB but it needs more code.&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;
When you want to have less code you need fixed pins for the LCD display.&lt;br /&gt;
&lt;br /&gt;
With the statement $LIB &amp;quot;LCD4E2.LBX&amp;quot; you specify that the LCD4.LIB will be used.&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 following connections are used in the asm code:&lt;br /&gt;
&lt;br /&gt;
Rs = PortB.0&lt;br /&gt;
&lt;br /&gt;
RW = PortB.1 we don’t use the R/W option of the LCD in this version so connect to ground&lt;br /&gt;
&lt;br /&gt;
E = PortB.2&lt;br /&gt;
&lt;br /&gt;
E2 = PortB.3 the second E pin of the LCD&lt;br /&gt;
&lt;br /&gt;
Db4 = PortB.4 the data bits must be in a nibble to save code&lt;br /&gt;
&lt;br /&gt;
Db5 = PortB.5&lt;br /&gt;
&lt;br /&gt;
Db6 = PortB.6&lt;br /&gt;
&lt;br /&gt;
Db7 = PortB.7&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;
You can change the lines from the lcd4e2.lib file to use another port.&lt;br /&gt;
&lt;br /&gt;
Just change the address used&amp;amp;nbsp;:&lt;br /&gt;
&lt;br /&gt;
.EQU LCDDDR=$17&amp;amp;nbsp;; change to another address for DDRD ($11)&lt;br /&gt;
&lt;br /&gt;
.EQU LCDPORT=$18&amp;amp;nbsp;; change to another address for PORTD ($12)&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;
See the demo lcdcustom4bit2e.bas in the SAMPLES dir.&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;
Note that you still must select the display that you use with the&amp;amp;nbsp;[[CONFIG LCD|CONFIG LCD]]&amp;amp;nbsp;statement.&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;
See also the&amp;amp;nbsp;[[LCD4.LIB|lcd4.lib]]&amp;amp;nbsp;for driving a display with 1 E line.&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;
A display with 2 E lines actually is a display with 2 control chips. They must both be controlled. This library allows you to select the active E line from your code.&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;
In your basic code you must first select the E line before you use a LCD statement.&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 initialization of the display will handle both chips.&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;
Note that LBX is a compiled LIB file. In order to change the routines you need the commercial edition with the source code(lib files). After a change you should compile the library with the library manager.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;{{Languages}}&lt;br /&gt;
&lt;br /&gt;
[[Category:LCD]]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>