Tutorials - Elettronica

 
 

Dot matrix LCD : the CGRAM


5x7 or 5x8 ?

We talked about 5x8 matrix as in the examples the symbols occupy usually the first 7 rows, leaving nothing on the octave.

We must consider that each element of the display consists of 8 rows of 5 points, so you can view both a 5x8 matrix a 5x7.

A first consideration that you can do is that the 5x7 matrix is smaller than the 5x8 and therefore allows to realize a smaller number of symbols. It would seem to be preferred, therefore, the second.
And, in fact, from the point of view of use of the memory DDRAM, nothing changes in 'or in a' other situation. Nor is no difference in the 'use of CGRAM, where each symbol is composed of 8 bytes, regardless of whether the' s is zero or less.

It may however be noted that many symbols can be achieved just as effectively with both 7 that with 8 lines. 

For example:

; arrow up
#define LCDcharAR1 db 04,0x0E,0x15,04,04,04,04,00
;0x04 ; . . # . .
;0x0E ; . # # # .
;0x15 ; # . # . #
;0x04 ; . . # . .
;0x04 ; . . # . .
;0x04 ; . . # . .
;0x04 ; . . # . .
;0x00 ; . . . . . cursor row

is just as valid as:

; arrow up
#define LCDcharAR1 db 04,0x0E,0x15,04,04,04,04,04
;0x04 ; . . # . .
;0x0E ; . # # # .
;0x15 ; # . # . #
;0x04 ; . . # . .
;0x04 ; . . # . .
;0x04 ; . . # . .
;0x04 ; . . # . .
;0x04 ; . . # . . 

On the other hand, some symbols are only possible with 8 lines. For example:

; little man
#define LCDcharAR1 db 0x0E,0x11,0x0E,04,0x1F,0x0A,0x11
;0x0E ; . # # # .
;0x11 ; # . . . # 
;0x0E ; . # # # .
;0x04 ; . . # . .
;0x1F ; # # # # #
;0x04 ; . . # . .
;0x0A ; . # . # .
;0x11 ; # . . . #

However, the boundary between the 'use of symbols to 8 lines or 7 lines is, in fact, given by the cursor.

Indeed, we see from this that the magnification slider, if enabled to be visible, is a coma "underscore" character and occupies the eighth row.

If the cursor is in a cell that displays a character, it will cover the 'eighth line of the character, with the ability to make it incomprehensible.

For this reason it is generally preferred to use 5x7 matrices, which leave free this line. The fonts in CGROM are usually in this format.

Obviously, if the cursor is not activated, if it is not ever find together with a character or characters are such as to be distinguished even if they are shown together with the cursor, the 5x8 matrix allows a greater number of symbols.


 

 

Copyright © afg. Tutti i diritti riservati.
Aggiornato il 04/12/12.