mLink Character LCDs (HCMODU0190A & HCMODU0190B)

mLink serial I2C modules
Post Reply
admin
Site Admin
Posts: 866
Joined: Sun Aug 05, 2012 4:02 pm

mLink Character LCDs (HCMODU0190A & HCMODU0190B)

Post by admin » Tue Apr 26, 2022 10:02 am

Image




The mLink Character LCDs are serial (I2C/IIC) LCD displays available in either 16 column by 2 row (16x2), or 20 column by 4 row (20x4) options. Because they use a standard I2C interface they are compatible with most microcontrollers including Arduino, are addressable (address can be changed in software), and only require 2 data pins for communication. Unlike standard serial or parallel character displays they require no configuration or setup to use them saving on development time and code size.

Text is displayed as a very clear white text on a blue backlight. The backlight's brightness level is fully programmable and can be set in 10% increments allowing you to dim the display or turn it completely off to save power. mLink modules are also compatible with other mLink or standard I2C modules allowing you to daisy-chain several different types of modules together using only the two I2C pins of your microcontroller.


For Arduino users you can use the mLink library (see below) to control any type of mLink module. The library has a very small memory footprint and only one single instance is needed to control multiple types of mLink modules. This makes it great for Arduinos with small amounts of memory and pin counts.


For Raspberry Pi users we have a Python module which can be installed via pip or downloaded and installed directly from our forum. Please see the mLink Python forum thread for requirements and download link here: viewtopic.php?f=131&t=3062&p=8592#p8592


Module specifications:

Module code: 						HCMODU0190A (16x2 white text on blue backlight) 
								HCMODU0190B (20x4 white text on blue backlight)
Supply voltage (VDD): 				4.5V to 5.5V
Operating range (recommended):		0oC to 50oC
Display type (HCMODU0190A):			16x2 character alphanumeric LCD
Display type (HCMODU0190B):			20x4 character alphanumeric LCD
Current max (HCMODU0190A):			31mA (100% backlight, Vcc = 5V)
Current min(HCMODU0190A):			2mA (sleep)
Current max (HCMODU0190B):			46mA (100% backlight, Vcc = 5V)
Current min(HCMODU0190B):			2mA (sleep)
Interfaces:						I2C
I2C Interface speed: 					400kbits/s (fast mode)
I2C default address (HEX): 			0h56
Maximum number of modules: 			5 with pullups fitted, 112 with pullups removed*
HCMODU0190A dimensions (inc module):	80mm x 36mm x 19mm
HCMODU0190B dimensions (inc module):	98mm x 60mm x 19mm


*Note the maximum number of connected modules will depend on cable lengths and power requirements of each module. Do not exceed 5 mLink modules connected in series with all pullups fitted.




Arduino Connection Example:

Image


Image


Because the modules use an I2C interface this also means multiple modules can be controlled from a single Arduino I2C interface simply by daisy-chaining them together. Note to control multiple mLink modules of the same type requires changing the default I2C address of the additional modules. See mLink Library Quick Start Guide for how to do this.


Image



Print some text example

Arduino Print Text Example:

This sketch uses the mLink library to print some text to the display.

  1. #include "mLink.h"                      // Include the library
  2.  
  3. mLink mLink;                            // Create an instance of the library
  4.  
  5. #define I2C_ADD 0x56                    // Default I2C address
  6.  
  7.  
  8. void setup()
  9. {
  10.   mLink.init();                         // Initialise the library
  11. }
  12.  
  13. void loop()
  14. {
  15.   mLink.cLCD_cursor(I2C_ADD, 5, 0);     // Set the cursor to col 5 row 0
  16.   mLink.cLCD_print(I2C_ADD, "Hello");   // Print something
  17.  
  18.  
  19.   mLink.cLCD_cursor(I2C_ADD, 5, 1);     // Set the cursor to col 5 row 1
  20.   mLink.cLCD_print(I2C_ADD, "World");   // Print something
  21.  
  22.   while(1);
  23. }

Display a number example

Arduino Display a Number:

This sketch uses the mLink library to display a value representing the Arduino 'up time'
  1. #include "mLink.h"                          // Include the library
  2.  
  3. mLink mLink;                                // Create an instance of the library
  4.  
  5. #define I2C_ADD 0x56                        // Default I2C address
  6.  
  7. float time;
  8.  
  9. void setup()
  10. {
  11.   mLink.init();                             // Initialise the library
  12.  
  13.   mLink.cLCD_clear(I2C_ADD)                 // Clear the screen
  14.  
  15.   mLink.cLCD_print(I2C_ADD, "Uptime: ");    // Print some text
  16. }
  17.  
  18.  
  19. void loop()
  20. {
  21.   time = (float)millis() / 1000;            // Get the Arduinos 'up time' and conver it to seconds
  22.  
  23.   mLink.cLCD_cursor(I2C_ADD, 10, 0);        // Set the cursor to col 10 row 0
  24.   mLink.cLCD_printFloat(I2C_ADD, time, 3);  // Print the uptime to 3 decimal places
  25.  
  26.   delay(1);
  27. }




Raspberry Pi Connection Example:

Image

Print Text Example

Raspberry Pi Print Text Example:
Prints some text to the display.

This program requires the mLink Python library module to be installed. Please see the following forum thread for more information on how to install the Python module and requirements:

viewtopic.php?f=131&t=3062

  1. from mLink import mLink                 # Import the mLink module
  2.  
  3. ml = mLink.mLink(1)                     # Create an instance of the module
  4.  
  5. I2C_ADD = 0x56                          # Default I2C address is 0x56
  6.  
  7.  
  8. ml.cLCD_Clear(I2C_ADD)                  # Clear the display
  9.  
  10. ml.cLCD_Cursor(I2C_ADD, 5, 0)           # Place the cursor at col 5, row 0
  11. ml.cLCD_Print(I2C_ADD, 'Hello')         # Print some text
  12. ml.cLCD_Cursor(I2C_ADD, 5, 1)           # Place the cursor at col 5, row 1
  13. ml.cLCD_Print(I2C_ADD, 'World')         # Print some text

Custom Character Example

Raspberry Pi Custom Character Example:


  1. from mLink import mLink                 # Import the mLink module
  2.  
  3. ml = mLink.mLink(1)                     # Create an instance of the module
  4.  
  5. I2C_ADD = 0x56                          # Default I2C address is 0x56
  6.  
  7.  
  8. # Bitmaps for each custom character
  9. Battery =        [0x0E, 0x1F, 0x11, 0x11, 0x11, 0x11, 0x11, 0x1F]
  10. LeftArrow =      [0x00, 0x04, 0x0C, 0x1F, 0x0C, 0x04, 0x00, 0x00]
  11. UpArrow =        [0x04, 0x0E, 0x1F, 0x04, 0x04, 0x04, 0x04, 0x04]
  12. DownArrow =      [0x04, 0x04, 0x04, 0x04, 0x04, 0x1F, 0x0E, 0x04]
  13. RightArrow =     [0x00, 0x04, 0x06, 0x1F, 0x06, 0x04, 0x00, 0x00]
  14. PadLockLocked =  [0x0E, 0x11, 0x11, 0x1F, 0x1B, 0x1B, 0x1F, 0x00]
  15. PadLockOpen =    [0x0E, 0x10, 0x10, 0x1F, 0x1B, 0x1B, 0x1F, 0x00]
  16. Ohmega =         [0x00, 0x0E, 0x11, 0x11, 0x11, 0x0A, 0x1B, 0x00]
  17.  
  18.  
  19. ml.cLCD_Clear(I2C_ADD)                  # Clear the display
  20.  
  21. # Write the bitmaps to the LCDs 8 custom characters
  22. ml.cLCD_setCust0(I2C_ADD, Battery)
  23. ml.cLCD_setCust1(I2C_ADD, LeftArrow)
  24. ml.cLCD_setCust2(I2C_ADD, UpArrow)
  25. ml.cLCD_setCust3(I2C_ADD, DownArrow)
  26. ml.cLCD_setCust4(I2C_ADD, RightArrow)
  27. ml.cLCD_setCust5(I2C_ADD, PadLockLocked)
  28. ml.cLCD_setCust6(I2C_ADD, PadLockOpen)
  29. ml.cLCD_setCust7(I2C_ADD, Ohmega)
  30.  
  31.  
  32. # Print out each custom character
  33. ml.cLCD_printCust(I2C_ADD, 0)
  34. ml.cLCD_printCust(I2C_ADD, 1)
  35. ml.cLCD_printCust(I2C_ADD, 2)
  36. ml.cLCD_printCust(I2C_ADD, 3)
  37. ml.cLCD_printCust(I2C_ADD, 4)
  38. ml.cLCD_printCust(I2C_ADD, 5)
  39. ml.cLCD_printCust(I2C_ADD, 6)
  40. ml.cLCD_printCust(I2C_ADD, 7)


Image

mLink Arduino library
viewtopic.php?f=58&t=3001


mLink Raspberry Pi Python module
The mLink python module can be installed with the following terminal command:

  1. pip install hc-mlink

Alternatively the library can be manually installed by downloading it from the forum and unzipping it to your project folder. See the Python module forum thread for more information and download link:
viewtopic.php?f=131&t=3062&p=8592#p8592

Please note that in some cases there may be additional configuration required. If you have issues getting your Raspberry Pi to communicate with the mLink module then please see the Python module forum thread here: viewtopic.php?f=131&t=3062




mLink Library Quick Start Guide For Arduino Users
https://hobbycomponents.com/downloads/m ... _Guide.pdf


mLink Library Reference Guide For The Character LCD Sensor Modules
https://hobbycomponents.com/downloads/m ... _Guide.pdf


mLink Specifications and Register Map For The Character LCD Modules
https://hobbycomponents.com/downloads/m ... er_Map.pdf


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.

dqj999
Posts: 3
Joined: Mon Jun 01, 2020 5:20 pm

Re: mLink Character LCDs (HCMODU0190A & HCMODU0190B)

Post by dqj999 » Tue May 30, 2023 9:34 am

I've just been testing my Mlink 4 x 20 Display and it seems quite slow to display the text compared to the non-Mlink version. In my tests it seemed to be taking around 10mSec to display one line of data.

Is this to be expected?

Derek

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

Re: mLink Character LCDs (HCMODU0190A & HCMODU0190B)

Post by andrew » Tue May 30, 2023 2:12 pm

I've just been testing my Mlink 4 x 20 Display and it seems quite slow to display the text compared to the non-Mlink version. In my tests it seemed to be taking around 10mSec to display one line of data.

Is this to be expected?

Yes that seems about right. If by the non-mLink version you mean just writing to the display's parallel interface directly from an Arduino, then yes it will be slower I'm afraid due to the extra overhead of having to communicate via the serial I2C interface.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

Post Reply

Return to “mLink”