As I explained in my previous post, back in July I embarked on a journey to try and get a nice new 128×64 pixel graphical LCD display to play nicely with my Arduino projects. I hit some fairly big problems with this, in areas I maybe didn’t expect…
The Basics
So the basics of talking to the SerialGLCD backpack are quite simple. You just hook it up to the serial transmit pin of the Arduino (pin 2 on an Uno), and then just sent bytes to it. The general form of the commands is to send the byte 0x7C, which means “here starts a command”, and then the command.
Here’s a simple example that draws a little box in the middle of the screen:
Serial.write(0x7C); // command Serial.write(0x0F); // box Serial.write(59); // X1 Serial.write(27); // Y1 Serial.write(69); // X2 Serial.write(37); // Y2 Serial.write(0x01); // Draw
The Problem
Seems simple enough. But… and there’s always a but, the firmware is broken. So for starters that last parameter (wether to set the rectangle pixels to foreground or background) is totally ignored. But of course, as any non-command text is printed to the display, it’s not really ignored, it’s shown on-screen as garbage.
Another problem, is that if you run a loop or just generally are sending more than one box to the screen, it corrupts. You’ll find extra lines, skipped commands, garbage on the screen, and so on.
The Solution
The only solution is to accept that the SparkFun firmware is broken, and write your own. Okay, maybe not write your own, that’s tricky stuff. Luckily, a kind individual going by the name of SummoningDark has done this for us, so all we need to do is download his firmware from his SourceForge and burn it onto the backpack using an ISP.
Links
- The Graphic LCD 128×64 STN LED Backlight
- The SparkFun Graphic LCD Serial Backpack
- SummoningDark’s project page on SourceForge
- A great post on the Arduino forums with step-by-step details on building the ISP
Arduino
HobbyTronics
Maplin
SK Pang