µTasker Forum > LCD Graphics Library and Simulator

uTasker graphic LCD support and graphic library

(1/5) > >>

mark:
Hi All

The uTasker project has long supported a character LCD simulator but from version V1.4 all projects contain monochrome graphical LCD support as well as a foundation for color LCD support. This includes simulation of the LCDs in the uTasker simulator to make development more efficient and more fun.

The following lists some of the history leading up to the decision to add this support and also some basic terminology:

•   Graphical monochrome and colour LCDs have become very popular recently with processor evaluation board manufacturers typically adding such a device to their boards; sometimes connected to a dedicated interface such as the LCD controller in the LPC2478, an external memory interface such as the AVR32, via SPI such as some OLEDs on Luminary Micro evaluation boards, or more generally via GPIOs (bit-banging).

•   In addition, the semiconductor manufacturers have identified the trend and promote the use of their own devices by supplying graphic libraries as part of demonstration code (Luminary Micro, Atmel, etc.). These graphic libraries are however generally restricted to use with particular microprocessors (licensing) and are not compatible.

•   The result of these developments and research into real user requirements led to the decision to add processor-independent graphical LCD support to the µTasker project together with practical graphical LCD simulation support to accelerate project development.

•   The first step in the process is the addition of monochrome LCD support including an accurate LCD simulator which can be simply added to all processors via GPIO connections. The initial support is restricted to text and bit-maps but this is generally adequate for most real project use, whereby library functions (such as line or shape drawing) will be added as the LCD project develops.

•   In addition to the monochrome graphical LCD support as explained in this section various preparations have been made as foundation for extensions to colour support. The simulator, for example, is already capable of accurately simulating colour LCD controllers as well as processors with internal TFT LCD controller (like the LPC2478). The µTasker projects with such evaluation boards available for them also include a demonstration of this capability although it is not generally contained in the first release of the µTasker V1.4 project. See the following chapters for examples of these where applicable.

•   To fully support LCD use various conversion utilities are required. A utility for converting bitmaps as generated with standards graphics programs (paint, etc.) is already included as detailed later in this section.

•   Research and practical tests with various LCD types has shown that it is not practical to use a single low level interface. The main reason is due to the memory requirements – a monochrome graphical LCD requires about 1k of RAM in order to back-up the display memory contents, which is generally affordable and thus allows an efficient method of content manipulation and LCD updates based on changed pixels only.
A colour LCD may, on the other hand, require 230k RAM to do the same thing, which is generally not practical. There interfaces are also faster, especially when the display memory is in SDRAM used by an internal LCD controller to automatically refresh, and so there is in this case no advantage in trying to restrict accesses. These conflicting requirements led to the decision to optimise the low level interface to best suit each LCD type and so the monochrome graphical LCD interface was initially designed specifically to suit it’s inherent characteristics.

•   Monochrome graphical displays often work very similarly but may have also some special commands to perform special tasks which are restricted to certain controllers. For this reason the first version of the graphical LCD driver concentrates on building a generic foundation based on standard commands. Specific advantages offered by certain display types may be used in the future to optimise operations should this be identified as being beneficial.

•   The monochrome graphical LCD is identified from the character LCD in the µTasker project by the name GLCD (Graphical LCD). Colour graphical LCDs are further distinguished by the name CGLCD (Colour Graphical LCD).


The initial version is restricted to supporting fonts and bitmaps (including a useful utility for automatically creating all project widgets in a project file), which represents the fundamentals for the next step of developing the processor-independent uTasker graphics library. LCDs are fun to work with and you may already be quite amazed at what the first simple package can already do...! Get full details in the new LCD user's guide: http://www.utasker.com/docs/uTasker/uTaskerLCD.PDF

Have fun...

Regards

Mark

lthyagar:
Hello Mark, just started playing with the uTasker, using the simulator. It is awesome.
I was successfully able to create a new task as per your instructions.
Able to to see the "hello world" on a telnet connection using PuTTY.
Next, I disabled the GLCD, and enabled the character LCD.
The telnet now outputs the "hello world" and LCD = 0xFF.
The display on the simulator is OK.

Question: Where is the LCD =0XFF coming from?

the code snippet:

#include "config.h"
extern void fnMyFirstTask(TTASKTABLE *ptrTaskTable)
{
  static unsigned char ucCounter = 0;

    fnDebugMsg("Hello, World! Test number ");
    fnDebugDec(ucCounter++, sizeof(ucCounter));
    fnDebugMsg("\r\n");
    TOGGLE_LAV_OUT() ;  // toggles portB  bit 22
}

mark:
Hi

The LCD = 0xff is coming from the test (see application_lcd.h)
    #define LCD_READ_TEST                                                // test read of LCD content

This is requesting the value of the LCD data RAM at regular intervals using the following line:

fnDoLCD_com_text(E_LCD_READ_RAM, (unsigned char *)&ucAddress, sizeof(ucAddress));

The LCD task is then reading the LCD and returning the value for display.

You can disable this by removing LCD_READ_TEST.

In fact I think that the value from the simulator is probably not correct (I known that it is good with a real LCD - at least the last time I tried it) so it may need improving...


Since this is the first post on this particular board I will take the opportunity on reporting a bit on some progress in the mean time. This is all to do with graphical LCDs (GLCD)
1. The library has been developed a bit to include support for drawing lines between two points (easy when vertical or horizontal but a but trickier when diagonal).
2. Also a rectangle function has been added.
3. Both of these can be either drawn black, white or inverted (the pixels are the opposite of the background).
4. A full character LCD font has been added (useful for making a character LCD with a graphical LCD...)
5. A blink function has been added so lines or rectangles can be given their own blink speed. Multiple such objects can be blinking at the same time (each with different blink speeds if required). The blinking is fully coordinated by the LCD task so the application doesn't need to get involved. The objects blinking can also be individually disabled.
6. The GLCD is being ported to a Samsung controller (more or less working) with compatible application interface. This means that the two most popular controllers (as far as I am aware) are then supported.
7. An OLED GLCD compatible interface has been built in. The reason for this is that many Luminary Micro boards have an OLED (usually gray scale) - although many real projects will target a GLCD it is useful to be able to test and develop also on the OLED (which is probably about the same dimension in terms of X,Y). This mode doesn't utilise gray scales - it is just black/white - but it is very handy to play with if no GLCD is wired up or available. This may also allow a number of Luminary Micro users to make first steps with the library just because it is so practical with the on-board display...
8. The next step which is foreseen is an LCD document update with the new functions and a new Luminary Micro SP to allow an easy start with these kits. It is very easy to use and also great fun to play with!

Regards

Mark

Kabron:
Dear Mark
There is not CGLCD.c file in uTasker :(
Where can I find it?

mark:
Hi

CGLCD.c is only included in packages with color LCD on their development boards.
That is for
- AVR32 (the EVK1105 eval board)
- Luminary Micro (EK_LM3S3748)


TFT.c is only available in the LPC2XXX package (specifically for testing the TFT on the LPC2478 board).

The color LCD code is based on the evaluation board suppliers code but illustrates how existing code can also be simulated in the uTasker simulator (as shown by screen-shots at http://www.utasker.com/Demos/Simulations.html). The code is not yet a part of the uTasker graphical library, which is being developed initially for GLCD and then will advance to color once the ground work has been completed and the interfaces (as much compatibility as possible between different types) have been refined.

Regards

Mark

Navigation

[0] Message Index

[#] Next page

Go to full version