GLCD output issues with UNO, SD, RTC and serial output

Hi,

I have made a data logger for fuel consumption and fuel flow and I have it logged to SD card with RTC time stamp and also the results are sent via serial connection to PC. Now I am trying to add a KS0108 128x64 display, so I don't have to have a PC connected to see data in real time. I have problems getting the vaules printed to the screen when I program in the data logger sketch, but I can print to it fine in a fresh clean sketch like this:

// include the library header
#include <glcd.h>
// include the Fonts
#include <fonts/allFonts.h>
void setup() {
  // put your setup code here, to run once:
// Initialize the GLCD 
  GLCD.Init();
   // Select the font for the default text area
  GLCD.SelectFont(System5x7);
  GLCD.SetFontColor( WHITE);
  GLCD.SetTextMode(SCROLL_UP);
  GLCD.SetDisplayMode(NON_INVERTED);
  
  //text areas
  /* gText S1 = gText(0, 0, 17, 6); //supply 1 area
  gText R1 = gText(0, 8, 17, 15) ; //return 1 area
  gText BR1 = gText(0, 16, 17, 27); //BurnRate1 area
  gText TB1 = gText(0, 23, 17, 31); //Total Burn area
  gText S2 = gText(0, 32, 17, 39); //supply 2 area 
  gText R2 = gText(0, 40, 17, 47); //return 2 area 2
  gText BR2 = gText(0, 48, 17, 55); //BurnRate1 area 2
  gText TB2 = gText(0, 56, 17, 63); //Total Burn area 2
  gText valS1 = gText(18, 0, 49, 6);
  gText valR1 = gText(18, 8, 49, 15);
  gText valBR1 = gText(18, 16, 49, 23);
  gText valTV1 = gText(18, 23, 49, 31);
  gText valS2 = gText(18, 32, 49, 39);
  gText valR2 = gText(18, 40, 49, 47);
  gText valBR2 = gText(18, 56, 49, 55);
  gText valTV2 = gText(18, 63, 49, 63);
  */
  // Print definitions
GLCD.println("S1:");
  
  GLCD.println("R1:");
  
}

void loop() {
  // put your main code here, to run repeatedly: 
  GLCD.ClearArea();
  GLCD.println("Hello");
  GLCD.println("This works.");
  delay(1000);

As you can see I tried creating text fields, but I haven't gotten that working yet. The data logger sketch compiles fine, but only prints gibberish to the GLCD... I thought it might be an issue with pin addressing, but I haven't found any conflicts (yet)...

Attached is the sketch for the datalogger.

Fuel_Flow_Logging_to_SD_Card_4_channels_2_GLCD.ino (11.3 KB)

Now I am trying to add a KS0108 128x64 display

Connected to what pins?

On which Arduino?

Hi PaulS,

It is connected as the documentation in the GLCD library said, panel B. With an Adafruit datalogger in between.

The board is an UNO. I think it might be the analog pins that conflict with the datalogger.

The strange ting is that I can only get the GLCD working on 1 UNO board, out of 2 UNO's, 1 leonardo and 1 funduino MEGA 2560... This is a mystery to me. And this is without the SD shield, just the GLCD.

See GLCD documentation file for connections, panel B.

GLCD_Documentation.pdf (490 KB)

Hello again,

I managed to get the GLCD working on the MEGA. The issue was a different pin assignment for the MEGA. However, not all is good.

RTC is not working, I have changed the chipSelect to pin 53 as described in the examples.

And I still have problems writing to the LCD. I will figure it out, but GOD, this is a pain in the behind :))

Has anyone got good experience with serial GLCD's? Are they easier to program? Or maybe the color screens I see on youtube...

RTC is not working, I have changed the chipSelect to pin 53 as described in the examples.

In what examples? Most RTCs are I2C devices, not SPI devices.