Pages: [1]   Go Down
Author Topic: HOW TO: 8x16 Display using 128x64 LCD with ST7920 driver on SPI  (Read 3706 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 - downloaded 43 times.)
* asciiFont.h (9.88 KB - downloaded 81 times.)
* LCD__Test.pde (5.49 KB - downloaded 69 times.)
Logged

Central MN, USA
Online Online
Tesla Member
***
Karma: 73
Posts: 7189
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

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?
Logged

Central MN, USA
Online Online
Tesla Member
***
Karma: 73
Posts: 7189
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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  smiley-red

Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Germany
Offline Offline
Edison Member
*
Karma: 136
Posts: 1479
If you believe something is right, you won't see what's wrong (David Straker).
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi
I just want to mention, that u8glib supports the ST7920 and you can use any of the fonts from here: http://code.google.com/p/u8glib/wiki/fontsize.
Of course you could have the 21 chars per row...
Oliver
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 35
Posts: 4299
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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
Logged

Pages: [1]   Go Up
Jump to: