Go Down

Topic: 128x64 glcd trouble.... (newbie) (Read 2 times) previous topic - next topic

Dan9287

Apr 27, 2011, 11:06 pm Last Edit: Apr 27, 2011, 11:14 pm by Dan9287 Reason: 1
I am currently using an ATMEGA1280 with a TM12864L-2 (128x64 glcd) which from everything i have been reading is a clone of the ever popular KS0108. I have checked my wiring against pin-out tables a thousand times over, and tried a bunch of pre-written sketches for the KS0108 but no dice. Whenever i run the "bigdemo" sketch i keep getting errors when i try to validate the sketch such as, and not limited to, " 'TM12864L-2'was not declared in this scope " in reference to the third line in....

PX_HOUR = PX_MINUTE = PX_SECOND = x_centre ;
PY_HOUR = PY_MINUTE = PY_SECOND = y_centre ;
TM12864L-2_MEGA.DrawCircle (x,y  r+3,BLACK) ;

i have been reading and reading and reading trying to figure out what is wrong with the code. When i got the kit the lcd was hooked up and displaying the big demo sketch. Unfortunately, not knowing what i was doing, i unplugged all the wires, hooked up a single led and started playing with the "blink" sketch without saving the sketch that was pre-loaded and running the lcd. So if anyone has any insight as to what i need to do to get something on this lcd other than a screen full of solid pixels, PLEASE help me. : )

~ Dan9287
...but they are ALL blue wires!!!!!

Dan9287

...but they are ALL blue wires!!!!!

bperrybap

A digital camera can be your best friend.  :D
I often use a digital camera to take photos of how things are assembled before I take
them apart so I can refer back to it.
(might not work too well if all the wires were the same color though..)

First question I have, is where did you get the glcd library software?
Did it come with the glcd module?

The lines you show are very similar to 3 lines that are in the glcd v3 library
in the file glcd/examples/GLCD_BigDemo/AnalogClock.cpp

However, the 3rd line in the glcd v3 library is
GLCD.DrawCircle (x,y  r+3,BLACK) ;

Did you by chance accidentally modify this line or did the glcd module come
with its own software?

And what pin-out tables were you using or did you try?
Because wiring up the glcd incorrectly can damage the glcd.

Are you absolutely sure you have a TM12864L-2 ?
Is it labeled on the back of the glcd?
I can't help much until I know exactly what glcd module you have.
If it is that module or another ks0108 module,  I can help you get it up and working
with the latest glcd v3 library software.

But in the mean time, don't run or play with the arduino board with the glcd attached/plugged-in
because incorrect wiring can fry the glcd.

And if possible, tell me how you hooked everything up,
all 20 pins including how you hooked up the 3 wires on the contrast pot and
if/how you hooked up the current limiting resistor for the backlight.


There was some discussion about this same or similar glcd a bit earlier:
http://arduino.cc/forum/index.php?topic=54881.0

The OP never came back in that thread, so it is unknown if he ever got his display working.

The latest glcd v3 software can be found here:
http://code.google.com/p/glcd-arduino/downloads/list

Best thing is just report back here, and I'll be happy to help you get the wiring
straightened out.


--- bill



andysirio11

I bought an ATMEGA1280 with a TM12864L-2 (128x64 glcd)...glcd example work, but i can't write anything...I'm new please help me...I would like to use it for acquarium and i need to see temperature, ph....
This is my program to check temperature and I would like to see temperature on my glcd

#include <OneWire.h>

// DS18S20 Temperature chip i/o
OneWire ds(10);  // on pin 10

void setup(void) {
  // initialize inputs/outputs
  // start serial port
  Serial.begin(9600);
}

int HighByte, LowByte, TReading, SignBit, Tc_100, Whole, Fract;

void loop(void) {
  byte i;
  byte present = 0;
  byte data[12];
  byte addr[8];

  if ( !ds.search(addr)) {
//      Serial.print("No more addresses.\n");
      ds.reset_search();
      return;
  }

//  Serial.print("R=");
//  for( i = 0; i < 8; i++) {
//    Serial.print(addr, HEX);
//    Serial.print(" ");
//  }

//  if ( OneWire::crc8( addr, 7) != addr[7]) {
//      Serial.print("CRC is not valid!\n");
//      return;
//  }

//  if ( addr[0] == 0x10) {
//      Serial.print("Device is a DS18S20 family device.\n");
//  }
//  else if ( addr[0] == 0x28) {
//      Serial.print("Device is a DS18B20 family device.\n");
//  }
//  else {
//      Serial.print("Device family is not recognized: 0x");
//      Serial.println(addr[0],HEX);
//      return;
//  }

  ds.reset();
  ds.select(addr);
  ds.write(0x44,1);         // start conversion, with parasite power on at the end

  delay(1000);     // maybe 750ms is enough, maybe not
  // we might do a ds.depower() here, but the reset will take care of it.

  present = ds.reset();
  ds.select(addr);   
  ds.write(0xBE);         // Read Scratchpad

//  Serial.print("P=");
//  Serial.print(present,HEX);
//  Serial.print(" ");
  for ( i = 0; i < 9; i++) {           // we need 9 bytes
    data = ds.read();
//    Serial.print(data, HEX);
//    Serial.print(" ");
  }
//  Serial.print(" CRC=");
//  Serial.print( OneWire::crc8( data, 8), HEX);
//  Serial.println();
 
  LowByte = data[0];
  HighByte = data[1];
  TReading = (HighByte << 8) + LowByte;
  SignBit = TReading & 0x8000;  // test most sig bit
  if (SignBit) // negative
  {
    TReading = (TReading ^ 0xffff) + 1; // 2's comp
  }
  Tc_100 = (6 * TReading) + TReading / 4;    // multiply by (100 * 0.0625) or 6.25

  Whole = Tc_100 / 100;  // separate off the whole and fractional portions
  Fract = Tc_100 % 100;


  if (SignBit) // If its negative
  {
     Serial.print("-");
  }
  Serial.print(Whole);
  Serial.print(".");
  if (Fract < 10)
  {
     Serial.print("0");
  }
  Serial.print(Fract);

  Serial.print("\n");
}

Please help me...... :(

bperrybap

There is quite a bit of information about using the glcd library in the included documentation
down in the glcd/doc directory of the library.
Click on glcd/doc/GLCDref.htm to bring it up in your browser.
While a bit daunting at first, it is actually pretty easy to output simple text to the display.
Many of the text api calls are very similar to the liquidcrystal API functions.

Attached is a very simple hello world sketch that I'll include in the next version of the API
to show a minimal example of how to print something on the display.

BTW, it would be better to start your own thread for asking your questions
since your questions seem to be a bit different than the original topic.

--- bill

Go Up