StackBook Part 4 - More screen!
25 08 09 - 11:49 It was quite clear from the start that the character LCD would not be anywhere near enough screen space for anything serious.
So something had to be done. Anyway, you probably know about what happened to the previous gLCD I had.
Anyway, I have a nice new 192x64 LCD that is not only bigger than the old one, it came with a testing board, and has it's magic smoke intact. So let's wire it up:

(Remember what I said about improvising?)


The testing board is pretty good - power is taken from the USB port - and there's space for a pin header on the left which you can solder a programming header on and reprogram the chip. Unfortunately the chip is a 16F57 - rather low end, but it serves the purpose.
So let's get it onto the breadboard.
There's an Arduino library for the KS0108 controller (again, nearly all of these GLCDs use the same chip or a clone of it - but you have to be careful as there's two different pinouts, and the 192x64s are different to the 128x64s.

Hey, it works.

Except when it doesn't.
After much annoyance, the problem was eventually traced to a) Chip Select 3 was floating, and b) there were no capacitors on the crystal.
If you don't know what Chip Select lines do on one of these LCDs: it's simple. The 4 ICs on the back of the display are a KS0107 and 3 KS0108s. The KS0107 controls the 64 row inputs and the general LCD. The KS0108s control each lot of 64 columns: 192x64 LCDs have 3 of them, 128x64 LCDs have 2 of them. Since we can only write to one at a time, we have enable lines for them. But the Arduino library that I'm using only seems to be set up for 128x64 screens. After I put a wire in to pull CS3 high, the LCD panel started behaving somewhat more. When I switched it to the internal oscillator, the garbage drawing problems were fixed. I need to put two caps on the crystal. Side effect of the internal oscillator is that the chip is now running at 8MHZ - but it's not the slowdown that makes it more reliable as I already turned up the delay and that didn't fix things.

Seems, though, that I had CS1 and CS2 swapped. They seem to be right now (you can tell because the 64x64 blocks are in the wrong order).
We're going to need a better font than Arial 14 point though (Helvetica > Arial anyway...). For this I used GLCDFontCreator, a handy java applet that not only can create new fonts, but can convert existing ones.
To do this, go to File->New Font

Rename the font, select the font you want to convert, and for a pixelfont, pick the right size. Hit OK, then use Export -> Export Font to save it as a .h file.
You may notice that I named the font f04b03 - this is because identifiers in C cannot start with a number. The font being converted is from this page.
Trackback link: http://gm.stackunderflow.com/blog/pivot/tb.php?tb_id=137