Propeller Font on ST7735 TFT
I recently purchased some 128x128 ST7735 color TFT displays from Adafruit:
I got these because there is Spin code available to drive them:
The code is rife with pre-processor stuff, and I tried it on both FlexProp and PropellerIDE, since both have compilers that support pre-processors. But I wasn't too happy with either option. As a consequence, I did the necessary pre-processing manually, stripping out all of the directives, so I could work with it on the good ol' Propeller Tool. Ahhh!
The only font that came with the software driver was a tiny 8x8 font that one would have to squint to see. For my app (more on that later), I needed a bigger font that could be read at a distance. The Parallax font built into the Propeller's ROM fit the bill perfectly. Plus, it can be scaled up and down quite readily.
So I wrote a driver in Spin that uses the Parallax font. Here's a photo of some sample output:
There's one more size (32x64) that takes up half the screen, but you get the idea.
Here's the front-end code that produces the above display:
PUB start setup dsp.mirrorh(TRUE) ' change these to suit the dsp.mirrorv(TRUE) ' orientation of your display dsp.bgcolor(dsp#BLACK) dsp.clear dsp.setfont(dsp#FONT8x16) dsp.fgcolor(dsp#CYAN) dsp.pixposition(64, 0) dsp.ctrstr(string("FONT8x16")) dsp.setfont(dsp#FONT16x16) dsp.fgcolor(dsp#YELLOW) dsp.pixposition(64, 16) dsp.ctrstr(string("16x16")) dsp.setfont(dsp#FONT8x32) dsp.fgcolor(dsp#GREEN) dsp.pixposition(64, 32) dsp.ctrstr(string("FONT8x32")) dsp.setfont(dsp#FONT16x32) dsp.fgcolor(dsp#MAGENTA) dsp.pixposition(64, 64) dsp.ctrstr(string("16x32")) dsp.setfont(dsp#FONT32x32) dsp.fgcolor(ORANGE) dsp.pixposition(64, 96) dsp.ctrstr(string("3232")) repeat
The Spin code that draws characters to the screen is painfully sloooow! So my next task is to convert my character generator to PASM. This will be done using a small hub-RAM buffer to hold the pixels for a character at a time, which can then be blasted to the ST7735 all at once.
More to come...