GLCD S1D13700 Is not displaying anything.

General discussion relating to the library modules supplied with the compiler

Moderators: David Barker, Jerry Messina

mgrondstra
Posts: 11
Joined: Mon May 10, 2010 12:02 pm
Location: Netherlands, Enschede

GLCD S1D13700 Is not displaying anything.

Post by mgrondstra » Mon May 10, 2010 12:12 pm

Hello there,

I recently purchased an 320x240 glcd with an S1D13700 controller.

I've been trying for some time now to get it working, but with no succes.

I've tried some of the examples from this forum but stil do not get anything on screen.

Some help would be apreciated.

Datasheet GLCD:
http://www.egochina.net.cn/e-shop/ebay/ ... JHD639.pdf

I used the CN1 pin to connect it to my PIC18F4550 on ports B and D

I'm sure i connected everything right. Altough the contrast one is a bit difficult to understand. As now i have connected VO to an 10k and an 10K variable resistor wich is connected to the lcd supllied VEE.

The program used is:

Code: Select all

Device = 18F4550 
Clock = 48 

Config 
   PLLDIV = 5, 
   CPUDIV = OSC1_PLL2, 
   USBDIV = 2, 
   FOSC = HSPLL_HS, 
   VREGEN = ON     


 //====user settings to override default module options ==== 
#option GLCD_MODEL = S1D13700      //Controller mounted on display 
#option GLCD_MODEL = 6800          //hardware default M6800 Indirect CNF<3:2> 
#option GLCD_DATA = PORTD          // Data port - only 8 bit port 
#option GLCD_RES = PORTB.5         // reset pin    
#option GLCD_EN = PORTB.4          // EN pin - 6800 mode 
//#option GLCD_RD = PORTD.5          // RD pin - 8080 mode 
#option GLCD_RW = PORTB.3          // RW pin - 6800 mode 
//#option GLCD_WR = PORTD.6          // WR pin - 8080 mode 
#option GLCD_A0 = PORTB.2          // A0 pin 
#option GLCD_CS = PORTB.0          // chip select 
#option GLCD_TCR = $2C             // TC/R setting to fix flicker problem on display override system  instruction ($48) 
#option GLCD_ASPECT_RATIO = 100    // aspect ratio, smaller number will squeeze y For GLCD circles And Boxes 
#option GLCD_INIT_DELAY = 100      // initialisation delay (ms) 
    
Include "glcd.bas" 
Include "arial.bas" 
Include "graphics.bas" 
Include "utils.bas" 

 Dim cindex As Byte 
  
       //================Main Program =================== 
  
   //OSCCON.6 = 1              // Set Internal OSC to 8Mhz 
   //OSCCON.5 = 1              //        " 
   //OSCCON.4 = 1             //        " 
   OSCTUNE.6 = 0           // Turn off/on PLL 
              

SetAllDigital

// temp - LED 5 flashes before writting to screen 

High(PORTA.0) 

For cindex=1 To 5      
      Toggle(PORTA.0)      
      DelayMS(100) 
      Toggle(PORTA.0)      
      DelayMS(100) 
Next    


// clear screen and set font - driver defaults 
// to layer 1 at startup - according to S1D13700 help 
// file, bsClear provides fastest font rendering... 
Cls(1) 
SetFont(Arial) 
Brush.Style = bsClear 

// display some text... 
WriteAt(0,0,"Hello World") 
WriteAt(50,50,"Hello World")
Wich is from this forum. Led flashes, but no GLCD movement.

I hope you guys can help me out!

mgrondstra
Posts: 11
Joined: Mon May 10, 2010 12:02 pm
Location: Netherlands, Enschede

Post by mgrondstra » Mon May 17, 2010 9:44 am

Nobody can help me with this?

Jerry Messina
Swordfish Developer
Posts: 1473
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Post by Jerry Messina » Mon May 17, 2010 9:54 am

I haven't used this module, but I think you need to change your second #option statement to be

#option GLCD_MODE = 6800 //hardware default M6800 Indirect CNF<3:2>

instead of GLCD_MODEL

mgrondstra
Posts: 11
Joined: Mon May 10, 2010 12:02 pm
Location: Netherlands, Enschede

Post by mgrondstra » Mon May 17, 2010 9:59 am

Good one, i changed it. But still doesn't work..

Francis
Registered User
Registered User
Posts: 314
Joined: Sun Mar 25, 2007 9:40 am
Location: Devon

Post by Francis » Mon May 17, 2010 10:18 am

All this assumes the GLCD is OK. (I had 2 KS0108 GLCD duffers via Ebay).

I haven't been through your code, but have you tried changing the pen.color ?

Do you know, for sure, that your contrast adjustment is working?
PSU good?

I'd try plotting some pixels or lines too for testing.

My next step would be get the oscilloscope out and check signals and continuity of the connections between PIC and GLCD.

Raistlin
Registered User
Registered User
Posts: 69
Joined: Tue Apr 01, 2008 1:13 pm

Post by Raistlin » Mon May 17, 2010 11:28 am

I been having a hell of a time with a T6963 340x128 couldn't get anything but garbage from it.

Matt has kindly been helping me and even sent me a HEX for my device (16F6720) working code.

Once i scoped it out I found I have 1.2V ground bounce on the data lines .. pcb seems ok but I think Mchip dropped the ball on this device ,, swapping to a 6722 and a new board with clamp diodes.
If you can read this you are too close

mgrondstra
Posts: 11
Joined: Mon May 10, 2010 12:02 pm
Location: Netherlands, Enschede

Post by mgrondstra » Mon May 17, 2010 12:31 pm

Francis wrote:All this assumes the GLCD is OK. (I had 2 KS0108 GLCD duffers via Ebay).

I haven't been through your code, but have you tried changing the pen.color ?

Do you know, for sure, that your contrast adjustment is working?
PSU good?

I'd try plotting some pixels or lines too for testing.

My next step would be get the oscilloscope out and check signals and continuity of the connections between PIC and GLCD.

I think my contrast is not ok. I can't get an completely white screen with the contrast knob on my easypic5 dev board.

I know the MCU is ok, PSU is ok too.

Currently i have tried hooking the V0 to an 10k res and 10k variable res and then to gnd or VEE. Nothing seems to work.

[edit] I have no acces to an oscilloscope[/edit]

MattH
Registered User
Registered User
Posts: 51
Joined: Mon Jan 01, 2007 8:03 pm
Location: Allentown, PA

Post by MattH » Mon May 17, 2010 12:43 pm

Currently i have tried hooking the V0 to an 10k res and 10k variable res and then to gnd or VEE. Nothing seems to work.
Connect one side of the pot (10-20k) to +5V, the other side to VEE and the middle pin to Vo. That will work.

Matt
Last edited by MattH on Mon May 17, 2010 2:05 pm, edited 1 time in total.

mgrondstra
Posts: 11
Joined: Mon May 10, 2010 12:02 pm
Location: Netherlands, Enschede

Post by mgrondstra » Mon May 17, 2010 1:09 pm

MattH wrote:
Currently i have tried hooking the V0 to an 10k res and 10k variable res and then to gnd or VEE. Nothing seems to work.
Connect one side of the pot (10-20k) to +5V, the other side to Vo and the middle pin to VEE. That will work.

Matt
It still doesn't give a white screen.

On the other hand, when i startup the screen with an +5V lead to the rst pin the screen turns completely white, and brightness is adjustable...

MattH
Registered User
Registered User
Posts: 51
Joined: Mon Jan 01, 2007 8:03 pm
Location: Allentown, PA

Post by MattH » Mon May 17, 2010 1:19 pm

On the other hand, when i startup the screen with an +5V lead to the rst pin the screen turns completely white, and brightness is adjustable...
The RES pin should be "1" after initializing the LCD. You should be able to measure that with an multimeter. I'm wondering if your lcd supports 6800 mode. Check on your lcd if you can switch to 8080 mode. Most lcd's having a jumper or 0 Ohm resistor you can change. I've never tried 6800 mode. All my displays running in 8080 mode w/out any problems.

Matt

mgrondstra
Posts: 11
Joined: Mon May 10, 2010 12:02 pm
Location: Netherlands, Enschede

Post by mgrondstra » Mon May 17, 2010 1:34 pm

MattH wrote:
On the other hand, when i startup the screen with an +5V lead to the rst pin the screen turns completely white, and brightness is adjustable...
The RES pin should be "1" after initializing the LCD. You should be able to measure that with an multimeter. I'm wondering if your lcd supports 6800 mode. Check on your lcd if you can switch to 8080 mode. Most lcd's having a jumper or 0 Ohm resistor you can change. I've never tried 6800 mode. All my displays running in 8080 mode w/out any problems.

Matt
The LCD supports 8080 mode, but then i have to solder to another connector(see datasheet) Wich is quite difficult because its an strip(?)

In datasheet the following pin layouts are given:

CN1:
1 VSS Ground(0V)
2 VDD Logic Power input
3 VO LCD contrast control
4 A0 Command / Data Select
5 R/W 6800: Write OR Read
6 E 6800: Enable Signal
7 D0 Data bus line 0
8 D1 Data bus line 1
9 D2 Data bus line 2
10 D3 Data bus line 3
11 D4 Data bus line 4
12 D5 Data bus line 5
13 D6 Data bus line 6
14 D7 Data bus line 7
15 /CS LCD IC Chip Select
16 /RES LCD Controller Function reset
17 VEE Negative voltage output(-23V)
18 NC
19 FGND Front Panel Ground
20 NC
21 LEDA Power Supply For Led Backlight(A)
22 LEDK Power Supply For Led Backlight(K)

CN2:
1 VSS Ground(0V)
2 VDD Logic Power input
3 VO LCD contrast control
4 A0 Command / Data Select
5 /WR (R/W) 8080:Data write 6800: Write OR Read
6 /RD (E) 8080:Data read 6800: Enable Signal
7 D0 Data bus line 0
8 D1 Data bus line 1
9 D2 Data bus line 2
10 D3 Data bus line 3
11 D4 Data bus line 4
12 D5 Data bus line 5
13 D6 Data bus line 6
14 D7 Data bus line 7
15 /CS LCD IC Chip Select
16 /RES LCD Controller Function reset
17 VEE Negative voltage output(-23V)
18 SEL1 SEL1=L,8080 interface; SEL1=H,6800 interface(NC)
19 FGND Front Panel Ground
20 NC NC
21 LEDA Power Supply For Led Backlight(A)
22 LEDK Power Supply For Led Backlight(K)

I think the pcb has some jumper options(j1:j5)

with j1 and j2 next to cn2 strip connector bottomleft.
and j3:j5 above the cn1 connector to the right.
Picture of the back:
Image

MattH
Registered User
Registered User
Posts: 51
Joined: Mon Jan 01, 2007 8:03 pm
Location: Allentown, PA

Post by MattH » Mon May 17, 2010 1:46 pm

Pin 18 of CN2 is the 8080/6800 select pin. It should be grounded. I wouldn't be surprised if pin 18 goes to one of the jumpers (or R26??)

mgrondstra
Posts: 11
Joined: Mon May 10, 2010 12:02 pm
Location: Netherlands, Enschede

Post by mgrondstra » Mon May 17, 2010 2:09 pm

MattH wrote:Pin 18 of CN2 is the 8080/6800 select pin. It should be grounded. I wouldn't be surprised if pin 18 goes to one of the jumpers (or R26??)
It goes to Rs26 wich is an 0 ohm res.

I've tried using cn1 as an 8080 because al the pins are the same(measured with multi) but it still won't run in 8080.

This weekend my friend is going to make me an pcb to connect the strip to an breadboard. I hope this works.

MattH
Registered User
Registered User
Posts: 51
Joined: Mon Jan 01, 2007 8:03 pm
Location: Allentown, PA

Post by MattH » Mon May 17, 2010 2:18 pm

If pin 18 is grounded then the lcd should work in 8080 mode. The pins between CN1 and CN2 are identical. Don't waste your time making a board.
Try to use an pull-up (4k7) on your /RES line. I would also drop the clock down to 10/12MHz no PLL if you can.

mgrondstra
Posts: 11
Joined: Mon May 10, 2010 12:02 pm
Location: Netherlands, Enschede

Post by mgrondstra » Mon May 17, 2010 3:02 pm

MattH wrote:If pin 18 is grounded then the lcd should work in 8080 mode. The pins between CN1 and CN2 are identical. Don't waste your time making a board.
Try to use an pull-up (4k7) on your /RES line. I would also drop the clock down to 10/12MHz no PLL if you can.
:D

It works !!! Thanks a lot man!!

Post Reply