It is currently 20 Oct 2018 09:24

All times are UTC + 1 hour




Post new topic Reply to topic  [ 28 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: 06 Oct 2009 14:22 
Offline

Joined: 18 Feb 2006 13:17
Posts: 4983
New version, named uGLCD is available :!: - see here
_______________________________________________

Those that used this lib under mP 7 already know it's properties. It's been updated and slightly extended for the incoming mP PRO 3.00 release.

For those that never heard of this library, a short description follows.

It's a rather extensive library, called xGLCD, for PIC18 processors and KS107 based GLCDs (128x64 pixels) containing both textual and graphical routines allowing to draw on both the physical screen and a virtual one, placed in RAM.

Basic properties:
- both text and graphics may be drawn anywhere on the screen,
- 'packed' bitmap format implemented saving ROM space,
- clipping rectangle for most graphical functions,
- routines for copying whole, or part of the screen from GLCD to RAM and back,
- routines for icon drawing (from RAM or ROM), inverting, and horizontal shifting,
- both ME's fonts and variable-width fonts of any size (created, for example with Octal's GLCD Font Creator, http://www.pocketmt.com/) may be used,
- increased speed performance over standard lib, especially visible for higher clock frequencies.


For those that don't want to read further, here's a link to the lib: http://www.cobir.com/xGLCD_PRO.rar

The library consists of two parts - the main, precompiled lib file, xGLCDlib.mcl, and a header file, xGLCDheader.mpas. The latter is more than just a header. It also contains all the low level functions for communication with the GLCD. It's possible, therefore, to modify it, for example to work with GLCD connected by a serial interface, like SPI.

The header file also contains definitions of text, draw and plot styles and properties (xGLCD_Transparency, xGLCD_Var_Width, xGLCD_Add_Column, xGLCD_Aspect_ratio, and xGLCD_Clipped). The latter may be set and read with appropriate routines.

The header file should be placed together with user application (the main lib may be placed in mP Uses\P18 directory and, optionally, included in used processor definition file) and compiled after any change to it - like after redefining the data and control ports and lines. These are defined easily in the following part of header file:

// --> Adjust data and control ports here to fit the hardware:

   atDataP = atPORTD;   // data port assignment
   atCtrlP = atPORTB;   // control lines port assignment

   GD_CS1 = 2;          // GLCD control lines (CtrlP)
   GD_CS2 = 3;
   GD_rs  = 4;
   GD_rw  = 5;
   GD_en  = 6;
   GD_rst = 7;


There are also switches (define directives) optimising the lib for particular application which should be commented/uncommented:

{$Define no_reset}   // no reset (GD_rst) line

{$Define RAMdraw}    // allows drawing on RAM screen

{$Define LTE4MHz}    // oscillator freq <= 4MHz


For those that don't want to bother with manually changing the header file, there is an easier solution provided - a MakroIt Windows program (original idea by JoseLB) that prepares a ready to use header file copied to clipboard or directly saved as xGLCDheader.mpas file.

The Bitmap2Array PC program, included in the package, may be used to convert bitmaps to screens and icons in compressed format (for details, see http://www.mikroe.com/forum/viewtopic.php?t=13979).

An example program, xGlcdDemo, is provided to demonstrate the use of library routines. It was tested with PIC18F4620 processor. There's also library description in pdf format.

Have fun :) .


Last edited by janni on 14 Mar 2012 14:59, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: 18 Oct 2009 11:16 
Offline

Joined: 18 Feb 2006 13:17
Posts: 4983
The MakroIt and Bitmap2Array programs have been updated for use with other compilers (plus minor changes). It's not really necessary to use new versions with mP, but they're available with the whole xGLCD package.


Top
 Profile  
 
 Post subject:
PostPosted: 28 Oct 2009 18:22 
Offline

Joined: 18 Feb 2006 13:17
Posts: 4983
The library has been recompiled to allow the use of ICD. Apparently precompiled libs have to be compiled with ICD Debug option - only then programs that use them may be compiled both in Release and ICD Debug mode.


Top
 Profile  
 
 Post subject:
PostPosted: 05 Nov 2009 16:19 
Offline

Joined: 20 May 2005 18:58
Posts: 376
Location: UK
Hi Janni, I finally got around to porting a project to Pro v.3.20. I've got an issue when using your xGLCD lib, whereby the colour parameter
passed in function calls as text styles constants 'xGLCD_tsErase' 'xGLCD_tsWrite' & 'xGLCD_tsInverse' are not recognised. I assume I can pass the numerical equivalent. Any ideas?
Thanks in advance :wink:


Top
 Profile  
 
 Post subject:
PostPosted: 05 Nov 2009 17:01 
Offline

Joined: 18 Feb 2006 13:17
Posts: 4983
Hi FRM,

There is no reason why this should happen. The example attached to the lib uses these constants without problems. Are you sure you've included xGLCDheader unit in the uses clause (or sources in Project Manager)?

Do you call the text routines from main unit, or another one?


Top
 Profile  
 
 Post subject:
PostPosted: 05 Nov 2009 17:39 
Offline

Joined: 20 May 2005 18:58
Posts: 376
Location: UK
Okay, in my infinite wisdom and avoidance of using the uses clause I forgot to add the header unit to the project manager - doh! :oops:
Thanks for giving my brain a shake up. :wink:


Top
 Profile  
 
 Post subject:
PostPosted: 14 Dec 2009 01:07 
Offline

Joined: 18 Feb 2006 13:17
Posts: 4983
New version of xGLCD lib is available. The only change concerns ISR context saving of FSR registers used in the lib. Compiler doesn't notice if FSR registers are used in Pascal so I've changed all instances of FSR loading to assembly. Now the compiler should notice they're in use in main code and add them to context saving in ISR if other procedures called from there also use them.


Top
 Profile  
 
PostPosted: 04 Jul 2011 17:18 
Offline

Joined: 18 Feb 2006 13:17
Posts: 4983
xGLCD lib compiled with mP PRO v5.00 is available (see first post for the download link).

_________________
Replacement libraries for mP PRO and PIC18 processors, mP PRO tips & trics


Top
 Profile  
 
PostPosted: 05 Jul 2011 00:48 
Offline

Joined: 20 May 2005 18:58
Posts: 376
Location: UK
Many thanks for the quick response & update janni :)
Best wishes,
Frankie


Top
 Profile  
 
PostPosted: 14 Mar 2012 14:53 
Offline

Joined: 18 Feb 2006 13:17
Posts: 4983
Forgotten to write about it :( - new GLCD library, this time called uGLCD is available for some time already. It's a successor of xGLCD, somewhat expanded, with different unit organisation and using sbits (thus shifting the adjustable part to main unit). It's also easily integrated with IDE via Package Manager.

Library part responsible for contact with hardware (GLCD controller) is still separate and as kind of hardware driver may be modified to fit different controllers. There are examples of such 'drivers' for controllers with write-only SPI interface, like uC1701 (small DOG displays) or ST7565R (some COG displays). Displays with sizes different from regular 128x64 pixels (like those with three KS107/8 controllers) may also be used with uGLCD.

uGLCD library optimized for PIC18 processors may be downloaded from this site.

There exists version of the library in pure Pascal that may, in principle, be compiled for any PIC family with enough RAM and ROM, but I haven't had time (or need, so far) to test it with processors more advanced than PIC18s.

_________________
Replacement libraries for mP PRO and PIC18 processors, mP PRO tips & trics


Top
 Profile  
 
PostPosted: 31 Jul 2012 20:59 
Offline

Joined: 18 Feb 2006 13:17
Posts: 4983
New version of uGLCD is available (0.07). An Area procedure has been added and bitmap2array program modified. Now it's possible to have compressed (packed) images of a partial screen area stored in Flash. Thanks to Malcolm_M, there's also new driver for GLCDs with ST7528 controllers (160x100 pixels).

_________________
Replacement libraries for mP PRO and PIC18 processors, mP PRO tips & trics


Top
 Profile  
 
PostPosted: 28 Mar 2013 21:21 
Offline

Joined: 05 May 2008 17:48
Posts: 9
I've installed mP PRO for PIC 6.0.0. Then I try to Install uGLCD .
I download from www,cobir.com and install with Package manager.
Now installed is version _0_006. uGLCDlib.
I need uGLCD_ST7565R for COG display.
Another problem. I need this lib. for mBasic PRO for PIC.
How can I translate??

best Regards
TOM


Top
 Profile  
 
PostPosted: 28 Mar 2013 21:29 
Offline

Joined: 23 Sep 2004 20:07
Posts: 3204
There's a very basic ST7565R driver at Libstock, that contains the Pascal source and should be easily recompiled for PIC18, however, it doesn't have any of the higher level functions. It's just raw graphics.

It would be nice if somehow the vertical byte 128x64 library could be broken into higher level functions and lower lever drivers so that this could be used with hardware other than KS107, but AFAIK, we don't have that.

What I've found is that it's not hard to use the GLCD font generator with the ST7565R driver; you just have to understand how the font generator format works. It's the exact same format between the ST7565R and the KS107.

_________________
If you know what you're doing, you're not learning anything.


Top
 Profile  
 
PostPosted: 29 Mar 2013 03:11 
Offline

Joined: 18 Feb 2006 13:17
Posts: 4983
uncleworf wrote:
I've installed mP PRO for PIC 6.0.0. Then I try to Install uGLCD .
I download from www,cobir.com and install with Package manager.
Now installed is version _0_006. uGLCDlib.
Yes, I've forgotten to update the number in all places :( . Anyway, v 0.06 already had driver for ST7565R with SPI.

Quote:
Another problem. I need this lib. for mBasic PRO for PIC.
How can I translate??
I could probably prepare a package for mB but you'd have to translate the driver. I don't have time to do it but I may help as time allows.

@LGR
Quote:
It would be nice if somehow the vertical byte 128x64 library could be broken into higher level functions and lower lever drivers so that this could be used with hardware other than KS107, but AFAIK, we don't have that.
And all this time I believed that I did that :wink: .

_________________
Replacement libraries for mP PRO and PIC18 processors, mP PRO tips & trics


Top
 Profile  
 
PostPosted: 29 Mar 2013 04:42 
Offline

Joined: 23 Sep 2004 20:07
Posts: 3204
:oops:

Oops. I never bothered installing this, because it was only for PIC18, and I'm using the GLCD on PIC32. This does look good. Maybe some day I'll recompile it for PIC32.

_________________
If you know what you're doing, you're not learning anything.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 28 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: