• We recently switched our forum platform. If you experience any issues please email support@crystalfontz.com

Large Block Numbers On 635

NoIdea

New member
Hello,

I am developing an application in vb6 that will need to display large block numbers on the display. I see that this is detailed in the 634 lcd spec however the given examples do not seem to run on my 635.

Is it possible to display block numbers on this display? If not, can this done by defining custom characters?

Thanks!
Looking for additional LCD resources? Check out our LCD blog for the latest developments in LCD technology.
 
Last edited:

CF Tech

Administrator
The CFA-634 has the large numbers built into its functionality.

The CFA-635 should be able to do it, and will even look a bit nicer since there will not be the horizontal lines, but you would need to come up with the special character codes and the mapping of them onto the display.

CC2 does it:



(from https://forum.crystalfontz.com/showthread.php?s=&threadid=4251 )

I do not know if CC2 admin could offer some help or not.
 

CF Mark

Administrator
Is it possible to display block numbers on this display? If not, can this done by defining custom characters?
Both the 634 and 635 use the same screen generation source code (custom character based big nums), the only difference is the code which outputs the data to the LCD (serial terminal style vs packet based).

From memory one of the WinTest utils has a bignums demo. This code came from it and is used in CC2 to produce the bignums time screen (as shown in the above photo)...

Code:
const BYTE cchars[8][8] =
{
	{0, 1, 3, 7, 15, 31, 63, 63},		//lower right fill	0
	{0, 32, 48, 56, 60, 62, 63, 63},	//lower left fill	1
	{63, 63, 62, 60, 56, 48, 32, 0},	//upper left fill	2
	{63, 63, 31, 15, 7, 3, 1, 0},		//upper right fill	3
	{63, 63, 63, 63, 0, 0, 0, 0},		//upper 1/2 fill	4
	{0, 0, 0, 0, 63, 63, 63, 63},		//lower 1/2 fill	5
	{0, 28, 62, 62, 62, 62, 28, 0},		//circles			6
	{63, 63, 63, 63, 63, 63, 63, 63}	//full				7
};


const BYTE bnums[10][4][3] =
{
	{{0, 4, 1},{7, 9, 7},{7, 9, 7},{3, 5, 2}},	// 0
	{{0, 7, 9},{9, 7, 9},{9, 7, 9},{5, 7, 5}},	// 1
	{{0, 4, 1},{9, 0, 2},{0, 2, 9},{7, 5, 5}},	// 2
	{{0, 4, 1},{9, 0, 2},{9, 3, 1},{3, 5, 2}},	// 3
	{{0, 9, 7},{7, 9, 7},{7, 5, 7},{9, 9, 7}},	// 4
	{{7, 4, 4},{7, 5, 5},{9, 9, 7},{3, 5, 2}},	// 5
	{{0, 4, 1},{7, 5, 5},{7, 9, 7},{3, 5, 2}},	// 6
	{{7, 4, 7},{9, 0, 2},{0, 2, 9},{7, 9, 9}},	// 7
	{{0, 4, 1},{3, 5, 2},{0, 4, 1},{3, 5, 2}},	// 8
	{{0, 4, 1},{7, 9, 7},{4, 4, 7},{3, 5, 2}}	// 9
};
 

NoIdea

New member
Thanks so much for your help, when ever I try to output the block numbers all I get is garbage data printed on the display. I think that I may not be interpreting the code you posted correctly. Is their was a special command required to initialize block text?

At the moment I have something like this:

outgoing_packet.data(2) = 0
outgoing_packet.data(3) = 4
outgoing_packet.data(4) = 1
.....
Then send to the display:
Call Send_Packet(outgoing_packet)

Which is all based off the vb6 example given in the spec, I then added the ability to control the buttons and LED's. My goal is to display 3 line block text with a single line of text below the numbers.

Is their any way to capture what Crystal Control sends to the display in order to create the Block numbers? perhaps something similar to the packet debugger in the wintest app? I think all I need is some sample output and I will be able to figure the rest out.

Thanks!
 

CF Tech

Administrator
The first thing you would need to do is to initialize the custom ("special" in the data sheet) characters using command 9:
Code:
//1st custom character 0, 1, 3, 7, 15, 31, 63, 63
outgoing_packet.command=9
outgoing_packet.data_length=9
outgoing_packet.data(0) = 0
outgoing_packet.data(1) = 0
outgoing_packet.data(2) = 1
outgoing_packet.data(3) = 3
outgoing_packet.data(4) = 7
outgoing_packet.data(5) = 15
outgoing_packet.data(6) = 31
outgoing_packet.data(7) = 63
outgoing_packet.data(8) = 63
Call Send_Packet(outgoing_packet)

//2nd custom character 0, 32, 48, 56, 60, 62, 63, 63
outgoing_packet.command=9
outgoing_packet.data_length=9
outgoing_packet.data(0) = 1
outgoing_packet.data(1) = 0
outgoing_packet.data(2) = 32
outgoing_packet.data(3) = 48
outgoing_packet.data(4) = 56
outgoing_packet.data(5) = 60
outgoing_packet.data(6) = 62
outgoing_packet.data(7) = 63
outgoing_packet.data(8) = 63
Call Send_Packet(outgoing_packet)
 . . . (repeat for all 8 custom characters)
Now that you have sent the "font" for the custom characters, you need to place them on the display using command 31:
Code:
//1st row of 1st character "4": {0, 9, 7}
outgoing_packet.command=31
outgoing_packet.data_length=5
outgoing_packet.data(0) = 3  //X coordinate
outgoing_packet.data(1) = 0  //Y coordinate
outgoing_packet.data(2) = 0
outgoing_packet.data(3) = 9
outgoing_packet.data(4) = 7
Call Send_Packet(outgoing_packet)

//2nd row of 1st character "4": {7, 9, 7}
outgoing_packet.command=31
outgoing_packet.data_length=5
outgoing_packet.data(0) = 3  //X coordinate
outgoing_packet.data(1) = 1  //Y coordinate
outgoing_packet.data(2) = 7
outgoing_packet.data(3) = 9
outgoing_packet.data(4) = 7
Call Send_Packet(outgoing_packet)

//3rd row of 1st character "4": {7, 5, 7}
outgoing_packet.command=31
outgoing_packet.data_length=5
outgoing_packet.data(0) = 3  //X coordinate
outgoing_packet.data(1) = 2  //Y coordinate
outgoing_packet.data(2) = 7
outgoing_packet.data(3) = 5
outgoing_packet.data(4) = 7
Call Send_Packet(outgoing_packet)

//4th row of 1st character "4": {9, 9, 7}
outgoing_packet.command=31
outgoing_packet.data_length=5
outgoing_packet.data(0) = 3  //X coordinate
outgoing_packet.data(1) = 3  //Y coordinate
outgoing_packet.data(2) = 9
outgoing_packet.data(3) = 9
outgoing_packet.data(4) = 7
Call Send_Packet(outgoing_packet)
Of course, if you do this stuff with loops accessing an array, it will be hugely smaller.
 

NoIdea

New member
Thank you soooo much!! Its working great! I did have one last question, do you happen to have another chart similar to what CrystalControl Admin posted for 3 line block numbers? I tried making my own but they don't look to good (specifically numbers 3, 8, 9, and 5) I'm sure their are probably better ways to go about it.

Thanks again!!
 

CF Mark

Administrator
These are two high:

Code:
	const static unsigned char six_by_16_font[][16]=
		{{0x1C,0x3E,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x3E,0x1C,0x00},  // "0"
		{0x0C,0x1C,0x1C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x1E,0x1E,0x00},  // "1"
		{0x1C,0x3E,0x63,0x63,0x63,0x03,0x03,0x1F,0x3C,0x60,0x60,0x60,0x60,0x7F,0x7F,0x00},  // "2"
		{0x1C,0x3E,0x63,0x63,0x63,0x03,0x06,0x1C,0x06,0x03,0x63,0x63,0x63,0x3E,0x1C,0x00},  // "3"
		{0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x7F,0x7F,0x06,0x06,0x06,0x06,0x06,0x06,0x00},  // "4"
		{0x7F,0x7F,0x60,0x60,0x60,0x60,0x3C,0x1E,0x03,0x03,0x03,0x63,0x63,0x3E,0x1C,0x00},  // "5"
		{0x0E,0x1E,0x30,0x60,0x60,0x60,0x7C,0x7E,0x63,0x63,0x63,0x63,0x63,0x3E,0x1C,0x00},  // "6"
		{0x7F,0x7F,0x03,0x03,0x07,0x06,0x0E,0x0C,0x1C,0x18,0x18,0x18,0x18,0x18,0x18,0x00},  // "7"
		{0x1C,0x3E,0x63,0x63,0x63,0x63,0x36,0x1C,0x36,0x63,0x63,0x63,0x63,0x3E,0x1C,0x00},  // "8"
		{0x1C,0x3E,0x63,0x63,0x63,0x63,0x63,0x3F,0x1F,0x03,0x03,0x03,0x06,0x3C,0x38,0x00}  // "9"
         };
 

ElmerFudd

New member
I'm using the XES635 (USB) and wanted to display large numbers (2 rows high) and copied array the

const static unsigned char six_by_16_font[][16]=
{{0x1C,0x3E,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x3E,0x1C,0x00}, // "0"
{0x0C,0x1C,0x1C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x1E,0x1 };
...
...
from above... However I soon realized (ok, the char's had to blink a few times) that the 0x63 exceeds the 63 decimal value that the special characters use ( ie. they blink and don't quite fit).. Is there a another array that the CC2 uses that I can use?

Thanks much,
ef.
 
USB LCD Displays - Graphic and Character LCDs with a Keypad
Top