This section covers GLCD devices that use the NT7108C graphics controller.
The NT7108C is an GLCD is driven by on-board 5V parallel interface chipset NT7108C. They are similar to the KS0108.
The GLCD controller is the Winstar WDG0151-TMI module, which is a 128×64 pixel monochromatic display.
It uses two Neotic display controller chips: NT7108C and NT7107C, which are similar with Samsung KS0108B and KS0107B controllers.
The controller uses a dot matrix LCD segment driver with 64 channel output, and therefore, the WDG0151 module contains two
sets of it to drive 128 segments.
The GCBASIC constants shown below control the configuration of the NT7108C controller.
The connectivity options are as follows, This is required between the microcontroller and the GLCD to control the data bus.:
- A full port mode. Where a full data port therefore eight contiguous port.bits. The port is used the data communications.
- Eight port.bits mode. This option allows for greater flexibility with the configuration but will operate slower then the
full port mode. These port.bits are used the data communications.
To use the NT7108C driver simply include the following in your user code. This will initialise the driver.
;Full port mode #include <glcd.h> #DEFINE GLCD_TYPE GLCD_TYPE_NT7108C #define GLCD_DATA_PORT PORTD 'Data Port #define GLCD_CS1 PORTC.1 'CS1 control line #define GLCD_CS2 PORTC.0 'CS2 control line #define GLCD_RS PORTe.0 'RS control line #define GLCD_Enable PORTe.2 'Enable control line #define GLCD_RW PORTc.3 'RW control line #define GLCD_RESET PORTC.2 'Reset control line
or
;Eight port.bits mode #include <glcd.h> #DEFINE GLCD_TYPE GLCD_TYPE_NT7108C ;Defines (Constants) ;Define port as 8 port,bit(s) #define GLCD_DB0 PORTA.2 'Data Port.bit 0 #define GLCD_DB1 PORTC.0 'Data Port.bit 1 #define GLCD_DB2 PORTC.1 'Data Port.bit 2 #define GLCD_DB3 PORTC.2 'Data Port.bit 3 #define GLCD_DB4 PORTB.4 'Data Port.bit 4 #define GLCD_DB5 PORTB.5 'Data Port.bit 5 #define GLCD_DB6 PORTB.6 'Data Port.bit 6 #define GLCD_DB7 PORTB.7 'Data Port.bit 7 ;End of define as 8 port,bit(s) #define GLCD_CS1 PORTC.7 'CS1 control line #define GLCD_CS2 PORTC.6 'CS2 control line #define GLCD_RS PORTC.5 'RS control line #define GLCD_ENABLE PORTA.4 'Enable control line #define GLCD_RW PORTC.4 'RW control line #define GLCD_RESET PORTC.3 'Reset control line
The GCBASIC constants for the interface to the controller are shown in the table below.
Constants | Controls | Options |
---|---|---|
|
|
|
|
Specifies the output pin that is connected to Register Select on the GLCD. |
Required |
|
Specifies the output pin that is connected to Read/Write on the GLCD. |
Required |
|
Specifies the output pin that is connected to |
Required |
|
Specifies the output pin that is connected to |
Required |
|
Specifies the output pin that is connected to |
Required |
Full port mode |
||
|
Specifies the port that is connected to 8 connections on the GLCD. |
Required when using full port mode |
Eight port.bits mode |
||
|
Specifies the port.bit that is connected to a single connection on the GLCD. |
Required when using eight port.bits mode |
The GCBASIC constants defined for the controller type are shown in the table below. The NT7108C is very sensitive to clock timings. You may to adjust the clock timing to ensure the display operates correctly.
Constants | Controls | Default |
---|---|---|
|
The width parameter of the GLCD |
|
|
The height parameter of the GLCD |
|
|
Defining this will invert the Y Axis |
Not defined |
|
Read delay |
Default is 7 Can be set to improve overall performance. |
|
Write delay |
Default is 7 Can be set to improve performance. |
|
Clock Delay |
Default is 7 Can be set to improve performance. |
The GCBASIC constants for control display characteristics are shown in the table below.
Variables | Controls | Default |
---|---|---|
|
Width of the current GLCD font. |
Default is 6 pixels. |
|
Size of the current GLCD font. |
Default is 0. This equates to the standard GCB font set. |
|
Size of the current GLCD font. |
Default is 1. This equates to the 8 pixel high. |
The GCBASIC commands supported for this GLCD are shown in the table below.
Command | Purpose | Example |
---|---|---|
|
Clear screen of GLCD |
|
|
Print string of characters on GLCD using GCB font set |
|
|
Print character on GLCD using GCB font set |
|
|
Print characters on GLCD using GCB font set |
|
|
Draw a box on the GLCD to a specific size |
|
|
Draw a box on the GLCD to a specific size that is filled with the foreground colour. |
|
|
Draw a line on the GLCD to a specific length that is filled with the specific attribute. |
|
|
Set a pixel on the GLCD at a specific position that is set with the specific attribute. |
|
|
Set a byte value to the controller, see the datasheet for usage. |
|
|
Read a byte value from the controller, see the datasheet for usage. |
|
For a NT7108C datasheet, please refer here.
This example shows how to drive a NT7108C based Graphic LCD module with the built in commands of GCBASIC. See Graphic LCD for details, this is an external web site.
;Chip Settings #chip 16F1939,32 #option explicit #config MCLRE_On #include <glcd.h> #define GLCD_TYPE GLCD_TYPE_NT7108C ' Specify the GLCD type #define GLCDDirection 0 ' Flip the GLCD 0 do not flip, 1 flip 'Setup the device #define GLCD_CS1 PORTC.1 'D12 to actually since CS1, CS2 can be reversed on some devices #define GLCD_CS2 PORTC.0 #define GLCD_DATA_PORT PORTD #define GLCD_RS PORTe.0 #define GLCD_Enable PORTe.2 #define GLCD_RW PORTc.3 #define GLCD_RESET PORTC.2 GLCDPrint ( 4, 1, "GCBASIC 2021") ; Print some text Box 0, 0, 127, 10 Line 63, 10, 63, 63 Line 0, 37, 127, 37 Circle 63, 37, 15 End
For more help, see GLCDCLS, GLCDDrawChar, GLCDPrint, GLCDReadByte, GLCDWriteByte or Pset
Supported in <GLCD.H>