Casio FX880P: Custom Screen Characters

Creating custom screen characters for Casio FX-850P/FX880P

Here’s the standard character table from the User Manual Most of these can be displayed on the screen and/or entered on the keyboard but some require the use of the CHR$ function to display as there is no keyboard equivalent. Wouldn’t it be great if we could create our own custom characters? We can!

FX-850 Char Table.png

As you can see above, the chars 252 to 255 are not defined so we have four memory locations we can use to store custom characters. These are defined using the DEFCHR$ command. A string defines the character containing five hex values, one for each the five pixel columns on the LCD matrix display. 

Example: 

10 DEFCHR$(255)="FF00FF00FF"

This draws three vertical lines. Here’s something I found online; to build a set of custom characters and display them:

10 REM Custom Char Test - Ciao!
20 DEFCHR$(252) = "1824428244"
30 DEFCHR$(253) = "04085C0204"
40 DEFCHR$(254) = "0C120C0204"
50 DEFCHR$(255) = "0C120C00FA"
60 PRINT CHR$(252) + CHR$(253) + CHR$(254)+ CHR$(255)

OK, so how do I define each character? There’s no built-in way of doing that although if you google hard enough, you’ll stumble across this example coded by G. Schwandtner in 1992 called  ASCII-Editor.

While this is a clever piece of coding, it’s a little difficult to follow. To make it easier to understand, I built a tool in Microsoft Excel that provides the codes based on the shape you create and can also build the shape of the character based on codes provided so you can see how it works. 

How Does It Work?

The tool generates the hex codes by converting the binary values in each column to a hex value and then doing a lookup on this value to determine where on the screen it would be drawn.

To create your own custom characters, have a play with the tool and let me know. 

The Excel file can be downloaded here includes an older Excel 95-2003 (.xls) version too.

Note: I avoided using the CONCAT function for backwards compatibility with older versions. If running an older version of Excel you need to enable the Analysis Tool-pack add-in to give access to the BIN2HEX function.

The Casio FX-850P/FX-880P uses a 7x5 matrix array to represent pixels on the LCD display as follows:

Example 1: “C” character matrix

Hex 1 2 3 4 5

80	0	0	0	1	0
40	0	0	1	0	1
20	0	1	0	0	0
10	1	0	0	0	0
08	1	0	0	0	0
04	0	1	0	0	1
02	0	0	1	1	0
00	0	0	1	1	0

Summing the binary values for each column and converting to hexadecimal gives you the 5 hex pair values that construct the 10-character hexadecimal char value 

e.g. 1824428244 is col1 = 10+8 col2 = 20+04 col3 = 40+02 col4 = 80+02 col5 = 40+04

So reading down column 1 from top to bottom as binary 00011000 —> 0x18 hex

Example 2: “Race car”

In the spreadsheet, you can type in your own binary values inside the box provided using zeroes or ones and it will calculate the hex string and generate the character from that:

CustomChar-02.png

Which produces an example LCD output:

CustomChar-03.png

Once you’ve created a new character, here’s the code to see what it looks like on the calculator screen:

10 REM Custom Character Demo - Hearts
20 DEFCHR$(252) = "1834123418"
30 DEFCHR$(253) = "183C1E3C18"
40 REM Custom Character Demo - Race Cars
50 DEFCHR$(254) = "CC527E52CC"
60 DEFCHR$(255) = "2C527E522C"
70 PRINT CHR$(252) + CHR$(253) + CHR$(254)+ CHR$(255)