Page 1 of 1

122x32 GLCD with SED1520 lib

Posted: Wed Mar 12, 2008 1:29 am
by rmteo
I am trying to get a 122x64 graphic LCD (model AMG12232D) to work with the SED1520 library.

The only thing that seems to work for now is that the GLCD.Cls command turns ON all pixels. When any other command is given (eg. GLCD.WriteAt, GLCD.Rectangle, etc), all pixels turn OFF.

Code: Select all

#option GLCD_MODEL = SED1520        
#option GLCD_DATA = PORTD        // data port
#option GLCD_RS = PORTB.2        // RS pin
#option GLCD_RW = PORTB.3        // RW pin
#option GLCD_CS1 = PORTB.0       // chip select
#option GLCD_CS2 = PORTB.1       // chip select
#option GLCD_INIT_DELAY = 100
Is there anything that I may have missed?

Posted: Wed Mar 12, 2008 7:20 am
by Steven
By default, the library supports a 122 x 32 display, so try also adding

Code: Select all

#option GLCD_WIDTH = 122         // width (pixels)
#option GLCD_HEIGHT = 64         // height (pixels)
to your code.

Then check to make sure that your display only has two CS lines.

If this doesn't sort it (and by the sounds of it, there is more to it than this), could you post the full code that you are trying?

Regards,

Steve

Posted: Wed Mar 12, 2008 3:29 pm
by rmteo
Steve, my apologies, it is a 122x32 LCD per the title. Here is the full code:

Code: Select all

Device = 18F4410       
Clock = 32
Config osc = hspll         ' 8Mhz Crystal    

#option GLCD_MODEL = SED1520  
#option GLCD_WIDTH = 122         // width (pixels) 
#option GLCD_HEIGHT = 32         // height (pixels)       
#option GLCD_DATA = PORTD        // data port
#option GLCD_RS = PORTB.2        // RS pin
#option GLCD_RW = PORTB.3        // RW pin
#option GLCD_CS1 = PORTB.0       // chip select
#option GLCD_CS2 = PORTB.1       // chip select
#option GLCD_INIT_DELAY = 100     

Include "GLCD.bas"
Include "Graphics.bas"
Include "Convert.bas"
Include "Tahoma.bas"
Include "Bitmaps.bas"

TRISC = 0

SetFont(Tahoma)
Font.Style = fsNormal
TextAlign = taCenter

l1:
   GLCD.Cls
   PORTC = $ff
   DelayMS(3000)      ' Here, consistent display on PORTD leds, RD5 on
   WriteStr(60,4,"- SWORDFISH SED1520 -")
   SetImage(0,19,BtnOK)
   PORTC = $0
   DelayMS(3000)      ' PORTD leds not consistent, 0-8 leds can be on
GoTo l1
This is on an EasyPIC4 board. I am using PORTC as an indication of where the program is.
After the GLCD.Cls command, PORTD is always consistent (PORTD.5 is ON, all others are off). However, after the other graphics commands, PORTD is not consistent - anything from 0 to 8 LED's can be ON, some LED's may also flash/flicker during the delay. This may be an indication of what is going on.

Posted: Wed Jun 18, 2008 6:22 pm
by CS
Hi rmteo,

the only thing that I can't see is the state of the RES-Pin from your display. It should be on highlevel.

Than it should work!

Hope that helps! Good luck!

CS

Posted: Wed Jun 18, 2008 10:32 pm
by rmteo
Thanks, CS. I will try that.