HOW TO: 8x16 Display using 128x64 LCD with ST7920 driver on SPI

Hi,

I have developed a way to easily display 8 lines by 16 characters on a 128x64 Graphic LCD using a ST7920 driver chip on a SPI bus. This display is widely bought for it's graphic display capabilities, however, this device is only capable of displaying a 4x16 English font as a default display mode. (see sample sketch available from DFRobot and others.) Many developers have wished for more character display capability. This program allows the use of this device as a character display eliminating the expense of a dedicated character display.

This program requires a DFRobot DFR0091 SPI LCD module or equivalent.

This program requires the following devices:

  • A SPI enabled 128x64 LCD graphic display using the ST7920 driver chip*, such as the DFRobot DFR0091 SPI LCD module
  • An EEPROM module on I2C at 0x55*, such as the DFRobot DFR0117 EEPROM module

*see sketch comments for additional information

You will need to install two (2) sketches:

  • Install "Write_EEPROM_Data.pde" into your Arduino program directory.
  • Copy "asciiFont.h" to the Write_EEPROM_Data directory created above.
  • Install "LCD_Test.pde" into your Arduino program directory.

After you have installed the above sketches:

  • Using Arduino IDE 022, load and run Write_EEPROM_Data to write font data to EEPROM.
  • Using Arduino IDE 022, load and run LCD_Test.

*** This software is free public domain. It is offered AS-IS, no warranty or guarantee of any kind, USE AT YOUR OWN RISK. ***


Good Luck,
Dr. Sandy Teller
MRL Robotics

Write_EEPROM_Data.pde (2.97 KB)

asciiFont.h (9.88 KB)

LCD__Test.pde (5.49 KB)

This is a more appropriate place to post your product:

http://arduino.cc/forum/index.php/board,25.0.html

Since there are 128 pixels in a row and regular 7*5 dot matrix characters use 6 pixels wide, you can go up to 21 characters in a row, can't you? So why the 16?

liudr,

Unfortunately the arduino ide does not allow bit arrays. This would allow for individual pixel placement. Since we are restricted by the ST7920 driver chip all write operations require 8 bits of data, a byte, hence the use of a 8x8 font. Please download and view the pde file for more information. The sketch is fully commented.

Please note that this was written to accommodate the arduino ide without resorting to avr code.
This is not a product, only software to utilize a specific LCD display with a ST7920 driver chip.

liudr:
This is a more appropriate place to post your product:

http://arduino.cc/forum/index.php/board,25.0.html

Dr. Sandy Teller
MRL Robotics

Since there are 128 pixels in a row and regular 7*5 dot matrix characters use 6 pixels wide, you can go up to 21 characters in a row, can't you? So why the 16?

If you have some videos, you can post on the exhibition forum. A few video clips will motivate people to go get the hardware for a try. I though you made those displays :blush:

Hi There,

The ability to do 8 (or at least 6) lines of text on this display was just what I was after. Where are the referenced files though?

Install "Write_EEPROM_Data.pde" into your Arduino program directory.
Copy "asciiFont.h" to the Write_EEPROM_Data directory created above.
Install "LCD_Test.pde" into your Arduino program directory.

Am I missing something?

Regards,

Karl

Hi
I just want to mention, that u8glib supports the ST7920 and you can use any of the fonts from here: Google Code Archive - Long-term storage for Google Code Project Hosting..
Of course you could have the 21 chars per row...
Oliver

Thanks Oliver, that was exactly what I was looking for! It works great; much appreciated :smiley:

Unfortunately the arduino ide does not allow bit arrays.
...
Please note that this was written to accommodate the arduino ide without resorting to avr code.

Could you explain this more fully?

Don