122x32 GLCD with SED1520 lib

Coding and general discussion relating to user created compiler modules

Moderators: David Barker, Jerry Messina

Post Reply
rmteo
Posts: 237
Joined: Fri Feb 29, 2008 7:02 pm
Location: Colorado, USA

122x32 GLCD with SED1520 lib

Post by rmteo » Wed Mar 12, 2008 1:29 am

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?

User avatar
Steven
BETA Tester
Posts: 406
Joined: Tue Oct 03, 2006 8:32 pm
Location: Cumbria, UK

Post by Steven » Wed Mar 12, 2008 7:20 am

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

rmteo
Posts: 237
Joined: Fri Feb 29, 2008 7:02 pm
Location: Colorado, USA

Post by rmteo » Wed Mar 12, 2008 3:29 pm

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.

CS
Posts: 127
Joined: Thu Nov 02, 2006 9:14 am

Post by CS » Wed Jun 18, 2008 6:22 pm

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

rmteo
Posts: 237
Joined: Fri Feb 29, 2008 7:02 pm
Location: Colorado, USA

Post by rmteo » Wed Jun 18, 2008 10:32 pm

Thanks, CS. I will try that.

Post Reply