Action
Configures the Graphical LCD display.
Syntax
Config GRAPHLCD = type , PORT = mode, CE = pin , CD = cd , COLS = 30
Remarks
Type |
This must be one of the following :
|
||||
mode |
This is the name of the port that is used to put the data on the LCD data pins db0-db7. P1 for example. |
||||
Ce |
The name of the pin that is used to enable the chip on the LCD. |
||||
Cd |
The name of the pin that is used to control the CD pin of the display. |
||||
Cols |
The number of columns for use as text display. The current code is written for 30 columns only. |
In the sample the following connections were used:
P1.0 to P1.7 to DB0-DB7 of the LCD
P3.2 to FS, font select of LCD can be hard wired too
P3.5 to CE, chip enable of LCD
P3.4 to CD, code/data select of LCD
P3.6 to WR of LCD, write
P3.7 to RD of LCD, read
The LCD used from www.conrad.de needs a negative voltage for the contrast.
Two 9V batteries were used with a pot meter.
The FS (font select) must be set low to use 30 columns and 8x8 fonts.
It may be connected to ground. This pin is not used by the software routines.
The current asm code only support 30 columns. You can change it however to use 40 columns.
The T6963C displays have both a graphical area and a text area. They can be used together. The routines use the XOR mode to display both text and graphics layered over each other.
The statements that can be used with the graphical LCD are :
CLS, will clear the graphic display and the text display
CLS GRAPH will clear only the graphic part of the display
CLS TEXT will only clear the text part of the display
CLS BOTH is the same as CLS and will clear both text and graphics.
LOCATE row,column Will place the cursor at the specified row and column
The row may vary from 1 to 8 and the column from 1 to 30.
CURSOR ON/OFF BLINK/NOBLINK can be used the same way as for text displays.
LCD can also be the same way as for text displays.
LCDHEX can also be used the same way as for text display
New are:
SHOWPIC X, Y , Label where X and Y are the column and row and Label is the label where the picture info is placed.
PSET X, Y , color Will set or reset a pixel. X can range from 0-239 and Y from 9-63. When color is 0 the pixel will turned off. When it is 1 the pixel will be set on.
$BGF "file.bgf" 'inserts a BGF file at the current location
$TIFF is removed from the Help but it still supported this version. $BGF should be used however.
Example
'------------------------------------------------------------------------------
' (c) 1995-2006 MCS Electronics
' GLCD.BAS
' Sample to show support for T6963C based graphic display
' Only 240*64 display is supported with 30 columns(yet)
' At the moment the display can only be used in PORT mode
' Connection :
' P1.0 - P1.7 to DB0-DB7 of LCD
' P3.2 to FS, font select of LCD can be hard wired too
' P3.5 to CE, chip enable of LCD
' P3.4 to CD, code/data select of LCD
' P3.6 to WR of LCD
' P3.7 to RD of LCD
'A future version will allow external data access too which also uses RD and WR
'The display from www.conrad.com needs a negative voltage for the contrast.
'I used two 9 V batteries
'------------------------------------------------------------------------------
'configure the LCD display
Config Graphlcd = 240 * 64 , Port = P1 , Ce = P3.5 , Cd = P3.4 , Cols = 30
'dimension some variables used by the DEMO
Dim X As Byte , Y As Byte
'
Reset P3.2 '8 bit wide char is 30 columns
'The following statements are supported:
Cls 'will clear graphic and text
'cls TEXT will clear only the text
'cls GRAPH will clear only the graphic part
'To init the display manual you can use:
'Lcdinit
'But this should not be needed as it is initilised at start up.
'Locate is supported and you can use 1-8 for the row and 1-30 for the column
Locate 1 , 1
'cursor control is the same as for normal LCD
Cursor On Blink
'And to show some text you can use LCD
Lcd "Hello world"
'Note that the cursor position is not adjusted. You can set it with locate
'Now comes the fun part for using a graphic LCD
'We can display a BMP file. You may use MSPAINT or any other tool that can create
'a BMP file. With the Graphic converter from the Tools Menu you can convert the file
'into a BGF file. (BASCOM GRAPHICS FILE). The conversion will convert all non white
'pixels to BLACK.
'To display the BGF file you use the SHOWPIC statement that needs an X and Y parameter
'the third param is the label where the data is stored.
'The position must be dividable by 8 because this is the way the display handles the data
Showpic 0 , 0 , Picture1
'And we use the PSET known from QB to set or reset a single pixel
'A value of 0 means clear the pixel and 1 means set the pixel
'create a block
For X = 0 To 10
For Y = 0 To 10
Pset X , Y , 1
Next
Next
'You could remove it too
For X = 0 To 10
For Y = 0 To 10 Step 2
Pset X , Y , 0
Next
Next
'A simple scope or data logger could be made with PSET !
'We hope to get an AN from an inspired user :-)
End
'label for the picture
Picture1:
'$BGF includes the data from the specified file
$bgf "samples\mcs.bgf"