⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hd44780.docbook

📁 linux下LCD驱动的例子代码
💻 DOCBOOK
📖 第 1 页 / 共 4 页
字号:
</para><para>If you want to connect more than two displays to the parallel port thenwire D5 (pin 7) to the enable line (pin 6) of the third LCD. Then fordisplays four to seven use:</para><table><title>HD44780: 4-bit Pinouts (2)</title><tgroup cols="2">  <thead>    <row>      <entry>printer port</entry>      <entry>LCD</entry>    </row>  </thead>  <tbody>    <row>      <entry>STR (1)</entry>      <entry>EN4</entry>    </row>    <row>      <entry>LF (14)</entry>      <entry>EN5</entry>    </row>    <row>      <entry>INIT (16)</entry>      <entry>EN6</entry>    </row>    <row>      <entry>SEL (17)</entry>      <entry>EN7</entry>    </row>  </tbody></tgroup></table><para>The optional keypad can be connected as follows:</para><table><title>HD44780: 4-bit Keypad Pinouts</title><tgroup cols="2">  <thead>    <row>      <entry>printer port</entry>      <entry>LCD</entry>  </row>  </thead>  <tbody>    <row>      <entry>D0 (2)</entry>      <entry>Y0</entry>    </row>    <row>      <entry>D1 (3)</entry>      <entry>Y1</entry>    </row>    <row>      <entry>D2 (4)</entry>      <entry>Y2</entry>    </row>    <row>      <entry>D3 (5)</entry>      <entry>Y3</entry>    </row>    <row>      <entry>D4 (6)</entry>      <entry>Y4</entry>    </row>    <row>      <entry>D5 (7)</entry>      <entry>Y5</entry>    </row>    <row>      <entry>nSTRB (1)</entry>      <entry>Y6</entry>    </row>    <row>      <entry>nLF  (14)</entry>      <entry>Y7</entry>    </row>    <row>      <entry>INIT (16)</entry>      <entry>Y8</entry>    </row>    <row>      <entry>nSEL (17)</entry>      <entry>Y9</entry>    </row>    <row>      <entry>nACK (10)</entry>      <entry>X0</entry>    </row>    <row>      <entry>BUSY (11)</entry>      <entry>X1</entry>    </row>    <row>      <entry>PAPEREND (12)</entry>      <entry>X2</entry>    </row>    <row>      <entry>SELIN (13)</entry>      <entry>X3</entry>    </row>    <row>      <entry>nFAULT (15)</entry>      <entry>X4</entry>    </row>  </tbody></tgroup></table><para>The optional backlight wiring should be connected to D5, pin 7.</para></sect3><sect3 id="hd44780-8-bit-winamp"><title>8-bit "Winamp"</title><para>This type of connection should work with winamp.</para><table><title>HD44780: "Winamp" wiring</title><tgroup cols="2">  <thead>    <row>      <entry>printer port</entry>      <entry>LCD</entry>    </row>  </thead>  <tbody>    <row>      <entry>D0 (2)</entry>      <entry>D0 (7)</entry>    </row>    <row>      <entry>D1 (3)</entry>      <entry>D1 (8)</entry>    </row>    <row>      <entry>D2 (4)</entry>      <entry>D2 (9)</entry>    </row>    <row>      <entry>D3 (5)</entry>      <entry>D3 (10)</entry>    </row>    <row>      <entry>D4 (6)</entry>      <entry>D4 (11)</entry>    </row>    <row>      <entry>D5 (7)</entry>      <entry>D5 (12)</entry>    </row>    <row>      <entry>D6 (8)</entry>      <entry>D6 (13)</entry>    </row>    <row>      <entry>D7 (9)</entry>      <entry>D7 (14)</entry>    </row>    <row>      <entry>nSTRB (1)</entry>      <entry>EN (6)</entry>    </row>    <row>      <entry>nLF (14)</entry>      <entry>nRW (5) (EN3 6 - LCD 3) (optional (*) )</entry>    </row>    <row>      <entry>INIT (16)</entry>      <entry>RS (4)</entry>    </row>    <row>      <entry>nSEL (17)</entry>      <entry>EN2 (6 - LCD 2) (optional)</entry>    </row>  </tbody></tgroup></table><para>(*) on the RW line of the display: this line decides whether the display receives data from the LPT port, or whether it sends data to the LPT port. If grounded, it receives. If High or connected to nothing at all, it "sends" (i.e., will not work as intended). So, if you are not sure that you need it otherwise, then connect it to GND. This certainly applies if you have only one display.</para><para>If you want the display to work with the Winamp plugin, wire nLF (pin 14)to nRW of your LCD. You can then use the plugin in bidirectional mode (wichis much faster). With 3 connected LCDs this is not possible.Note from Benjamin: I haven't tried using winamp while having the third LCDconnected to this line.</para><para>The optional keypad can be connected as follows:</para><table><title>HD44780: "Winamp" wiring - Keypad</title><tgroup cols="2">  <thead>    <row>      <entry>printer port</entry>      <entry>keypad</entry>    </row>  </thead>  <tbody>    <row>      <entry>D0 (2)</entry>      <entry>Y0</entry>    </row>    <row>      <entry>D1 (3)</entry>      <entry>Y1</entry>    </row>    <row>      <entry>D2 (4)</entry>      <entry>Y2</entry>    </row>    <row>      <entry>D3 (5)</entry>      <entry>Y3</entry>    </row>    <row>      <entry>D4 (6)</entry>      <entry>Y4</entry>    </row>    <row>      <entry>D5 (7)</entry>      <entry>Y5</entry>    </row>    <row>      <entry>D6 (8)</entry>      <entry>Y6</entry>    </row>    <row>      <entry>D7 (9)</entry>      <entry>Y7</entry>    </row>    <row>      <entry>nLF (14)</entry>      <entry>Y8</entry>    </row>    <row>      <entry>INIT (16)</entry>      <entry>Y9</entry>    </row>    <row>      <entry>nACK (10)</entry>      <entry>X0</entry>    </row>    <row>      <entry>BUSY (11)</entry>      <entry>X1</entry>    </row>    <row>      <entry>PAPEREND (12)</entry>      <entry>X2</entry>    </row>    <row>      <entry>SELIN (13)</entry>      <entry>X3</entry>    </row>    <row>      <entry>nFAULT (15)</entry>      <entry>X4</entry>    </row>  </tbody></tgroup></table><para>The optional backlight wiring should be connected to nSEL, pin 17.</para></sect3><sect3 id="hd44780-8-bit-lcdtime"><title>8-bit "lcdtime"</title><para>This is originally based on "lcdtime" (by Benjamin Tse<email>blt@ComPorts.com</email>) and allows you to combine the LCD with a LEDbargraph. The LCD is driven by LCDproc and the LEDs by another programsuch as portato. Further details can be obtained from:</para><para><ulink url="http://metalab.unc.edu/pub/linux/system/status/lcdtime-0.2.tar.gz">http://metalab.unc.edu/pub/linux/system/status/lcdtime-0.2.tar.gz</ulink><ulink url="http://metalab.unc.edu/pub/linux/system/status/meter-0.2.tar.gz">http://metalab.unc.edu/pub/linux/system/status/meter-0.2.tar.gz</ulink><ulink url="http://metalab.unc.edu/pub/linux/system/status/portato-1.2.tar.gz">http://metalab.unc.edu/pub/linux/system/status/portato-1.2.tar.gz</ulink></para><note><para>Theoretically this wiring sends the data over twice as slow as thewinamp or ext8bit wirings, because it only sends 4 bits at a time.</para></note><para>The LCD connections are:</para><table><title>HD44780: "lcdtime" wiring</title><tgroup cols="2">  <thead>    <row>      <entry>printer port</entry>      <entry>LCD</entry>    </row>  </thead>  <tbody>    <row>      <entry>D0 (2)</entry>      <entry>D0 (7)</entry>    </row>    <row>      <entry>D1 (3)</entry>      <entry>D1 (8)</entry>    </row>    <row>      <entry>D2 (4)</entry>      <entry>D2 (9)</entry>    </row>    <row>      <entry>D3 (5)</entry>      <entry>D3 (10)</entry>    </row>    <row>      <entry>D4 (6)</entry>      <entry>D4 (11)</entry>    </row>    <row>      <entry>D5 (7)</entry>      <entry>D5 (12)</entry>    </row>    <row>      <entry>D6 (8)</entry>      <entry>D6 (13)</entry>    </row>    <row>      <entry>D7 (9)</entry>      <entry>D7 (14)</entry>    </row>    <row>      <entry>nSEL (17)</entry>      <entry>-</entry>    </row>    <row>      <entry>nSTRB (1)</entry>      <entry>RS (4)</entry>    </row>    <row>      <entry>nLF (14)</entry>      <entry>RW (5) (LCD2 - 6) (optional - pull all LCD RW low (*))</entry>    </row>    <row>      <entry>INIT (16)</entry>      <entry>EN (6)</entry>    </row>  </tbody></tgroup></table><para>(*) on the RW line of the display: this line decides whether the display receives data from the LPT port, or whether it sends data to the LPT port. If grounded, it receives. If High or connected to nothing at all, it "sends" (i.e., will not work as intended). So, if you are not sure that you need it otherwise, then connect it to GND. This certainly applies if you have only one display.</para><para>See the lcdtime tar-ball (above) for full details of the bargraphconnections.</para><para>The optional keypad can be connected as follows:</para><table><title>HD44780: "lcdtime" wiring - keypad</title><tgroup cols="2">  <thead>    <row>      <entry>printer port</entry>      <entry>keypad</entry>    </row>  </thead>  <tbody>    <row>      <entry>D0 (2)</entry>      <entry>Y0</entry>    </row>    <row>      <entry>D1 (3)</entry>      <entry>Y1</entry>    </row>    <row>      <entry>D2 (4)</entry>      <entry>Y2</entry>    </row>    <row>      <entry>D3 (5)</entry>      <entry>Y3</entry>    </row>    <row>      <entry>D4 (6)</entry>      <entry>Y4</entry>    </row>    <row>      <entry>D5 (7)</entry>      <entry>Y5</entry>    </row>    <row>      <entry>D6 (8)</entry>      <entry>Y6</entry>    </row>    <row>      <entry>D7 (9)</entry>      <entry>Y7</entry>    </row>    <row>      <entry>nSTRB (1)</entry>      <entry>Y8</entry>    </row>    <row>      <entry>nSEL (17)</entry>      <entry>Y9</entry>    </row>    <row>      <entry>nACK (10)</entry>      <entry>X0</entry>    </row>    <row>      <entry>BUSY (11)</entry>      <entry>X1</entry>    </row>    <row>      <entry>PAPEREND (12)</entry>      <entry>X2</entry>    </row>    <row>      <entry>SELIN (13)</entry>      <entry>X3</entry>    </row>    <row>      <entry>nFAULT (15)</entry>      <entry>X4</entry>    </row>  </tbody></tgroup></table><para>The backlight wiring should be attached to nSEL, pin 17. Because the portatoprogram (mentioned above) also uses this pin to control the bargraph, youcannot use the backlight control together with the bargraph.</para></sect3><sect3 id="hd44780-seriallpt"><title>Serial LPT</title><para>This interface uses a handful of wires to interface to theHD44780. Suitable for high noise, long connections. Designed byAndrew McMeikan <email>andrewm@engineer.com</email>. The original wiring anddriver can be found at:</para><para><ulink url="http://members.xoom.com/andrewmuck">http://members.xoom.com/andrewmuck</ulink></para><para>I (Joris) have extended this driver and the wiring a bit. It now supportskeys again (it had earlier supported keys, but some time did not).</para><para>Further I have extended the driver and the wiring to be able to run

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -