This shows you the differences between two versions of the page.
arduino:spilcd_driver_library [2019/01/15 10:02] tony |
arduino:spilcd_driver_library [2023/03/12 21:58] (current) tony |
||
---|---|---|---|
Line 8: | Line 8: | ||
<a href="/dokuwiki/_detail//electronic/lcd/p8250907a.jpg" class="media"><img width="45%" src="/dokuwiki/_media//electronic/lcd/p8250907a.jpg" class="media" title="Panasonic KX-T7730" alt="Panasonic KX-T7730" /></a> <a href="/dokuwiki/_detail/arduino/spilcd/pc143172a.jpg" class="media"><img width="33%" src="/dokuwiki/_media/arduino/spilcd/pc143172a.jpg" class="media" title="Brother Fax-645" alt="Brother Fax-645" /></a> | <a href="/dokuwiki/_detail//electronic/lcd/p8250907a.jpg" class="media"><img width="45%" src="/dokuwiki/_media//electronic/lcd/p8250907a.jpg" class="media" title="Panasonic KX-T7730" alt="Panasonic KX-T7730" /></a> <a href="/dokuwiki/_detail/arduino/spilcd/pc143172a.jpg" class="media"><img width="33%" src="/dokuwiki/_media/arduino/spilcd/pc143172a.jpg" class="media" title="Brother Fax-645" alt="Brother Fax-645" /></a> | ||
<div class="container"> | <div class="container"> | ||
- | <a href="/dokuwiki/electronic/lcd/dzyc0543">SPI LCD panels that use a Hitachi HD44780 compatible controller</a> | + | <a href="/dokuwiki/electronic/lcd/c7g045">SPI LCD panels that use a Hitachi HD44780 compatible controller</a><br> |
+ | <a href="/dokuwiki/electronic/lcd/b53K4631">SPI LCD panels that use a Hitachi HD44780 compatible controller</a> | ||
</div> | </div> | ||
</div> | </div> | ||
Line 20: | Line 21: | ||
I based my library module for this on a standard Arduino library for the Hitachi HD44780 chip, LiquidCrystal.cpp. The programs included here are HelloWorld_SPI.ino, LiquidCrystal_SPI.cpp and LiquidCrystal_SPI.h. | I based my library module for this on a standard Arduino library for the Hitachi HD44780 chip, LiquidCrystal.cpp. The programs included here are HelloWorld_SPI.ino, LiquidCrystal_SPI.cpp and LiquidCrystal_SPI.h. | ||
- | The command set is compatible with the Hitachi HD44780, but I don't know the model of the chip, or even the manufacturer. | + | The command set is compatible with the Hitachi HD44780, but I don't know the model of the chip, or even the manufacturer. |
===== Hardware description ===== | ===== Hardware description ===== | ||
- | The controller is mounted directly on the LCD glass, and the LCD module has a 6 pin, 1mm pitch, pcb flex cable. The displays are a single line of sixteen, 5 by 8 pixel, characters. | + | The controller is mounted directly on the LCD glass, and the LCD module has a 6 pin, 1mm pitch, PCB flex cable. The displays are a single line of sixteen, 5 by 8 pixel, characters. |
{{:arduino:spilcd:pc173298a.jpg?50 |SPI LCD pixel layout}}The two modules have different character sets, but the characters in common tend to have exactly the same font design, so they may have the same manufacturer. I experimented a little, but could not get either module to display an 5 by 11 character mode. | {{:arduino:spilcd:pc173298a.jpg?50 |SPI LCD pixel layout}}The two modules have different character sets, but the characters in common tend to have exactly the same font design, so they may have the same manufacturer. I experimented a little, but could not get either module to display an 5 by 11 character mode. | ||
Line 41: | Line 42: | ||
There is no "busy" pin, so delays between commands are necessary to give sufficient time for internal processing. | There is no "busy" pin, so delays between commands are necessary to give sufficient time for internal processing. | ||
- | There was no contrast adjustment on these modules (may be a command programmable feature). | + | There was no contrast adjustment on these modules (maybe a command programmable feature). |
- | The data pins can be any available Arduino pins. | + | The data pins can be any available Arduino pins. |
- | ===== SPI LCD Library ===== | + | ===== SPI LCD library ===== |
As mentioned earlier the library is based on a standard Arduino HD44780 LCD library. Most hardware commands, including programmable characters, seem to be compatible with the HD44780, but I would need to do a lot of experimentation to find any extended commands. | As mentioned earlier the library is based on a standard Arduino HD44780 LCD library. Most hardware commands, including programmable characters, seem to be compatible with the HD44780, but I would need to do a lot of experimentation to find any extended commands. | ||
Line 87: | Line 88: | ||
There didn't seem to be any need for 4/8 bit interface selection. It is conceivable that the display controller chip might support 4/8 bit modes, but no account of this possibility is included in this driver. So initialisation is simplified. | There didn't seem to be any need for 4/8 bit interface selection. It is conceivable that the display controller chip might support 4/8 bit modes, but no account of this possibility is included in this driver. So initialisation is simplified. | ||
- | When writing data to be displayed on the LCD screen it would be more efficient to assert SS, send a positioning command and then a stream of bytes, and de-assert SS when complete. But this driver has a, print.h library compatible, single character output routine, 'write', which is used to output one character at a time, each preceded by a display-on command. | + | When writing data to be displayed on the LCD screen it would be more efficient to assert SS, send a positioning command and then a stream of bytes, and de-assert SS when complete. But this driver has a, print.h library compatible, single-character output routine, 'write', which is used to output one character at a time, each preceded by a display-on command. |
- | The original firmware sent an extra code, 0xf8, during startup. On a HD44780 chip this would just be a cursor positioning command (to set data cursor to location 0x78), but this would not be a displayable location, and no data is sent to be displayed. It appears that this may be a reset or other initialisation command. | + | The original firmware sent an extra code, 0xf8, during startup. On an HD44780 chip this would just be a cursor positioning command (to set data cursor to location 0x78), but this would not be a displayable location, and no data is sent to be displayed. It appears that this may be a reset or other initialisation command. |
I finally realised why I sometimes had trouble setting the programmable characters (only 4 available on these chips) - after setting a programmable character future writes also go to the programmable character CGRAM (corrupting it) until you deliberately switch back to the display ram. This is a problem from the original LiquidCrystal.h library - the solution here is that I just reset the cursor to the home location after programming characters. | I finally realised why I sometimes had trouble setting the programmable characters (only 4 available on these chips) - after setting a programmable character future writes also go to the programmable character CGRAM (corrupting it) until you deliberately switch back to the display ram. This is a problem from the original LiquidCrystal.h library - the solution here is that I just reset the cursor to the home location after programming characters. | ||
Line 116: | Line 117: | ||
* [[https://playground.arduino.cc/Code/LCD|Arduino LCD display drivers]] | * [[https://playground.arduino.cc/Code/LCD|Arduino LCD display drivers]] | ||
- | |||
* [[https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home|New LiquidCrystal]] | * [[https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home|New LiquidCrystal]] | ||
- | |||
* [[https://github.com/adafruit/Adafruit-RGB-LCD-Shield-Library/blob/master/Adafruit_RGBLCDShield.cpp|Adafruit RGB LCD Shield-Library | * [[https://github.com/adafruit/Adafruit-RGB-LCD-Shield-Library/blob/master/Adafruit_RGBLCDShield.cpp|Adafruit RGB LCD Shield-Library | ||
]]. | ]]. | ||
+ | * [[:arduino:ks0073 driver library|KS0073 SPI LCD]], LCD display panel Arduino driver | ||
* [[:arduino:metp0000 driver library|METP0000]], NEC µPD7225 based LCD display panel Arduino driver | * [[:arduino:metp0000 driver library|METP0000]], NEC µPD7225 based LCD display panel Arduino driver | ||
+ | * [[:arduino:mx300 driver library|Canon MX300]], Canon MX300/310 printer LCD display panel Arduino driver. | ||
* [[:arduino:uPD7228 driver library|NEC µPD7228]] and μPD16434 LCD display panels Arduino driver | * [[:arduino:uPD7228 driver library|NEC µPD7228]] and μPD16434 LCD display panels Arduino driver | ||
- | |||
* [[:arduino:t6a34 driver library|Toshiba T6A34]] SPI, HD44780 compatible, LCD display panel Arduino driver | * [[:arduino:t6a34 driver library|Toshiba T6A34]] SPI, HD44780 compatible, LCD display panel Arduino driver | ||