I finally got around to playing with the above combination and found at first it didn't work. I had a look through the GLCD module and found that INVERT_CS seems to be the wrong way around (in my mind) and GLCD_RST was not in the option section. After setting these it all worked as it should.
One thing I did find which I think is a possible bug is the read from the GLCD (in module KS0108.bas).
This toggles enable and then reads the port. It works but I think that is due to pin capacitance and on a more complex board it may fail.
Mike.
Code:
// Unicorn GLCD test
Device = 18F4550
Clock = 48
Config
PLLDIV = 5,
CPUDIV = OSC1_PLL2,
USBDIV = 2,
FOSC = HSPLL_HS,
VREGEN = OFF
#option GLCD_DATA = PORTD // data port
#option GLCD_RS = PORTE.0 // RS pin
#option GLCD_EN = PORTE.2 // EN pin
#option GLCD_RW = PORTE.1 // RW pin
#option GLCD_CS1 = PORTB.4 // chip select
#option GLCD_CS2 = PORTC.0 // chip select
#option GLCD_ASPECT_RATIO = 75 // aspect ratio, smaller number will squeeze y for GLCD circles and box
#option GLCD_INIT_DELAY = 100 // initialisation delay (ms)
#option GLCD_INVERT_CS = true // invert CS lines...
#option GLCD_RST = PORTA.4 // reset line
Include "GLCD.bas"
Include "Arial.bas"
// program start...
ADCON1 = $0F //All digital
CMCON = $07 //No comparators
Cls
High (PORTB.3) //turn on back light
GLCD.SetFont(Arial)
WriteAt(10,10,"Hello World")
GLCD.SetFont(ArialBold)
WriteAt(10,20,"Hello World")
line(10,30,70,30)
While(true)
Wend
End
One thing I did find which I think is a possible bug is the read from the GLCD (in module KS0108.bas).
Code:
Function GetData() As Byte
WaitForIdle // block until not busy
TRISData = $FF // set data bus to input
GLCDData // access display RAM data
GLCDRead // read mode
StrobeEN // latch data
Result = DATA // get the data
End Function
Mike.