CLCD

lcds_controller lcd

User Manual: CLCD Comfile

Open the PDF directly: View PDF PDF.
Page Count: 5

CLCD User Manual pg. 1
www.comfiletech.com (888)9CUBLOC Fax (650) 638-1360
CLCD
CLCD User Manual
Comfile Technology Inc.
On the back of the CLCD, a control board is attached. This control board receives CuNET (I2C) or RS232C signal and prints on the CLCD.
CUNET RS232 5V RS232
DIP S/W
CLCD can communicate using I2C or RS232. There are two RS232 connectors, one for 3pin 5V level signals and the other for 4 pin +/- 12V
level signals.
CUNET RS232 5V RS232
SDA
RX
SCL
N/C
5V_RX
5V
5V
5V
GND
GND
GND
Use the DIP switch to set the I2C slave address. The 4
th
DIP switch is not used.
DIP Switch RS232 Baud rate I2C Slave
Address
1 2 3
ON
2400
0
1 2 3
ON
4800
1
1 2 3
ON
9600
2
1 2 3
ON
19200
3
1 2 3
ON
28800
4
1 2 3
ON
38400
5
Comfile CLCD Display Module
CLCD-216 & 420
CLCD User Manual pg. 2
www.comfiletech.com (888)9CUBLOC Fax (650) 638-1360
CLCD
CLCD User Manual
Comfile Technology Inc.
1 2 3
ON
57600
6
1 2 3
ON
115200
7
One of CUNET(I2C) or RS232 communication can be used. If both are connected, please make sure when one of them is working, other is
not.
The following is CLCD byte code:
If received data is not a command, the CLCD
will display it on the screen.
When connecting RS232, maximum baud
rate settings for 12V(4 pin) level is 38400bps.
For 5V level (3 pin), up to 115200bps can be
used.
The following is an example code when using
the CB280 to connect to the CLCD module
through CUNET protocol. When you
execute this program, CLCD will display
increment of numbers.
Command Example
(hex)
Bytes Execution
Time
Explanation
ESC ’ C’ 1B 43 2 15mS Clear screen. A 15ms
delay must be given
after this command.
ESC ‘S’ 1B 53 2 Cursor ON (Default)
ESC ‘s’ 1B 73 2 Cursor OFF
ESC ‘B’ 1B 42 2 Backlight ON (Default)
ESC ‘b’ 1B 62 2 Backlight OFF
ESC ‘H’ 1B 48 2 LOCATE 0,0
ESC ‘L’ X
Y
1B 4C xx yy 4 100 uS Change the position of
the cursor.
ESC
‘D’ 8byte
1B 44 Code
8bytes
11 Character code 8
through 15 is 8 custom
characters that the user
is free to create and
use. This command
will store the bitmap in
this custom character
memory area.
Code : 8-15 Character
code
1 01 1 Move to beginning of
row 1
2 02 1 Move to beginning of
row 2
3 03 1 Move to beginning of
row 3
4 04 1 Move to beginning of
row 4
CLCD User Manual pg. 3
www.comfiletech.com (888)9CUBLOC Fax (650) 638-1360
CLCD
CLCD User Manual
Comfile Technology Inc.
The following is an example code when using the CB280 to connect to the CLCD module through CUNET protocol. When you execute this
program, CLCD will display increment of numbers.
* The slave address of CLCD and SET DISPLAY command should match.
Const Device = Cb280
Set Display 2,0,0,50 ' Set the SLAVE ADDRESS to 0 by manipulating the DIP switch.
Dim i As Integer
i=0
Delay 100 ' Delay for start up of CLCD
Cls
Delay 200 ' Delay for initializing and clearing CLCD
Csroff
Locate 5,2
Print "Start!!!"
Delay 500
Cls
Delay 100
Do
Incr i
Locate 0,0
Print "COMFILE"
Locate 0,1
Print "CUBLOC ",Dec i
Delay 100
Loop
CLCD User Manual pg. 4
www.comfiletech.com (888)9CUBLOC Fax (650) 638-1360
CLCD
CLCD User Manual
Comfile Technology Inc.
The following is an example code when using the CB280 to connect to the CLCD module through raw I2C protocol. When you execute this
program, CLCD will display increment of numbers.
The slave address of CLCD and SET DISPLAY command should match.
Const Device = cb280
Dim ct As Integer
ct=0
Set I2c 9,8
I2cstart
‘Set Slave address to 0 and Write Operation I2C
If I2cwrite(&h70) = 1 Then Goto ERR
'Clear Screen
If I2cwrite(&h1b) = 1 Then Goto ERR
If I2cwrite(&h43) = 1 Then Goto ERR
'Turn off cursor
If I2cwrite(&h1b) = 1 Then Goto ERR
If I2cwrite(&h73) = 1 Then Goto ERR
I2cstop
Do
Delay 100
I2cstart
If I2cwrite(&h70) = 1 Then Goto ERR
'Locate 0,0
If I2cwrite(&h1b) = 1 Then Goto ERR
If I2cwrite(&h48) = 1 Then Goto ERR
'Print counter value
If I2cwrite(Asc(Dec ct)) = 1 Then Goto ERR
I2cstop
Delay 500
'increment counter value by 1
Incr ct
Loop
ERR:
Debug "ERROR!"
Return
CLCD User Manual pg. 5
www.comfiletech.com (888)9CUBLOC Fax (650) 638-1360
CLCD
CLCD User Manual
Comfile Technology Inc.
The following is an example code when using the CB220 to connect to the CLCD module through RS232 protocol. When you execute this
program, the CLCD will display increment of numbers.
The baud rate of CLCD and SET DISPLAY command should match. Otherwise you will get garbage values on the LCD when trying to
print to it.
*Make sure GND is shared among the power supply for the display and the CB220, otherwise you will get garbage values on the LCD.
*The internal regulator of CB220 does not have enough power to the CB220, you will need a separate power supply or regulator to power
the LCD.
Const Device = CB220
'Make sure to set all the DIP switches on
'the back of the CLCD to ON
‘Connect P11 (TX) of CB220 to RX pin of the CLCD.
'Set Display to CLCD/CVFD, 115200 bps, and 128 bytes of buffer
Set Display 2,1,115200,128
Dim ct As Long
ct=0
Do
Locate 0,0
Print Dec ct
Incr ct
Loop

Navigation menu