I am new to this forum and I have to say like it. Tons of good stuff and knowledge.
Q: Recently I bought a 128x64 LCD (KS0108 Controller) which I would like to use in my actual Arduino projekt to control a set of LEDs (PWM), servos and relays. The Arduino playground tutorial on http://www.arduino.cc/playground/Code/GLCDks0108 works fine BUT there are literally no pins left!!
So I decided to check the web for a solution using I2C to control this type of LCD. So far .... nothing. Does anybody out there already testet such LCD types using I2C or build a compatible I2C LCD controller ?
MAny thanks in advance
I don't know if one exists or not, but you could be the first to implement one!
There looks to be at least 5 digital pins and 1 analog pin left over; there looks like enough pins are left over to implement an SPI interface. Once you had that working (you would need another Arduino to play with this), you could then build a carrier board for the display on which you had the ATMega168/328 (for the SPI interface).
Personally, I would use the 328, since there is 2K of RAM on-board, and you could use this (with appropriate library functions - they don't exist yet) as a hidden buffer to draw to, then call a singular function to quickly update the entire screen in one fell swoop.
Additionally (and I don't think you would have to worry about altering all the code others have talked about when doing this, because I don't think controlling an LCD will depend on it - but I could be wrong), you could boost the frequency of the Arduino-based SPI controller to 20 MHz from the standard 16 MHz, for that little bit of extra speed on updates of the LCD and such (since at this point, you would be essentially building a graphics controller with the Arduino - every little bit of speed counts).
Then, to top it all off - besides the commands above (ie, write to buffer, blast buffer to screen), add commands to get/put segments of the screen (ie, sprite handling) and also add the ability to quickly draw triangles (for future 3D graphics capabilities!)...
I think Sparkfun has a serial graphic LCD. Try searching the forum for comments on it: my (possibly incorrect) recollection is that I've recently seen a posting by an unhappy user.
There's one in development, but it's not clear from the posting how soon it will be available.
I've been thinking about building an I2C slave out of an RBBB, and making a modified version of the GLCD library that does an RPC-like communication of the library calls so that programs developed for a directly-connected LCD could work (almost) without change on the "master" side. But actually doing it is down in the "someday" region of my to-do list.
The one I built is for the TEXT LCDs. I have 10 boards right now if you want one send me a PM. It supports all the serial outputs from the mega and it supports I2C. There is a jumper on board to select what input is used including the different I2C pins between the nove and the mega.
I am planning on doing a similar board for the graphics screen but it will be a couple of months.
.. works fine BUT
If you already have the tutorial working then you're pretty close to having your own KS0108 I2C interface. Add the I2C library and some logic to respond to commands (draw text, draw graphics, clear screen and possibly a few more) - and that's about it.
Rather than tying up your Arduino, you could buy one of the simpler clones (e.g. RBBB) and use this as a permament graphics display controller and free up your Arduino IO's for other tasks.