If you take this new glcd.h file, please also take the device specific device drivers. They are called GLCD_*.h. You will now find 5 device drivers.
The GCB command set across the drivers is the same as before. Where differences do exist (at the hardware level) you will find the device specific commands in the device specific driver.
Let me know if you have any issues. Remember, to download all the GLCD* files! If you do not you download all the files will get 'file not found' during compilation but all should work ok unless you are trying to use one of the missing files.
:-)
Supports:
KS0108 - full graphic support
ST7920 - full graphic support and LCD mode
ST7735 - full graphic color support
PCD8544 - two modes: Full graphic support (1025 bytes RAM required) or Text&BMP support for less than 768 RAM bytes PICs.
Last edit: Anobium 2014-11-09
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Revised GLCD.H now posted to SVN. I have just published a revised GLCD.H.
This GLCD.H now has seperate hardware files for each of the specific GLCD devices.
KS0108 - full graphic support
ST7920 - full graphic support and LCD mode
ST7735 - full graphic color support
PCD8544 - two modes: Full graphic support (1025 bytes RAM required) or Text&BMP support for less than 768 RAM bytes PICs.
The new GLCD.H auto loads the hardware specific module when you specific the type. The choices are
#define GLCD_TYPE GLCD_TYPE_KS0108 This is the Default value, not required, or
#define GLCD_TYPE GLCD_TYPE_ST7920, or
#define GLCD_TYPE GLCD_TYPE_ST7735, or
#define GLCD_TYPE GLCD_TYPE_PCD8544
The revised GLCD.H REQUIRES a new version of the GCB compiler. Please let us know via and will can provide. These files will be in the next release of GCB/GCGB, so, this is until the next release.
The revised GLCD.H also shows:
1) How you can selectively load configuration files based upon a specific criteria.
2) How you can selectively redirect methods (subs and functions) based upon a specific criteria.
3) How you can use GCB to simplify developments tasks. I wish I knew this a year ago!
Thanks go to Hugh for updating the compiler to aid this task, his guidance and his testing. We have tested extensively on uChip and AVR.
That is nice. This should work for the KS0108 devices. I would have to test all the others GLCD devices and the supporting methods (not all methods use Pset to improve performance).
But, added to the GCB good idea list!!
PSet has been replaced by redirected methods in the next release. This is to support multiple GLCDs from one command set. So, in the next release you would have to revise PSet_KS0108. But, I would recommend using redirection to avoid adapting the baseline code.
To redirect simply add the following to your main program leaving the baseline code as is.
#define PSet_KS0108 myPSet_KS0108
sub myPSet_KS0108 (In GLCDX, In GLCDY, In GLCDColour As Word)
if GLCDDirection=1 then
GLCDX=127-GLCDX
GLCDY=63-GLCDY
end if
... code taken from baseline PSet_KS0108 method.
end sub
Then, you would use the #define GLCDDirection 1 as you are to invert the display.
Anobium
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
A revised GLCD.H see http://sourceforge.net/p/gcbasic/code/HEAD/tree/GCBASIC/trunk/include/glcd.h
If you take this new glcd.h file, please also take the device specific device drivers. They are called GLCD_*.h. You will now find 5 device drivers.
The GCB command set across the drivers is the same as before. Where differences do exist (at the hardware level) you will find the device specific commands in the device specific driver.
Let me know if you have any issues. Remember, to download all the GLCD* files! If you do not you download all the files will get 'file not found' during compilation but all should work ok unless you are trying to use one of the missing files.
:-)
Supports:
KS0108 - full graphic support
ST7920 - full graphic support and LCD mode
ST7735 - full graphic color support
PCD8544 - two modes: Full graphic support (1025 bytes RAM required) or Text&BMP support for less than 768 RAM bytes PICs.
Last edit: Anobium 2014-11-09
Revised GLCD.H now posted to SVN. I have just published a revised GLCD.H.
This GLCD.H now has seperate hardware files for each of the specific GLCD devices.
KS0108 - full graphic support
ST7920 - full graphic support and LCD mode
ST7735 - full graphic color support
PCD8544 - two modes: Full graphic support (1025 bytes RAM required) or Text&BMP support for less than 768 RAM bytes PICs.
The new GLCD.H auto loads the hardware specific module when you specific the type. The choices are
#define GLCD_TYPE GLCD_TYPE_KS0108 This is the Default value, not required, or
#define GLCD_TYPE GLCD_TYPE_ST7920, or
#define GLCD_TYPE GLCD_TYPE_ST7735, or
#define GLCD_TYPE GLCD_TYPE_PCD8544
The revised GLCD.H REQUIRES a new version of the GCB compiler. Please let us know via and will can provide. These files will be in the next release of GCB/GCGB, so, this is until the next release.
The revised GLCD.H also shows:
1) How you can selectively load configuration files based upon a specific criteria.
2) How you can selectively redirect methods (subs and functions) based upon a specific criteria.
3) How you can use GCB to simplify developments tasks. I wish I knew this a year ago!
Thanks go to Hugh for updating the compiler to aid this task, his guidance and his testing. We have tested extensively on uChip and AVR.
See here for four demonstrations source files, https://sourceforge.net/p/gcbasic/code/HEAD/tree/GCBASIC/trunk/Demos/GLCD%20Demos/.
I will publish a YouTube tutorial later.
Have fun.
GLCD KS0108.H: A new tutorial and introduction to the new GLCD.H code.
See https://www.youtube.com/watch?v=WlHm6X6OPEU&feature=youtu.be
Please press 'thumbs up'... we need 'thumbs up' to get noticed on YouTube. :-)
This days i am working on KS0108 and i realised that the screen can show the characters up-side-down. The only step you should follow is to type:
#define GLCDDirection 1
on the define section of the program and add the following:
if GLCDDirection=1 then
GLCDX=127-GLCDX
GLCDY=63-GLCDY
end if
in the biggining of the
Sub PSet(In GLCDX, In GLCDY, In GLCDState)
Please Anobium try it on your dislpay and make sure to tell me if it works for you
That is nice. This should work for the KS0108 devices. I would have to test all the others GLCD devices and the supporting methods (not all methods use Pset to improve performance).
But, added to the GCB good idea list!!
PSet has been replaced by redirected methods in the next release. This is to support multiple GLCDs from one command set. So, in the next release you would have to revise PSet_KS0108. But, I would recommend using redirection to avoid adapting the baseline code.
To redirect simply add the following to your main program leaving the baseline code as is.
Then, you would use the #define GLCDDirection 1 as you are to invert the display.
Anobium