Simple graphic Menu system

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi everyone
I am using "The Polish Code" for the KS0108 LCD driver. I am using this LCD:
http://www.rapidonline.com/Elect...

and the mega2560.

I have used Oliver Kraus' graphics library and menu library with it, so I know the hardware is connected correctly, however his library refreshes very very slowly and I think its a bit over complicated for what Im after.

I was going to base a graphics menu system on Dean Camera's micromenu, but first I need to get this graphics library working.

I have made all the changes to the defines:

#define KS0108_DATA_PORT	PORTC
#define KS0108_DATA_DIR		DDRC
#define KS0108_DATA_PIN		PINC

#define KS0108_CTRL_PORT	PORTG
#define KS0108_CTRL_DIR		DDRG

#define KS0108_RS			(1 << 5)
#define KS0108_RW			(1 << 1)
#define KS0108_EN			(1 << 2)

#define KS0108_CS1			(1 << 3)
#define KS0108_CS2			(1 << 4)
#define KS0108_CS3			

To match my connections (although I dont have CS3)
Then I just grabbed the example main() from the website and put it at the bottom of the setup file for the AVR (KS0108-AVR):

int main(void)
{
	GLCD_InitalizePorts();
GLCD_ClearScreen();

GLCD_GoTo(0,0);
GLCD_WriteString("+-------------------+");
GLCD_GoTo(0,1);
GLCD_WriteString("|     Universal     |");
GLCD_GoTo(0,2);
GLCD_WriteString("|   KS0108 library  |");
GLCD_GoTo(0,3);
GLCD_WriteString("|                   |");
GLCD_GoTo(0,4);
GLCD_WriteString("|  en.radzio.dxp.pl |");
GLCD_GoTo(0,5);
GLCD_WriteString("|  STM32 Cortex-M3  |");
GLCD_GoTo(0,6);
GLCD_WriteString("|  microcontrollers |");
GLCD_GoTo(0,7);
GLCD_WriteString("+-------------------+");

for( ; ; );
return 0;
}

However I get absolutely nothing on the screen. I suspect that someone would ask to see all my code, so I have attached it.

I have also attached an image to show connections - sorry for low quality

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If it's known working library code with no changes and then it doesn't work then I'm afraid the only person who can really debug what's wrong is you, sat behind the specific hardware you are trying to debug. A scope or logic analyser may prove useful to monitor the activity to the KS0108 and see if it's doing what is expected.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Cliff,
I grabbed this example because I notice in other posts, you have directed people towards it. Have you tried it?

Based on my changes I have made, does it look to you like I have done the correct thing?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

I grabbed this example because I notice in other posts, you have directed people towards it. Have you tried it?

Nope. I've used the Fabian Maximillian Thiele code in the past. But we've heard from people here who have used the Polish code and found it to work.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So if you add the Oliver Kraus files to your project, it compiles burns and runs, but its too slow? So you now want to try this other ks0108 package and it compiles and burns, but no graphics. You have a serial port on the board? I make a debug menu with items like 1)initlcd 2)clearlcd 3)filllcd 4)linestest 5)texttest. Once the first 3 show something, you are almost there. Plan B might be to post a link to the Oliver Krause routines that are too slow with a message like "No one on the world can make this ks0108 library fill and clear screens faster than 250ms per screen" then go get a cup of coffee and wait for the selfproclaimed World Experts on ks0108 graphics to start offering speedup suggestions. Some might be surprisingly effective. I looked at the graphics routines in the attached zip and I see that the SetPixel function has a color paramater. So to draw a line, it redundantly passes the color overandoverandoverandover. I can speed up the pixel write speed in this package by 33% by visual inspection. QED

Imagecraft compiler user