Back to main page...

MIDIbox NG

User Manual --- LCD

MIDIbox NG provides so many different LCD hardware options, that this topic deserves a special page! Choose one of these types for your MIDIbox. Note that it isn't possible to combine different LCDs; means: you can connect multiple character LCDs or multiple graphical LCDs, but the firmware doesn't allow to use both type of LCDs at the same time.

Character LCDs (CLCDs)

Character LCDs are available for few money in many different variants, most of them comply to the HD44780 industrial standard from Hitachi. Regardless of the number of provided characters (2x16, 2x20, 4x16, 4x20, 2x40), they are communicating over the same bus interface with the core.

The best choice for MIDIbox NG are 2x20 or 2x40 LCDs, because they typically provide a 1:1 matching pinning with the LCD connectors on the MBHP_CORE_LPC17 module, so that they can be directly connected with a flat 16pin ribbon cable + IDC connectors to J15A:

Schematic


If you are planning to use the Standard Control Surface, at least 2x20 characters for the first CLCD connected to J15A are recommended. Although MIDIbox NG allows to configure the SCS for 2x16 or 2x20 or 2x40 LCDs, you would stay compatible with other MIOS32 based applications (such as MIDIO128) which don't provide such a configuration option.

2x16 LCDs have a different pinning, which results into a bit more (error prone) soldering effort for Newbies, and is therefore not recommended from my side. However, if you found a supercheap source for 2x26 LCDs at EBay and want to stuff your MIDIbox NG with plenty of those, then the MIDIbox NG application doesn't prevent you from using such displays of course... ;-) - the same applies for more exotic sizes, such as 1x6 or 1x8 displays.

By default, two CLCDs with up to 2x40 characters are enabled in the firmware. They have to be connected to J15A and J15B of the core module as mentioned earlier.

A second LCD is usually directly connected to J15B with a 1:1 cable:

Experts use a single ribbon cable from J15A, and connect the E input (which addresses the LCD) with a single wire to J15B:E:

More pictures: #2 #3 #4.
See also this schematic.

In the .NGC file the first LCD can be addressed with (example):

EVENT_xxx ... lcd_pos=1:1:1 label="First LCD, First Line"
and the second LCD with:
EVENT_xxx ... lcd_pos=2:1:1 label="Second LCD, First Line"

It's also possible to write to both LCDs from a single label by moving the cursor within the label string, such as:

EVENT_xxx ... label="@(1:1:1)LCD1@(2:1:1)LCD2"

Another point, which might be interesting is, that the two LCDs can be combined to a 2x80 display, which is especially useful when large text messages are received via SysEx, e.g. from a DAW during a Logic (resp. Mackie) Control emulation. For example:

EVENT_xxx ... lcd_pos=1:1:1 label="This text message could also be print   from an external SysEx message."
EVENT_xxx ... lcd_pos=1:1:2 label="And this is the second line."
will output: Screen
on the two LCDs.

3..6 CLCDs

Once more than 2 CLCDs should be connected to the core module, J28 can be used to extend the number of enable (E) lines.
Dedicated drivers and trimpots are required for the Backlight luminance and contrast for each pair of 2 CLCDs.
See also this schematic.

Softwarewise the number of connected CLCDs has to be configured with the Bootloader Update Application. This application can be uploaded at any time to change the LCD parameters, and to store them in a special flash location which won't be overwritten by applications, so that the configuration is permanently available.

After this application has been uploaded, enter following commands to configure 6 2x20 LCDs:

set lcd_type CLCD
set lcd_num_x 6
set lcd_num_y 1
set lcd_width 20
set lcd_height 2
store
With this configuration, the CLCDs can be accessed in the .NGC file with:
EVENT_xxx ... lcd_pos=1:1:1 label="LCD1"
EVENT_xxx ... lcd_pos=2:1:1 label="LCD2"
EVENT_xxx ... lcd_pos=3:1:1 label="LCD3"
EVENT_xxx ... lcd_pos=4:1:1 label="LCD4"
EVENT_xxx ... lcd_pos=5:1:1 label="LCD5"
EVENT_xxx ... lcd_pos=6:1:1 label="LCD6"
and will print:
Screen
Long text messages will be combined in a single 'X' line with an overall dimension of 120x2: Screen
With following configuration:
set lcd_type CLCD
set lcd_num_x 3
set lcd_num_y 2
set lcd_width 20
set lcd_height 2
store
we would get a 60x4 screen instead:
Screen
Screen

7..64 CLCDs

Once more than 6 CLCDs should be connected to the core module, MBHP_DOUT modules (resp. 74HC595 shift registers) have to be used to output the enable (E) lines. Summa summarum up to 64 E lines are supported: two from the J15A/B port, and 62 additional lines from two MBHP_DOUTX4 boards! The remaining two outputs of the 8th 74HC595 shift register in the chain aren't used!
Dedicated drivers and trimpots are required for the Backlight luminance and contrast for each pair of 2 CLCDs.
See also this schematic.

This schematic doesn't show that the data lines D0..D7 probably have to be buffered as well. This is currently under evaluation!

LCD Buffer Limitations

Since version 1.013 there are no buffer limits anymore - up to 64 CLCDs with any size can be accessed! :-)

Testing CLCDs

For the case that the connected LCDs don't seem to work, following testing procedure (hopefully) helps:

  • Most MIOS32 applications only initialize the first two CLCDs (connected to J15A/B) by default. Currently only MIDIbox NG initializes all LCDs which have been specified in the bootloader.
  • MBNG will only output messages on the first LCD, connected to J15A, by default. You've to enhance your .NGC file to address the remaining LCDs.
  • check the contrast trimpot in both directions. Usually the display doesn't show anything if this trimpot selects a voltage >1V. With 0V you should see the full contrast.
  • if the LCD only shows bars in the upper line, it hasn't been initialized. Ensure that the correct number of displays has been specified in the Bootloader Update Application by typing "help" after the application has been uploaded.
  • if the parameters are correct, you can upload the MIDIbox NG application again and continue debugging from there.
  • use the "testlcdpin" command into MIOS Terminal to change the state of the LCD control pins directly.
    If you enter the command without parameters, following help page will show you the available options:
    testlcdpin rs 0  -> sets J15(AB):RS to ca. 0V
    testlcdpin rs 1  -> sets J15(AB):RS to ca. 3.3V
    testlcdpin e1 0  -> sets J15A:E to ca. 0V
    testlcdpin e1 1  -> sets J15A:E to ca. 3.3V
    testlcdpin e2 0  -> sets J15B:E to ca. 0V
    testlcdpin e2 1  -> sets J15B:E to ca. 3.3V
    testlcdpin rw 0  -> sets J15(AB):RW to ca. 0V
    testlcdpin rw 1  -> sets J15(AB):RW to ca. 3.3V
    testlcdpin d0 0  -> sets J15(AB):D0 to ca. 0V
    testlcdpin d0 1  -> sets J15(AB):D0 to ca. 5V (resp. 3.3V)
    testlcdpin d1 0  -> sets J15(AB):D1 to ca. 0V
    testlcdpin d1 1  -> sets J15(AB):D1 to ca. 5V (resp. 3.3V)
    testlcdpin d...  -> same for J15(AB):D2, D3, D4, D5, D6, D7
    testlcdpin reset -> re-initializes LCD modules so that they can be used again.
    Whenever a pin state has been changed, you should measure the appr. voltage (0, ca. 3.3V or ca. 5V) at the selected control or data pin.
    Note: the remaining pins are set to 0V, only a single pin is set to ca. 3.3V resp. 5V!
  • With these tests you are able to:
    • check that the core module can control all LCD pins
    • that the LCD pins are connected to the right signals
    • that there is no short circuit between the pins (due to a soldering error, e.g. a bridge)
    • Good luck!

Note that under certain circumstances a wrong connection could permanently damage the LCD! So, if you notice that pins are swapped, and the LCD is even not working after the corrected connections, it could be that there is no hope to fix this damaged LCD anymore, and you would have to buy a new one!

Graphical LCDs

Graphical LCDs are supported as well. Various fonts are available which can be selected in the "label" message as described in the .NGC chapter. The LCD buffer is reduced to 512 characters only, because the upper half is used to store the used font!

The subchapters below list the supported LCD types.

KS0107/KS0108 or HD61202 based GLCDs

The bus interface of this GLCD is similar to a CLCD, but every 64x64 segment needs a CS (chip select) line which is available at J28 (MBHP_CORE_STM32: J5C).
All graphical LCDs require a negative voltage to drive the Liquid Crystal cells. Some LCDs provide an inbuild DC converter, some others not. The schematic below shows a MAX759 voltage converter which can be used if a Vout pin is not provided by the GLCD.
Schematic: mbhp_lcd_ks0108_mios32.pdf

Following configuration is required in the Bootloader Update Application for a 128x64 GLCD (2 CS lines):

set lcd_type GLCD_KS0108
set lcd_num_x 1
set lcd_num_y 1
set lcd_width 128
set lcd_height 64
store

If the CS lines of your GLCD are inverted (=low-active), then enter following configuration:

set lcd_type GLCD_KS0108_INVCS
set lcd_num_x 1
set lcd_num_y 1
set lcd_width 128
set lcd_height 64
store

For a 240x64 GLCD (with 4 CS lines) like used for the original MIDIbox LC enter:

set lcd_type GLCD_KS0108
set lcd_num_x 1
set lcd_num_y 1
set lcd_width 240
set lcd_height 64
store

Note that lcd_num_x/num_y have no effect yet; only 4 CS lines are supported for KS0108 based GLCDs!

Limitations: up to 4 LCD segments are supported (limited by the number of pins at J28).
Each segment has a size of 64x64, makes 256x64 in total.
With the "normal font" (6x8) up to 42x8 characters can be print, fonts can be selected without limitations.

SED1520 based GLCDs

GLCDs which are SED1520 compatible are an inexpensive alternative solution for KS0108 based displays.
E.g. the "Wintek WD-G1203T" with 122x32 pixel resolution available at Pollin is sold for only 2 EUR!
Please note that not every SED1520 based GLCD at Pollin is recommendable. E.g. the "LCD Datavision DG-12232" didn't work at my side. It would also need a negative display voltage and 50V AC (!) to supply the EL backlight - forget this display! ;-)

The bus interface is similar to a character based LCD, but every 61x32 segment needs a CS (chip select) line which is available at J28
Schematic: mbhp_lcd_sed1520_mios32.pdf Picture: mbhp_lcd_sed1520.jpg

Following configuration is required in the Bootloader Update Application for a 122x32 GLCD (2 CS lines):

set lcd_type GLCD_SED1520
set lcd_num_x 1
set lcd_num_y 1
set lcd_width 122
set lcd_height 32
store

It's possible to combine two SED1520 LCDs by connecting all signals (beside of CS) in parallel to J15A. The two CS lines of the second display have to be connected to the CS3 and CS4 output at J28. Configuration:

set lcd_type GLCD_SED1520
set lcd_num_x 1
set lcd_num_y 1
set lcd_width 244
set lcd_height 32
store

It's also possible to combine four SED1520 LCDs by

  • connecting all signals of the first and second display (beside of CS) in parallel to J15A. The four CS lines have to be connected to J28.
  • connecting all signals of the third and fourth display (beside of CS) in parallel to J15B. The four CS lines have to be connected to J28 (in parallel to the CS lines of the first and second display
Configuration:
set lcd_type GLCD_SED1520
set lcd_num_x 2
set lcd_num_y 1
set lcd_width 244
set lcd_height 32
store

Limitations: up to 8 LCD segments are supported (limited by the number of E pins at J15A/B, and the 4 pins at J28) Each segment has a size of 61x32, makes 488x32 in total.
With the "normal font" (6x8) up to 160x4 characters can be print, fonts can be selected without limitations.

DOGM and DOGL based GLCDs

This 128x64 graphical LCD is really nice, because it provides a serial interface, so that the data pins of the J15 socket can be used as chip-select pins! Accordingly, it's possible to connect up to 8 GLCDs to J15A.
Schematic: mbhp_lcd_dogm128_mios32.pdf

Following configuration is required in the Bootloader Update Application for a single DOGM GLCD:

set lcd_type GLCD_DOG
set lcd_num_x 1
set lcd_num_y 1
set lcd_width 128
set lcd_height 64
store

Following configuration for 8 DOGM GLCDs:

set lcd_type GLCD_DOG
set lcd_num_x 8
set lcd_num_y 1
set lcd_width 128
set lcd_height 64
store

Following configuration for 12 DOGM GLCDs (remaining CS pins connected to J28):

set lcd_type GLCD_DOG
set lcd_num_x 12
set lcd_num_y 1
set lcd_width 128
set lcd_height 64
store

Following configuration for 16 DOGM GLCDs (remaining CS pins connected to a 74HC595 based shift register at J28):

set lcd_type GLCD_DOG
set lcd_num_x 16
set lcd_num_y 1
set lcd_width 128
set lcd_height 64
store

Following configuration for 64 DOGM GLCDs (remaining CS pins connected to seven chained 74HC595 based shift register at J28):

set lcd_type GLCD_DOG
set lcd_num_x 64
set lcd_num_y 1
set lcd_width 128
set lcd_height 64
store

IMPORTANT: please power-cycle the MBHP_CORE_LPC17 module whenever the lcd_type has been changed, otherwise the GLCD won't be initialized correctly (it has to be reset!)

Limitations: up to 64 LCDs are supported.
Each LCD has a size of 128x64, the LCD handler will reserve 21x8 characters for each LCD!

SSD1306 GLCDs

These are my personal favourites: the tiny OLEDs which are available today provide high resolution and nice looking colours for an attractive price of typically 4..8 EUR. If you are searching for OLEDs, take care that they come with a breakout board, because soldering the pads on a veroboard is almost impossible, and some caps for the integrated DCDC to generate higher voltages have to be added as well... no fun! I found an attractive OLED/PCB combination from Alientek at Taobao which is recommendable. Buy it via Yoybuy for easier handling if you don't like shops w/o english translations.
Up to 12 OLEDs can be (natively) controlled by a MIOS32 based core, they are accessed via 4-wire serial interface.
Schematics: mbhp_lcd_ssd1306_single_mios32.pdf, mbhp_lcd_ssd1306_multiple_mios32.pdf
Photo: follow this link and this link

Following configuration is required in the Bootloader Update Application for a single SSD1306 GLCD:

set lcd_type GLCD_SSD1306
set lcd_num_x 1
set lcd_num_y 1
set lcd_width 128
set lcd_height 64
store

Following configuration for 8 SSD1306 GLCDs:

set lcd_type GLCD_SSD1306
set lcd_num_x 8
set lcd_num_y 1
set lcd_width 128
set lcd_height 64
store

Following configuration for 12 SSD1306 GLCDs (remaining CS pins connected to J28):

set lcd_type GLCD_SSD1306
set lcd_num_x 12
set lcd_num_y 1
set lcd_width 128
set lcd_height 64
store

Following configuration for 16 SSD1306 GLCDs (remaining CS pins connected to a 74HC595 based shift register at J28):

set lcd_type GLCD_SSD1306
set lcd_num_x 16
set lcd_num_y 1
set lcd_width 128
set lcd_height 64
store

Following configuration for 64 SSD1306 GLCDs (remaining CS pins connected to seven chained 74HC595 based shift register at J28):

set lcd_type GLCD_SSD1306
set lcd_num_x 64
set lcd_num_y 1
set lcd_width 128
set lcd_height 64
store

Alternatively the SSD1306 screen can be rotated by 180 degrees, which might be useful in some cases (e.g. if it has been mounted the wrong way). In this case, please enter following lcd_type into the bootloader:

set lcd_type GLCD_SSD1306_ROTATED
store
resp. "lcd_type 0x85" if you are using Bootloader V1.010 (V1.011 hasn't been released yet...)

IMPORTANT: please power-cycle the MBHP_CORE_LPC17 module whenever the lcd_type has been changed, otherwise the GLCD won't be initialized correctly (it has to be reset!)

Limitations: up to 64 LCDs are supported.
Each LCD has a size of 128x64, the LCD handler will reserve 21x8 characters for each LCD!



Last update: 2024-05-08

Copyright © 1998-2023, Thorsten Klose. All rights reserved.