Saturday 1 March 2014

14-segment starburst display. Font included!

Recently as part of an FPGA project I got hold of some 14-segment (Kingbright PDC54-11EWA)m starburst displays from ebay . I got 8 (sixteen characters) though as usual I only had a vague idea of what to do with them. In the end I got round to doing something with one of them. I've wired it up to a Matrix Multimedia eblocks eb-009 dev board and hacked together a quick test routine in a pic16LF877A.

As soon as I started to program for this I realised I'd need a font file to map the ascii values to bit patterns that turn on the segments of the display. I had a hunt round on the internet and found a few TruType and other fonts but only one place that mentioned an actual file for generating the bit patterns and he wanted cash! So I bit the bullet and threw together a quick and dirty font generator web page which helped me to make a C file containing the bit patterns for 32-127 ascii characters.

 You can download and use the code generator here. It's pretty simple: enter a hexadecimal code in the text box and the display that will be generated is shown as a picture. Unzip to your drive and open the .htm file in your browser (you need to click "allow blocked content in IE). The usual disclaimers apply to this file, use at your own risk, not guaranteed to work, may cause dandruff and vomiting. This assumes that the bits of your display are in the same order as the a-q labelled segments on the datasheet with "a" the LSB and the dp the 15th bit. The screen-shot below shows and example.

I went through each ascii character and made an entry for each by hand - my font is fairly good for most of the uppercase and symbol characters but maybe a little weird for some of the lowercase characters which have to be frigged a bit to get them to work with the segments.



The code for a the quick PIC project can be downloaded here. The segments are mapped to PORTD for segments a-h LSB first and PORTB for segments j-q on PORTB. Bit 0 of PORTA selects between digit 0 and 1 and makes a quick scrolly message and then runs through the letters and symbols. The font file (probably the most useful part is in font14.c) which is a C array of the mappings for characters 32-127 ascii.




1 comment:

  1. the code generator is GooooooD !
    Thanks... really thank you from Sourth Korea.

    ReplyDelete