Take a load off and chat!

Moderators: Henry, Mods

Post Reply
Posts: 7
Joined: Mon Nov 23, 2009 10:47 pm


Post by starlon » Mon Nov 30, 2009 2:22 am

Since I'm going to eventually be writing a couple MO drivers for my LCD controller, I may as well introduce the program.

This is LCDControl. It is written for Linux, and is largely based on LCD4Linux. I wanted to extend LCD4Linux, but found working with the maintainer was difficult, so instead of trying to convince the man, I started on a quest to write my own controller. The largest difference between the two controllers is that LCDControl is not targeted towards Linux servers or embedded systems at all, unless you happen to keep a X11 environment running 24/7. The reason for this is that LCDControl makes use of the Qt GUI development kit for its main loop and Javascript implementation.

That said, Qt opens up a lot of possibilities, especially with the Javascript engine and how it's integrated into Qt's design. LCDControl offers two routes for displaying information on an LCD. One is through the widget system, which provides elements like text, bars, histograms, icons, animations, etc... The other method is provided allowing the LCD programmer to interface the LCD and controller through Javascript. Here the programmer can connect to a tick timer, keypad events, and ultimately design a menu system from scratch, or whatever one's imagination can dig up.

LCDControl is open source and free, in the spirit of Linux and all library/borrowed code utilized by the controller. The controller borrows from a lot of sources and inspirations. For example, LCDControl makes use of double buffering and is very conservative about sending data to the LCD. This design and snippets of code come from LCD4Linux, which is a remarkable piece of software. If you don't believe me, just have a look at its code for bar widgets. While I avoided the complexity involved with that design, I borrowed the concept of split and hollow bars, although very much inferior in implementation. One drawback to this complexity is that it's difficult to include other elements which make use of special characters, and that is exactly what drove me to write my own controller, with the goals of simplicity, customizability, and expandability.


One goal of mine is to provide a LCD controller for Linux-based home entertainment systems. While there is not much buzz around this area, Linux is steadily progressing in sound and video engineering. LCDControl offers the visualization widget, which is based on xmms2 and libvisual. 3 widget styles are available: PCM, spectrum, and peak. PCM is my favorite, although on character displays you're limited to a 24x16 pixel monochrome visualization, as seen above. Full graphical and color support is but some lines of code a way. I have neglected graphic displays some.

Well, there's the introduction. I plan on asking loads of questions once I get my hands on a MO display. I'm not sure which I want to get first. I can't afford much, as I'm on disability, so I'll have to buy one at a time. If someone wants to pick up the pieces and code a driver, you are most welcome to do so. A good start would be to look at the DrvCrystalfontz driver for basic design of multi-protocol drivers. This code from LCD4Linux will also be useful.

Code: Select all

typedef struct {
    int type;
    char *name;
    int rows;
    int cols;
    int gpis;
    int gpos;
    int protocol;

/* Fixme #1: number of gpo's should be verified */
/* Fixme #2: protocol should be verified */

static MODEL Models[] = {
    {0x01, "LCD0821", 2, 8, 0, 1, 1},
    {0x03, "LCD2021", 2, 20, 0, 1, 1},
    {0x04, "LCD1641", 4, 16, 0, 1, 1},
    {0x05, "LCD2041", 4, 20, 0, 1, 1},
    {0x06, "LCD4021", 2, 40, 0, 1, 1},
    {0x07, "LCD4041", 4, 40, 0, 1, 1},
    {0x08, "LK202-25", 2, 20, 8, 8, 2},
    {0x09, "LK204-25", 4, 20, 8, 8, 2},
    {0x0a, "LK404-55", 4, 40, 8, 8, 2},
    {0x0b, "VFD2021", 2, 20, 0, 1, 1},
    {0x0c, "VFD2041", 4, 20, 0, 1, 1},
    {0x0d, "VFD4021", 2, 40, 0, 1, 1},
    {0x0e, "VK202-25", 2, 20, 0, 1, 1},
    {0x0f, "VK204-25", 4, 20, 0, 1, 1},
    {0x10, "GLC12232", -1, -1, 0, 1, 1},
    {0x13, "GLC24064", -1, -1, 0, 1, 1},
    {0x15, "GLK24064-25", -1, -1, 0, 1, 1},
    {0x22, "GLK12232-25", -1, -1, 0, 1, 1},
    {0x31, "LK404-AT", 4, 40, 8, 8, 2},
    {0x32, "VFD1621", 2, 16, 0, 1, 1},
    {0x33, "LK402-12", 2, 40, 8, 8, 2},
    {0x34, "LK162-12", 2, 16, 8, 8, 2},
    {0x35, "LK204-25PC", 4, 20, 8, 8, 2},
    {0x36, "LK202-24-USB", 2, 20, 8, 8, 2},
    {0x38, "LK204-24-USB", 4, 20, 8, 8, 2},
    {0x39, "VK204-24-USB", 4, 20, 8, 8, 2},
    {0xff, "Unknown", -1, -1, 0, 0, 0}
Note that these are only character displays. LCD4Linux doesn't have support for MO graphic displays thus far, with the exception of GX. So if you're wanting to write a graphic driver, keep that separate from the character display driver. In the end there will be three MO drivers total: character displays, graphic displays (minus GX), and GX.

Also, for the moment LCDControl does its own text rendering for graphic displays. I've tossed the concept of hybrid display drivers around in my head a bit so that a user could have more control over the LCD, but so far that's a real basic thought. Remember, one goal was expandability, and I'm open to just about any idea. Since LCDControl is early in its development (no releases), breaking implementation isn't that huge of a deal.

Here's LCDControl's project page:

Matrix Orbital
Matrix Orbital
Posts: 864
Joined: Fri Aug 17, 2007 10:58 am
Location: Matrix Orbital

Post by Clark » Mon Nov 30, 2009 10:46 am

Hi Starlon,

Great to see all the work you've been putting into a Linux driver. I understand it will be costly to grab everyone of our displays, to start you may want to take a look at the LK204-25, or USB version. It'll give you keypad, GPO, and full screen height for large digits. Alternatively, we've got a DevDevil Development Board coming out soon that will provide all protocols on a simple exploded board; no need to buy LEDs or a keypad.

I've also attached a current Module List to give you an idea of what displays you may consider supporting. If you have any questions regarding any of our products, please don't hesitate to ask.

Current Matrix Orbital Module List
(179.11 KiB) Downloaded 389 times
Troy Clark
Design & Development
Matrix Orbital

Posts: 7
Joined: Mon Nov 23, 2009 10:47 pm

Post by starlon » Tue Dec 08, 2009 2:19 pm

Here's some eye candy. You guys really need to come out with a full color graphic display! :)


Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests