<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://miosix.org/wiki/index.php?action=history&amp;feed=atom&amp;title=HD44780_LCD_tutorial</id>
	<title>HD44780 LCD tutorial - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://miosix.org/wiki/index.php?action=history&amp;feed=atom&amp;title=HD44780_LCD_tutorial"/>
	<link rel="alternate" type="text/html" href="https://miosix.org/wiki/index.php?title=HD44780_LCD_tutorial&amp;action=history"/>
	<updated>2026-04-15T00:40:19Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.3</generator>
	<entry>
		<id>https://miosix.org/wiki/index.php?title=HD44780_LCD_tutorial&amp;diff=116&amp;oldid=prev</id>
		<title>Fede.tft at 22:11, 27 April 2014</title>
		<link rel="alternate" type="text/html" href="https://miosix.org/wiki/index.php?title=HD44780_LCD_tutorial&amp;diff=116&amp;oldid=prev"/>
		<updated>2014-04-27T22:11:28Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 22:11, 27 April 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l53&quot;&gt;Line 53:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 53:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;#039;&amp;#039;go(int x, int y)&amp;#039;&amp;#039; moves the cursor to the specified position&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;#039;&amp;#039;go(int x, int y)&amp;#039;&amp;#039; moves the cursor to the specified position&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;#039;&amp;#039;printf()&amp;#039;&amp;#039; prints to the display, using the standard C formatting rules.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;#039;&amp;#039;printf()&amp;#039;&amp;#039; prints to the display, using the standard C formatting rules.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;== Thread safety considerations ==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;The &#039;&#039;Lcd44780&#039;&#039; is not thread-safe. Concurrent access from multiple threads requires the use of a mutex to protect it against concurrent accesses.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Examples ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Examples ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Fede.tft</name></author>
	</entry>
	<entry>
		<id>https://miosix.org/wiki/index.php?title=HD44780_LCD_tutorial&amp;diff=114&amp;oldid=prev</id>
		<title>Fede.tft at 11:08, 25 April 2014</title>
		<link rel="alternate" type="text/html" href="https://miosix.org/wiki/index.php?title=HD44780_LCD_tutorial&amp;diff=114&amp;oldid=prev"/>
		<updated>2014-04-25T11:08:28Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 11:08, 25 April 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l64&quot;&gt;Line 64:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 64:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[File:Vfd44780.jpg]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[File:Vfd44780.jpg]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;== Related pages ==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* [[Example: HD44780|HD44780 Example]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:API]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:API]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Fede.tft</name></author>
	</entry>
	<entry>
		<id>https://miosix.org/wiki/index.php?title=HD44780_LCD_tutorial&amp;diff=112&amp;oldid=prev</id>
		<title>Fede.tft: Created page with &quot;Include statements and namespace required to use this library &lt;source lang=&quot;CPP&quot;&gt; #include &lt;util/lcd44780.h&gt; using namespace miosix; &lt;/source&gt; This is a C++ library, it cannot...&quot;</title>
		<link rel="alternate" type="text/html" href="https://miosix.org/wiki/index.php?title=HD44780_LCD_tutorial&amp;diff=112&amp;oldid=prev"/>
		<updated>2014-04-25T11:04:42Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Include statements and namespace required to use this library &amp;lt;source lang=&amp;quot;CPP&amp;quot;&amp;gt; #include &amp;lt;util/lcd44780.h&amp;gt; using namespace miosix; &amp;lt;/source&amp;gt; This is a C++ library, it cannot...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Include statements and namespace required to use this library&lt;br /&gt;
&amp;lt;source lang=&amp;quot;CPP&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;util/lcd44780.h&amp;gt;&lt;br /&gt;
using namespace miosix;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This is a C++ library, it cannot be used from a C source file.&lt;br /&gt;
&lt;br /&gt;
The [https://en.wikipedia.org/wiki/HD44780_Character_LCD HD44780] is a standard controller for alphanumeric LCD displays. Miosix supports these displays through the &amp;#039;&amp;#039;Lcd44780&amp;#039;&amp;#039; class.&lt;br /&gt;
&lt;br /&gt;
== Hardware connections ==&lt;br /&gt;
&lt;br /&gt;
The connection to the display requires 6 GPIOs connected to the display. Here are the LCD pinout connections&lt;br /&gt;
* Pin 1: GND, connect to ground&lt;br /&gt;
* Pin 2: VCC, connect to a 5V power supply. Some displays may also work with 3.3V&lt;br /&gt;
* Pin 3: Contrast adjustment, connect the center tap of a potentiometer with the other two ends connected to VCC and GND&lt;br /&gt;
* Pin 4: RS, connect to a GPIO&lt;br /&gt;
* Pin 5: RW. the Miosix driver requires to connect this pin to ground&lt;br /&gt;
* Pin 6: E, connecto to a GPIO&lt;br /&gt;
* Pin 7: D0, leave unconnected or connect to VCC&lt;br /&gt;
* Pin 8: D1, leave unconnected or connect to VCC&lt;br /&gt;
* Pin 9: D2, leave unconnected or connect to VCC&lt;br /&gt;
* Pin 10: D3, leave unconnected or connect to VCC&lt;br /&gt;
* Pin 11: D4, connect to a GPIO&lt;br /&gt;
* Pin 12: D5, connect to a GPIO&lt;br /&gt;
* Pin 13: D6, connect to a GPIO&lt;br /&gt;
* Pin 14: D7, connect to a GPIO&lt;br /&gt;
&lt;br /&gt;
Additionally, some display may have two more pins to power a backlight, as LCDs cannot be seen in the dark.&lt;br /&gt;
&lt;br /&gt;
== Software interfacing ==&lt;br /&gt;
&lt;br /&gt;
To use the LCD with Miosix, you first have to connect the 6 pins of the LCD to GPIOs on your board. Any GPIO can be used, so long as it is a free GPIO not used for something else. Then you have to declare the GPIOs in your program as explained in the [[GPIO tutorial]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;CPP&amp;quot;&amp;gt;&lt;br /&gt;
typedef Gpio&amp;lt;GPIOB_BASE,12&amp;gt; d4;&lt;br /&gt;
typedef Gpio&amp;lt;GPIOB_BASE,13&amp;gt; d5;&lt;br /&gt;
typedef Gpio&amp;lt;GPIOB_BASE,14&amp;gt; d6;&lt;br /&gt;
typedef Gpio&amp;lt;GPIOB_BASE,15&amp;gt; d7;&lt;br /&gt;
typedef Gpio&amp;lt;GPIOC_BASE,1&amp;gt; rs;&lt;br /&gt;
typedef Gpio&amp;lt;GPIOC_BASE,2&amp;gt; e;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can then declare an instance of the &amp;#039;&amp;#039;Lcd44780&amp;#039;&amp;#039; class, whose constructor takes 8 parameters: the 6 GPIOs (in te following order: RS, E, D4, D5, D6, D7), and the number of rows and columns of the display. The most common display type is 2 lines by 16 columns.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;CPP&amp;quot;&amp;gt;&lt;br /&gt;
Lcd44780 display(rs::getPin(),e::getPin(),d4::getPin(),d5::getPin(),d6::getPin(),d7::getPin(),2,16);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;getPin()&amp;#039;&amp;#039; member function of the GPIO class returns an object that allows to pass GPIOs as arguments to a function.&lt;br /&gt;
&lt;br /&gt;
Once you have an instance of the &amp;#039;&amp;#039;Lcd44780&amp;#039;&amp;#039;, which in the example above is called &amp;#039;&amp;#039;display&amp;#039;&amp;#039;, you can call the following member functions on it:&lt;br /&gt;
* &amp;#039;&amp;#039;clear()&amp;#039;&amp;#039; clears the display&lt;br /&gt;
* &amp;#039;&amp;#039;go(int x, int y)&amp;#039;&amp;#039; moves the cursor to the specified position&lt;br /&gt;
* &amp;#039;&amp;#039;printf()&amp;#039;&amp;#039; prints to the display, using the standard C formatting rules.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
An example program for driving an HD44780-compatible display can be found in the &amp;#039;&amp;#039;mioisx/_examples/hd44780&amp;#039;&amp;#039; directory.&lt;br /&gt;
&lt;br /&gt;
[[File:Lcd44780.jpg]]&lt;br /&gt;
&lt;br /&gt;
Note that you are not restricted to LCD display, there are other display technologies that are HD44780-compatible, for example some [https://en.wikipedia.org/wiki/Vacuum_fluorescent_display VFD] displays like this work as well&lt;br /&gt;
&lt;br /&gt;
[[File:Vfd44780.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:API]]&lt;/div&gt;</summary>
		<author><name>Fede.tft</name></author>
	</entry>
</feed>