I have recently upgraded from Uno to Due. I tried to interface the KS0108 lcd screen with my Due board. The Arduino Playground has a new Ver 3 Library for Glcd, which i downloaded and followed the instructions given to the letter. But when i try to compile the KS0108 example it gives the following error:
In file included from ks0108example.pde:12:
C:\Users\OverLord\Documents\Arduino\libraries\glcd/glcd.h:38: fatal error: avr/pgmspace.h: No such file or directory
compilation terminated.
And now I am stuck. How do I go about this problem? I request you guys to help me rectify this problem.
Any and all help is much appreciated. Thanks in advance.
I do not know the state of the GLCDv3 lib with respect to KS0108, but u8glib (Google Code Archive - Long-term storage for Google Code Project Hosting.) also supports the KS0108 display. Additionally you will need a level translation from 3.3V (Due) to 5V (KS0108). Unidirectional translation is fine for u8glib. However, this setup has never been tested before with u8glib. I would be interessted to see wether it works.
dhirkumar15:
I have recently upgraded from Uno to Due. I tried to interface the KS0108 lcd screen with my Due board.
Doh!
I just noticed this.
Currently the glcd library does not work on Due.
That is the reason for the error. Due does not use a Harvard Architecture and doesn't use/need the
complex programs pace stuff.
olikraus:
I do not know the state of the GLCDv3 lib with respect to KS0108, but u8glib (Google Code Archive - Long-term storage for Google Code Project Hosting.) also supports the KS0108 display. Additionally you will need a level translation from 3.3V (Due) to 5V (KS0108). Unidirectional translation is fine for u8glib. However, this setup has never been tested before with u8glib. I would be interessted to see wether it works.
Oliver
Oliver,
I've been working on a major update for the glcd library which includes support for non AVR parts.
I've done lots of testing on Teensy 3.
In my testing with Teensy v3, (which electrically is very similar i/o to DUE)
I've successfully used 10k resistors in series on all the pin connections.
This is much cheaper and simpler than using a full bi-directional level shifter like the one adafruit sells:
I guess u8g doesn't do any reads? So it only needs unidirectional?
What about BUSY polling on the ks0108?
The trickiest part for me is/was the nanosecond delays and updating the library
to have i/o and delay fall back modes for non AVR parts
or AVRs that don't yet have full raw port i/o support or low resolution delay routines.
Ironically, for simple stuff, the AVR is faster than Teensy 3 even though the Teensy 3 is 32 bit
and running 3 times faster. This is because of the way the i/o works on Teensy. You can only do single
pin i/o even if you do raw port i/o, whereas on the AVR, it can set all 8 data pins with a single raw port
access in a single clock.
But for complex stuff that involves higher math functions for things like ellipses, triangle fills, or trig
functions, the Teensy is much faster.
U8glib does not read the busy flag. It just waits for the maximum time. U8glib could be optimized for this, but i was always thinking, that there is a much faster lib out there.
U8glib does not provide perfect support for the DUE. HW SPI is still not working. And SW SPI is not much faster than on the UNO.