Has anyone succeeded in running a GLCD (ks0108) on the newest Teensy++ (with ATMEL 90USB1286)? A tried to adopt the code by mem (http://www.arduino.cc/playground/Code/GLCDks0108) to the new Processor but even with his help I couldn’t get it running.
What ports/pins did you connect and how did you adapt ks0108.h and Arduino.h (or a similar config-file)?
Thank you very much,
I am working on the next release of the library that will support the Teensy. I hope to have this available for testing before the end of the year.
I'll be really interested what the problem was, thank you for letting me know, if you get there!
In ks0108.h, add this:
#elif defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__)
Then add a new file ks0108_Teensy++.h, with this:
ks0108_Arduino.h - Arduino library support for ks0108 and compatable graphic LCDs
Copyright (c)2008 Michael Margolis All right reserved
This is the configuration file for mapping Teensy++ pins to the ks0108 Graphics LCD library
#define CSEL1 18 // CS1 Bit
#define CSEL2 19 // CS2 Bit
#define R_W 8 // R/W Bit
#define D_I 9 // D/I Bit
#define EN 7 // EN Bit
#define LCD_CMD_PORT PORTE // pins 8, 9, 18, 19
// these macros map pins to ports using the defines above
// the following should not be changed unless you really know what your doing
#define LCD_DATA_LOW_NBL C // port for low nibble: pins 10-13
#define LCD_DATA_HIGH_NBL C // port for high nibble: pins 14-17
// Teensyduino always optimizes digitialWrite when used with const inputs
#define fastWriteHigh(_pin) (digitalWrite((_pin), HIGH))
#define fastWriteLow(_pin) (digitalWrite((_pin), LOW))
Connect the 8 data lines to pins 10 to 17, and the 5 control signals to pins 7, 8, 9, 18 and 19, as documented in the comments.
It works great.
Soon I'll take some photos and draw some wiring diagrams and get them up on the website.