Go Down

Topic: Beta version of GLCD library version 3 (Read 31759 times) previous topic - next topic


Too bad the T6963C isn't one of them...


Jul 29, 2010, 03:10 pm Last Edit: Jul 29, 2010, 03:10 pm by mem Reason: 1
As I was trying to say in an earlier post, it's difficult to add and support LCD panels we don't have on hand in our labs.  


Thanks for your work! I've just ordered one GLCD 128*64. Waiting right now. Hope to get it to work since it's KS0108 compatible. Is there any way to reduce the data line to 4 bits so I can still sense a few buttons and digital I/O? The GLCD will take 13 pins out of 18 pins (I need to keep serial). There's only 5 pins left. I have 3 buttons and 2 inputs and that leaves no room to expand. Is there any way to sacrifice speed and support shift register for the data bits? Thanks.
Serial LCD keypad panel,phi_prompt user interface library,SDI-12 USB Adapter


The ks0108 does not have a four bit mode so all eight data lines are required. The data is bidirectional (bot read and write).  Bidirectional shift register solutions are complicated and it may be easier using a low cost bare bones instead to drive the GLCD that talks to Arduino through somthing like I2C.

Another solution is to use an Arduino compatible board with more pins.  The Mega has 54 pins, and thats overkill there are boards with  a smaller price and form factor -  have a look the Sanguino (32 pins),  Teensy (25 IO pins)  and the Teensy++ (46 IO pins).  

Sanguino: http://sanguino.cc/
Teensy: http://www.pjrc.com/teensy/teensyduino.html

All those boards work well with the GLCD library


Thanks mem. It seems atmega644pa with sanguino bootloader will give me a beefed up version of atmega328. I'll fiddle with this idea once I get a sanguino kit.
Serial LCD keypad panel,phi_prompt user interface library,SDI-12 USB Adapter


Just my 2 cents, but at this point in time, I don't see the value of the Sanguino now that the Teensy++ is available and PJRC has a teensy plugin for the arduino IDE.

Teensyduino s/w includes re-written digital i/o routines
(digitalWrite(), PinMode(), etc...) that are MUCH
faster than the standard libraries provided by Arduino.

Teensy++ board hardware has
Double the flash, Double the RAM, double the EEPROM, same analog inputs, more PWM pins, Hardware USB support builtin so you can emulate lots of USB devices with simple s/w (PJRC provides lots of sample code), does not need a USB to serial cable (like an FTDI cable) as USB support is built into the AT90USB1286.

It is also quite a bit cheaper than a Sanguino and comes fully assembled and tested.

The Sanguino is usually a kit which can be a plus for some people as it is kind of fun to solder up a board and you can also replace the processor as they are through hole vs SMT.

I  really like the hardware USB support especially for virtual serial communication as not only can the virtual serial interface run much faster  but also has built in flow control management because it sits on top of USB.

Just my crazy views & opinions....

--- bill


don't see the value of the Sanguino?

Actually, the Sanguino kit is the same price as the Teensy++ and would be a better choice for applications that need two hardware TTL serial ports (without USB).  It's a particularly good choice for hardware hackers - I have a project using the Sanguino circuit (an ATmega644P and a crystal) that was put together for $10 in parts.

That said, the Teensy++ is a good choice for the typical Arduino usage that uses USB connection to a computer.


Aug 01, 2010, 08:19 pm Last Edit: Aug 01, 2010, 08:20 pm by madepablo Reason: 1
FYI,  it is working perfect into my system:

Arduino Duemilanove
Arduino IDE 17
Windows XP

GLCD model: AGM1264B

Thanks for this new library with a lot of tools... it promises a lot of fun!

Just only one question, is there a way to use shift registers (eg., 74HC595) with GLCD in order to reduce the number of pins used? Thanks!



Aug 01, 2010, 08:29 pm Last Edit: Aug 01, 2010, 08:30 pm by mem Reason: 1
The library needs to both write and read to the LCD and implementing a read/write shift register a little tricky. For a similar component cost you could probably use a second ATmega168 to run the library code that communicates with a master Arduino  via something like I2C. Someone else asked about that capability and if it's a popular request then we can put I2C on the wish list for a future release.


Thanks, it could be great.

But in any case, right now, the library is great and a fantastic work.

Well done and thanks so much!


Code: [Select]

#include <glcd.h>
#include "fonts/Arial14.h"         // proportional font
#include "fonts/SystemFont5x7.h"   // system font
#include <Wire.h> // initialize wire
#include "nunchuck_funcs.h"

int loop_cnt=0;

byte accx;

void setup()
 Serial.print("Wii nunchuck ready");
GLCD.DrawHLine(0, 32, 127); // horizontal line

void loop()
  if( loop_cnt > 100 ) {
       loop_cnt = 0;


       accx  = nunchuck_accelx();


Ive been playing around with code for a few hours and got the nunchuck value to print from 73 to 184 or 185 the same in the serial.
At around 130 the value of accx is level.
My question is which im completely stumbled on is  read a  value from accx and depending on which state it is in draw a line (like a tilt plain) from level to be at 0, 32. if tilted to the right itd draw a line from 0,0 to 127,63. if tilted from left itd draw a line from 127,0 to 0,63.


OK, Thanks for answers to my Sanguino question. Is there any place where you can cheaply buy (<US$10) an ATMEGA644 with Sanguino bootloader. I will only need the chip. It seems that this chip needs same support as ATMEGA328P to run duino environment (5V DC, 16MHz crystal, caps etc.) I will need to get serial cable/FTDI chip board for other stuff anyway.
Serial LCD keypad panel,phi_prompt user interface library,SDI-12 USB Adapter


@chris, there is an example for drawing angled lines in the FPS example sketch. If you want to draw lines at a specified angle there is an example in the clockface sketch supplied in the download, although that code is highly optimized (it uses a sin table instead of floating point) and is a little obscure.

If RAM or performance are not a concern then you can use trionometry to calculate the coordinates. If you need it, you can find a trig primer here: http://processing.org/learning/trig/


@liudr, Digikey sell the bare chip for $7: http://parts.digikey.co.uk/1/1/822588-ic-mcu-avr-64k-flash-40-dip-atmega644p-20pu.html

Wulfden sell the chip with bootloader, socket, crystal, caps and reset switch for $11

But if you need USB then the teensy may be the better choice.


Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131