KS0108 Module
Moderators: David Barker, Jerry Messina
KS0108 Module
Has the official FS0108 module ever been updated to support setting the RST line high?
I have had to use Octals excellent version which support 3 CS lines but also supports the RST option. It may have been updated but as I have been running beta versions of SF I may have missed a library update.
There doesn't seem to be a method of separately downloading the library.
I have had to use Octals excellent version which support 3 CS lines but also supports the RST option. It may have been updated but as I have been running beta versions of SF I may have missed a library update.
There doesn't seem to be a method of separately downloading the library.
JohnB
Which means I don't have the latest libraries - that's the trouble with being a beta tester.
Ahmed - Could you Email me the latest version (minus your mods) so I can keep the system Library up to date.
David - There ought to be a method of updating libraries independently to avoid this situation.
Also I noticed when running on my EasyPIC4 board that CS1 and CS2 are reversed. I.e. what purports to be CS1 actually selects the right hand part of the screen. So the option settings I needed where:
#Option GLCD_CS1 = PORTB.1
#Option GLCD_CS2 = PORTB.0
although the wiring on the board is actually the reverse (unless the CS ordering is supposed to run right to left).
Ahmed - Could you Email me the latest version (minus your mods) so I can keep the system Library up to date.
David - There ought to be a method of updating libraries independently to avoid this situation.
Also I noticed when running on my EasyPIC4 board that CS1 and CS2 are reversed. I.e. what purports to be CS1 actually selects the right hand part of the screen. So the option settings I needed where:
#Option GLCD_CS1 = PORTB.1
#Option GLCD_CS2 = PORTB.0
although the wiring on the board is actually the reverse (unless the CS ordering is supposed to run right to left).
JohnB
I also noticed that on my EasyPic4. Perhaps mikroE official GLCD that they sell with EasyPIC boards has a reveresed pinoutjohngb wrote:
Also I noticed when running on my EasyPIC4 board that CS1 and CS2 are reversed. I.e. what purports to be CS1 actually selects the right hand part of the screen. So the option settings I needed where:
#Option GLCD_CS1 = PORTB.1
#Option GLCD_CS2 = PORTB.0
although the wiring on the board is actually the reverse (unless the CS ordering is supposed to run right to left).
regards
Octal
The EasyPIC3 board shows CS1=PORTB.2 and CS2=PORTB.3 at the GLCD connector onboard. I could not get but half the KS0108 screen to show until I changed to GLCD_INVERT_CS=True and swapped the CS lines.
Has anyone figured if this is a hardware issue with the EasyPIC boards, or is it the type of GLCD? The datasheet for the GLCD for this board can be found here: http://www.xmocular.com/upload_img/2007110150439221.pdf
Thanks to this thread I was able to troubleshoot a non-working GLCD using SF on this board. Works great now with the following settings:
Has anyone figured if this is a hardware issue with the EasyPIC boards, or is it the type of GLCD? The datasheet for the GLCD for this board can be found here: http://www.xmocular.com/upload_img/2007110150439221.pdf
Thanks to this thread I was able to troubleshoot a non-working GLCD using SF on this board. Works great now with the following settings:
Code: Select all
#option GLCD_CS1 = PORTB.3 // chip select
#option GLCD_CS2 = PORTB.2 // chip select
#option GLCD_DATA = PORTD // data port
#option GLCD_RS = PORTB.4 // RS pin
#option GLCD_EN = PORTB.6 // EN pin
#option GLCD_RW = PORTB.5 // RW pin
#option GLCD_RST = PORTB.7 // RST pin
#option GLCD_INVERT_CS = true // invert CS lines...
#option GLCD_MODEL = KS0108 // GLCD driver
Last edited by xor on Sun Nov 16, 2008 11:54 pm, edited 1 time in total.
Just to complete the picture, here are the config settings for the EasyPIC4 board.
Code: Select all
#Option GLCD_SCREEN_WIDTH = 128
#Option GLCD_SCREEN_HEIGHT = 64
#Option GLCD_DATA = PORTD
#Option GLCD_RS = PORTB.2
#Option GLCD_CS1 = PORTB.1
#Option GLCD_CS2 = PORTB.0
#Option GLCD_RW = PORTB.3
#Option GLCD_EN = PORTB.4
#Option GLCD_RST = PORTB.5
#Option GLCD_INIT_DELAY = 100
#option GLCD_INVERT_CS = true
JohnB
I can only speak for the EasyPIC4 board and in that case the mapping shown on the silksreen is accurate (wrt /cs1 and /cs2) which implies that the glcd module has reversed mapping for these pins. However, if you check your datasheet, I don't believe you'll find anything that tells you which half of the screen /cs1 and /cs2 map to. It would be reasonable to assume the pins use a R->L mapping but maybe they mean from the back of the displayxor wrote:Has anyone figured if this is a hardware issue with the EasyPIC boards, or is it the type of GLCD?
This brings up another subject. The fact that meBasic has closed libraries means you would never have realised that the mapping had been changed to cope with the module (I'm assuming you started using the EasyPIC with meBasic as I did). The SFB open libraries were a major consideration to me when I decided to ante-up and fork over my pennies for SFB.
Regards,
Iain
This will be useful information for the WIKI. I'm sure this problem will pop up again in discussions. I'll post this in FAQ... unless someone has objection.
Last edited by xor on Tue Oct 02, 2007 2:49 pm, edited 2 times in total.
- David Barker
- Swordfish Developer
- Posts: 1214
- Joined: Tue Oct 03, 2006 7:01 pm
- Location: Saltburn by the Sea, UK
- Contact:
That sounds like a good idea. EasyPIC users might want to consider creating a module with these #options already set. Then, you just need to include the module in your program (before any other modules). For example,
or you could have a generic module, which configures itself based on a single option. For example,
Code: Select all
device = 18F452
clock = 20
include "EasyPICx.bas"
include "GLCD.bas"
Code: Select all
#option EasyPIC = 4
include "EasyPIC.bas"
include "GLCD.bas"
- David Barker
- Swordfish Developer
- Posts: 1214
- Joined: Tue Oct 03, 2006 7:01 pm
- Location: Saltburn by the Sea, UK
- Contact:
- David Barker
- Swordfish Developer
- Posts: 1214
- Joined: Tue Oct 03, 2006 7:01 pm
- Location: Saltburn by the Sea, UK
- Contact:
I'm not running USB. But after fiddling some more I am now beginning to suspect a problem with the EasyPIC3 programmer because I get a driver error message intermittently with the 18F4550 @48MHz....none @ 8MHz. I moved this PIC over to the EasyPIC4 and get a Vpp Voltage error almost all the time and a failed upload of hex. I may have jumped to the gun to suspect the library.
Here is the code:
Here is the code:
Code: Select all
Device = 18F4550
Clock = 8
//set up config for 8MHz crystal and USB
//Config USBDIV = 2
//Config CPUDIV = OSC1_PLL2
//Config PLLDIV = 2
//Config FOSC = HSPLL_HS
// EasyPIC3 GLCD Settings
#Option GLCD_SCREEN_WIDTH = 128 // screen pixels
#Option GLCD_SCREEN_HEIGHT = 64 // screen pixels
#option GLCD_DATA = PORTD // data port
#option GLCD_CS1 = PORTB.3 // chip select
#option GLCD_CS2 = PORTB.2 // chip select
#option GLCD_RS = PORTB.4 // RS pin
#option GLCD_EN = PORTB.6 // EN pin
#option GLCD_RW = PORTB.5 // RW pin
#option GLCD_RST = PORTB.7 // RST pin
#Option GLCD_INIT_DELAY = 1000 // startup delay
#option GLCD_INVERT_CS = true // invert CS lines...
#option GLCD_MODEL = KS0108 // GLCD driver
{
#Option GLCD_SCREEN_WIDTH = 128
#Option GLCD_SCREEN_HEIGHT = 64
#Option GLCD_DATA = PORTD
#Option GLCD_RS = PORTB.2
#Option GLCD_CS1 = PORTB.1
#Option GLCD_CS2 = PORTB.0
#Option GLCD_RW = PORTB.3
#Option GLCD_EN = PORTB.4
#Option GLCD_RST = PORTB.5
#Option GLCD_INIT_DELAY = 100
#option GLCD_INVERT_CS = true
#option GLCD_MODEL = KS0108
}
Include "GLCD.bas"
Include "FixedFont.bas"
ADCON1 = 15
CMCON = 7
TRISB = 0
TRISD = 0
TRISE = 0
GLCD.Cls
GLCD.SetFont(Fixed)
GLCD.Rectangle(0,0,128,22)
GLCD.Rectangle(1,1,127,21)
GLCD.WriteAt(4,4,"This Is Fixed Font")
GLCD.WriteAt(4,12,"This Is The Nxt Line")