|PIC Assembler Character Table for LCD Displays|
Using an excellent tool developed by Cosmicvoid, I've created a small font for use on LCD displays without a built in character set.
The font is designed to fit in lines 8 pixels high (font is 3-6 pixels high and is 3-5 pixels wide). I took the original font supplied with the editor and shrunk it as much as I could. The example on the left is rendered on a 128x64 pixel screen and you can see there's a lot of room for text.
The display is the interface of a touchscreen project I'm working on and is part of the excellent EA DOG series available here.
1. Obtaining the Ready Made Character Table
You can just download the assembler font table in the download section here.
To use the font table, just include it in your source code and write a function like the one below. You will have to subtract 32 from ASCII codes to translate them to the entries of the character table.
If you want to edit the font or make your own from it you will have to build it yourself.
2. Building the Font Table
Edit the font by clicking on the characters, add some custom symbols if you want and then click Save & Exit. Choose ANSI C and Columns as the file format. This will create a Font8MB.c and Font8MB.h file in the current directory.
3. Generating the PIC Assembler Table
To convert the font to a PIC assembly table you can use a short C++ program I've written. Download convert.cpp from here.To build the file, compile it with gcc and then run it like so
$ g++ convert.cpp Font8MB.c $ ./a.out > chartable.inc
This will generate the include file and the generated font file is available for download in the download section of the site, here.
|Last Updated on Tuesday, 02 February 2010 11:14|