Low Power 2.4 Inch 128x64 ST7565 Serial LCD Display (HCMODU0245)

LCD, TFT, OLED, LED modules
admin
Site Admin
Posts: 880
Joined: Sun Aug 05, 2012 4:02 pm

Low Power 2.4 Inch 128x64 ST7565 Serial LCD Display (HCMODU0245)

Post by admin » Fri Mar 08, 2024 9:47 am

Image




This 2.4” LCD monochrome ultra-low power graphical display has a resolution of 128x64 pixels with a pixel colour of black on a transflective background.

For interfacing via a microcontroller the display uses an ST7565 serial controller consisting of a single clock and data pin for communication plus chip select and data/command pins for control. These pins plus power and reset are all available via a soldered 8 pin 0.1” header.

This display is ideal for low power battery applications and when in use draws <1mA of current, meaning it is even possible to directly power it via a GPIO pin of most microcontrollers.

For Arduino users this module is supported by our HCDisplay library. See bottom of this post for more information.


NOTES:
The module uses a transflective display which is best used in well lit/outdoor conditions. It does not include a backlight therefore it is not recommended for use in low light environments.

This is a 3.3V display. If using with a 5V microcontroller level shifters must be used.


Specification:
Product code: HCMODU0245
Supply voltage: 3.3V
Supply current: <1mA
Screen size: 2.4”
Display controller: ST7565
Interface: Serial SPI (clock, data, chip select, data/command select, reset)
Interface header: 8 pin 0.1” SIL header
Outer LCD size: 50mm x 36.5mm
Module size: 53mm x 45mm



Arduino Example:


Image


  1. /* File:    HCDisplay_Hello_World.ino
  2.  * Version: 1.0
  3.  *
  4.  * This is a simple sketch to demonstrate how to print text at specified locations
  5.  * on the display. The sketch also shows how to change font style and
  6.  * foreground/background colour.
  7.  *
  8.  * IMPORTANT: To use this sketch you must first select your display type
  9.  * by opening up the Options.txt file (found the HCDisplay library folder)
  10.  * in a text editor and uncommenting the line:
  11.  *
  12.  * #define ST7565
  13.  *
  14.  * Please see Lincence.txt file in the library folder for terms of use
  15.  */
  16.  
  17.  
  18. #include "HCDisplay.h"
  19.  
  20. // Default pins
  21. #define CE_PIN      A0
  22. #define DC_PIN      A1
  23. #define CLK_PIN     A2
  24. #define DIN_PIN     A3
  25. //#define RST_PIN   2  // Optional reset pin
  26.  
  27. HCDisplay HCDisplay;    //Creates an instance of the HCDisplay library
  28.  
  29. unsigned int MaxX, MaxY;
  30. boolean FGColour = 1;
  31.  
  32.  
  33.  
  34. void setup()
  35. {
  36.   // Initialise the display - Note HCMODU0246 must be reset after powering up!
  37.   HCDisplay.Init(DIN_PIN, CLK_PIN, CE_PIN, DC_PIN /*, RST_PIN*/);
  38.  
  39.   // Uncomment if screen contrast needs adjusting (contrast = 0 to 255)
  40.   // HCDisplay.Contrast(16);
  41.  
  42.   /* Get the screens X & Y resolution */
  43.   MaxX = HCDisplay.ResX() - 1;
  44.   MaxY = HCDisplay.ResY() - 1;
  45.  
  46.   /* Draw a boarder */
  47.   HCDisplay.Rect(0 , 0, MaxX, MaxY, OUTLINE, 1);
  48.   HCDisplay.Rect(0 + 3 , 0 + 3, MaxX - 3, MaxY - 3, OUTLINE, 1);
  49.  
  50.   /* Print some text */
  51.   HCDisplay.Pos(44,8);
  52.   HCDisplay.Print("Hobby");
  53.   HCDisplay.Pos(24,18);
  54.   HCDisplay.Print("Components");
  55.  
  56.   HCDisplay.Pos(32,30);
  57.   HCDisplay.Print("2.8\" LCD");
  58.  
  59.   /* Change the font */
  60.   HCDisplay.SetFont(MedProp_12ptFont);
  61. }
  62.  
  63.  
  64. void loop()
  65. {
  66.   /* Make some text flash by swapping the texts foreground and background colours */
  67.   HCDisplay.SetFG(FGColour);
  68.   HCDisplay.SetBG(!FGColour);
  69.   HCDisplay.Pos(8,42);
  70.   HCDisplay.Print("HCMODU0245");
  71.  
  72.   FGColour = !FGColour;
  73.  
  74.   delay(200);
  75. }



Image

HCDisplay Arduino library:

viewtopic.php?f=58&t=2827

Please ensure that have V1.2.0 or greater of the HCDisplay library installed.



Libraries, example code, and diagrams are provided as an additional free service by Hobby Components and are not sold as part of this product. We do no provide any guarantees or warranties as to their accuracy or fitness for purpose.

Descriptions and diagrams on this page are copyright Hobby Components Ltd and may not be reproduced without permission.

oldmaker
Posts: 12
Joined: Tue Aug 08, 2023 9:04 am

Re: Low Power 2.4 Inch 128x64 ST7565 Serial LCD Display (HCMODU0245)

Post by oldmaker » Thu Mar 14, 2024 5:32 pm

This is a nice display with low power consumption of about 660uA, and together with the HCDisplay library easy to use.

I have done a quick evaluation using the example given above.
The active screen area is less than the screen size and is 1.7"x1". giving a diagonal of 1.9"
I have also noticed when drawing circles they are elongated along the vertical axis.

Overall I prefer the 1.8" 128x64 ST7565 low power display which has the option of a backlight but is also transreflective and can be read in daylight without the backlight. It has an active screen size similar to the 2.4 inch display of 1.7" and can display undistorted circles. The supply current without backlight is about 550uA.

Overall both displays are a great addition to your selection of displays.

StuartsProjects
Posts: 5
Joined: Tue May 14, 2024 3:04 pm

Re: Low Power 2.4 Inch 128x64 ST7565 Serial LCD Display (HCMODU0245)

Post by StuartsProjects » Wed May 15, 2024 2:32 pm

For some time I have been looking for a decent LCD dispaly that I can use for outdoor applications, I do a fair bit of messing about with LoRa. In the past I have used a transflective 20 character x 4 line LCD, but its only 4 lines, not compact, and you cannot up the character font size. I had previously tried a 128x64 LCD display but it did not work. ePaper displys are too slow.

Then I spotted the HCMODU0245 on the Hobby Components site and decided to give it a go, low price and prompt delivery.

I have just been testing the 2.4" HCMODU0245 display and indeed it is clearly visible indoors and in direct sunlight.

The HCDdisplay library does work with an Arduino such as a Pro Mini but not with a DUE or ESP32.

Fortunatly the U8G2 display library can be persuaded to work with the HCMODU0245 in hardware SPI mode and this dramatically speeds things up, The standard HCDlibrary example takes about 1952mS to write a screen that has around 64 text characters over 8 lines. The U8G2 writes a similar text screen in 107mS.

However when you swap to driving the screen with an ESP32S3 the same text takes 4mS to write, which is very quick indeed.

I noticed in your post that the 1.8" HCMODU0246 is also viewable in direct sunlight, and this is indeed the case. Its not got the nice green background of the HCMODU0245, but its OK. A small amount of current, 1mA, through the backlight LED is enough to make the display well readable indoors and in the dark.

Overall I am impressed with these displays, far betteer than the often used 0.96" and 1.3" OLEDs, and of course you can use them outdoors.

andrew
Site Admin
Posts: 1427
Joined: Sun Aug 05, 2012 4:15 pm

Re: Low Power 2.4 Inch 128x64 ST7565 Serial LCD Display (HCMODU0245)

Post by andrew » Thu May 16, 2024 3:38 pm

Overall I am impressed with these displays, far betteer than the often used 0.96" and 1.3" OLEDs, and of course you can use them outdoors.
Thanks for the feedback.....

The HCDdisplay library does work with an Arduino such as a Pro Mini but not with a DUE or ESP32.
Assuming you are seeing compile errors, then I think I see the problem. I'll have a look into it and push a fix as soon as I get a chance to look at it.

The standard HCDlibrary example takes about 1952mS to write a screen that has around 64 text characters over 8 lines.
Yeah, it's because it's using a software serial output for compatibility & pin options over speed. I'll take a look to see if I can add a hardware SPI option when I look into the first issue.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

StuartsProjects
Posts: 5
Joined: Tue May 14, 2024 3:04 pm

Re: Low Power 2.4 Inch 128x64 ST7565 Serial LCD Display (HCMODU0245)

Post by StuartsProjects » Fri May 17, 2024 9:31 am

Assuming you are seeing compile errors, then I think I see the problem. I'll have a look into it and push a fix as soon as I get a chance to look at it.
Yep.

For a ESP32 you get errors about avr/pgmspace.h and on a DUE this;

error: invalid conversion from 'const FONT_INFO*' to 'FONT_INFO*' [-fpermissive]

And I get the same error for the Minicore that I use for Arduino Pro Minis and the Mightycore that I use for some Atmega1284P boards that I have.

The U8g2 has high memory however, OK for ESP32s etc, but not for UNOs and Pro Minis. On a Pro Mini the U8x8lib text only library works as well, a simple text screen write uses 21% of Flash and 22% on memory and takes around 37mS to write around 64 characters.

andrew
Site Admin
Posts: 1427
Joined: Sun Aug 05, 2012 4:15 pm

Re: Low Power 2.4 Inch 128x64 ST7565 Serial LCD Display (HCMODU0245)

Post by andrew » Fri May 17, 2024 2:24 pm

I’ve just uploaded a new version of the library (V1.2.1) which hopefully fixes the compile errors for Arm devices. I’ve tested it with a generic ESP32 and it’s now working fine for me.

I’ve also added a hardware SPI option (ST7565_SPI) so if you want to give it a try just uncomment the appropriate line in the options.h file. Obviously as it uses the hardware SPI of the device you’ll need to connect the screens data and clock pins to the appropriate hardware SPI pins on your microcontroller. The other control pins (CE, DC, & RST) can still be any pins you like.

To initialise the hardware SPI version use this version of the init() function:

HCDisplay.Init(CE_PIN, DC_PIN, RST_PIN);


At the moment I’ve only uploaded it to our forum here:

viewtopic.php?f=58&t=2827

I’m not going to upload it to github or platformio until I’m sure it’s ok. Just download version 1.2.1 from the link above, unzip it, and then copy it over the top of your existing library.


If you do end up trying it I’d greatly appreciate it if you could let me know if it works. Thanks.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

StuartsProjects
Posts: 5
Joined: Tue May 14, 2024 3:04 pm

Re: Low Power 2.4 Inch 128x64 ST7565 Serial LCD Display (HCMODU0245)

Post by StuartsProjects » Fri May 17, 2024 3:23 pm

If you do end up trying it I’d greatly appreciate it if you could let me know if it works.
On an Arduino Pro Mini example 'HCDisplay_Hello_World' works in software SPI mode with the HCMODU0245.

If I comment in HCDisplay.Init(CE_PIN, DC_PIN, RST_PIN); put options.h to '#define ST7565_SPI' then I get a blank screen.

Hardware SPI is working, the U8x8lib works fine.

andrew
Site Admin
Posts: 1427
Joined: Sun Aug 05, 2012 4:15 pm

Re: Low Power 2.4 Inch 128x64 ST7565 Serial LCD Display (HCMODU0245)

Post by andrew » Sun May 19, 2024 7:47 am

If I comment in HCDisplay.Init(CE_PIN, DC_PIN, RST_PIN); put options.h to '#define ST7565_SPI' then I get a blank screen.

Odd, I have tested it on an ATMega328 based board and it's working fine for me. Did you remember to move the DIN and SCK pins over to the hardware pins on your Pro Mini?

DIN -> Arduino Pin 11
SCK -> Arduino pin 13
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

StuartsProjects
Posts: 5
Joined: Tue May 14, 2024 3:04 pm

Re: Low Power 2.4 Inch 128x64 ST7565 Serial LCD Display (HCMODU0245)

Post by StuartsProjects » Sun May 19, 2024 1:28 pm

For the program 'HCDisplay_Hello_World.ino' for a 3.3v ATmega328P I had these settings;

//Arduino Pro Mini pins
#define CE_PIN 10
#define DC_PIN 7
#define CLK_PIN 13
#define DIN_PIN 11
#define RST_PIN 9

I ran it in software mode with the options.h set to #define ST7565 and used;
HCDisplay.Init(DIN_PIN, CLK_PIN, CE_PIN, DC_PIN, RST_PIN);
It worked.

I made no wiring changes and set option.h to #define ST7565_SPI and used;
HCDisplay.Init(CE_PIN, DC_PIN, RST_PIN);
Blank screen.

Then again without making any wiring changes I ran an example based on the U8x8lib, using hardware SPI;
U8X8_ST7565_64128N_4W_HW_SPI disp(CE_PIN, DC_PIN, RST_PIN);
It worked.

andrew
Site Admin
Posts: 1427
Joined: Sun Aug 05, 2012 4:15 pm

Re: Low Power 2.4 Inch 128x64 ST7565 Serial LCD Display (HCMODU0245)

Post by andrew » Mon May 20, 2024 9:23 am

Thanks again. Your setup looks correct to me but I think I’ve found the problem…

Just to be thorough, I connected it up in your configuration and with the hardware SPI version it started to do weird things. I think I’ve pinned it down to the wrong SPI mode. Must have been just a fluke that it worked for me. Probably something to do with race conditions on different pins.

Anyway, sorry for the confusion. I’ve now uploaded a hopefully fixed version. It’s available via the HCDisplay forum thread under the same version number (V1.2.1) if you still want to give it a try:


viewtopic.php?f=58&t=2827&p=7132#p7132

Here is a direct link (must be logged in to download):

download/file.php?id=886

Thanks for your help and feedback!
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

Post Reply

Return to “Display”