#define ON 1
#define OFF 0
#define XVAL 16 // 16 X 16 or 256 for there is 8 word values for the upper and lower
#define YVAL 32

// PSB is tied to Vcc for this driver because this driver uses Parallel
// operation.
// data is sent using port B so change output_b() to other ports you
//want to use. Dont for get to change the Busy pin @ lcd_check_busy

#define GLCD_WIDTH 128

//////////////////////////////////////////////////////////////////////////////////
//The following are the functions included in this driver file
// glcd_readbyte();
// glcd_instruction( instruction );
// glcd_data( data ); - data can be an array of characters!
// glcd_check_busy();
// glcd_update(); -must be called always after writing a pixel or using functions
// from GRAPHICS.C .. Only applicaticable in Graphing mode
// glcd_fillscreen( ON or OFF);
// glcd_init_graph(); initialize for graphing mode
// glcd_init_basic(); initilize for accessing the stored Characters
// you can use glcd_data() for writing text
// glcd_pixel(x coordinate, y coordinate, ON or OFF);
// -WORKS WITH GRAPHIC.C from CCS Drivers
// glcd_plot_image(width,height,X coor, Y coor, inverse);
// -plots the image[] array. Declare it first before this driver.
// or modify this driver
//
//////////////////////////////////////////////////////////////////////////////////

You are doing a lot of things out of order in your main. For example, you include his driver which uses delay() calls, but you don't specify your #use delay() till after. Similar issues with the fuses.

Always, ALWAYS, put your FUSES and device specific preprocessor directives before any code and includes except for the include for your specific chip, which must come first.

/************************************************************************
* LCD graphics driver for Digole 12864w with ST7920 driver using *
* CCS software. May work with other ST7920 driven LCD. It has *
* the following Pin assignments *
* *

Thanks very much, it's working great. This is a big help for me. thanks again.

kaem1189

Joined: 27 Dec 2011Posts: 12

Posted: Thu Jan 03, 2013 1:47 am

GREAT!!! welcome!

kristian

Joined: 16 Mar 2013Posts: 3

Posted: Sat Mar 16, 2013 5:35 pm

HI.
I'm using MikroC software to write codes. Can you explain me what i have to write in order to make MikroC know where I have linked DB0 -DB7 pins, Register Select pin, etc...
For example:
sbit RS at RB0_bit
sbit D0 at RB1_bit

Thank you.

jeremiah

Joined: 20 Jul 2010Posts: 973

Posted: Sat Mar 16, 2013 6:16 pm

This is not a MicroC forum. Won't find much help with it here.

kristian

Joined: 16 Mar 2013Posts: 3

Posted: Sun Mar 17, 2013 4:48 am

jeremiah wrote:

This is not a MicroC forum. Won't find much help with it here.

So i can't use this library with MikroC?

jeremiah

Joined: 20 Jul 2010Posts: 973

Posted: Sun Mar 17, 2013 6:37 am

You'll have to port it to MicroC, but this forum doesn't cover MicroC. You'll need to ask the MicroC forums for info on how to port it as most of us don't use MicroC

kristian

Joined: 16 Mar 2013Posts: 3

Posted: Sun Mar 17, 2013 6:55 am

Ok, thank you

kaem1189

Joined: 27 Dec 2011Posts: 12

Posted: Fri May 24, 2013 8:19 pm

Im glad i could help everyone.

pmaggi

Joined: 05 Jun 2013Posts: 10

Posted: Wed Jun 05, 2013 8:30 am

Hi kaem1189

I am trying to implement a serial driver for a glcd (st7920 controller) using as an example the one that you posted here.
Basic mode seems to work ok, I can show text without problem.
But when trying to use the graphic mode I have a strange behaviour... sometimes it works ok but other times there is a kind of "noise" in the screen, I mean, some random pixels are on or strange patterns appears.
First I though that it was a timing problem but after changing them (increasing and decreasing them) the problem persist.
Do you ever experienced this kind of behaviour?

I'm stuck with this because after analyzing several times the routines, they seems to be ok in particular when sometimes it works fine...

Are there any requirements about filtering the power supply to the GLCD? perhaps what it is happening is just electrical noise...

Any idea?

pmaggi

Joined: 05 Jun 2013Posts: 10

Posted: Tue Jun 11, 2013 8:09 am

In the display there is a pin marked as NC, and if I touch it, a lot of "noise" appears on the screen. I tied it to ground by a 22k resistor and all the problems disappeared...
Very strange...