I have written some routines for the SP 5-GFX1 from Lascar Electronics www.lascarelectronics.com, it also uses the Sunplus SPLC501C. It uses the serial interface but the startup routine might help. Look at function gfx1_start_up() in the file gfc1_ser_dr.c. Also note that things like column addresses may not be where you expect them because it depends on the physical COG connections.. http://www.geocities.com/g13685/sub_index.html Regards Ian Mauricio Jancic wrote: > Hello, > I've been dealing with this for a week now and haven't yet found a > solution, perhaps someone here had a similar experience. > > I'm using a NewHaven graphic lcd (128x64 part no. > NHD-LGC12864CZ-FSW-GBW). It's a COG LCD with a SPLC501C controller chip. > > I bought some LCD routines from embedded-code.com and I'm trying to > make everything work. > > The main problem is the initialization routine of the LCD. Since the > LCD routines are licence protected I can post the code, but I'll post some > bits of information: > > First, the initialization routine, as described on the datasheet is: > > lcd_set_reset_pin(0); > lcd_delay_ms(2); > lcd_set_reset_pin(1); > lcd_delay_ms(20); > > > //----- DO THE CONFIGURATION COMMAND SEQUENCE ----- > wrt_cmd(0xa2); > wrt_cmd(0xa0); > wrt_cmd(0xc8); > wrt_cmd(0x25); > wrt_cmd(0x81); > wrt_cmd(0x10); > wrt_cmd(0x2F); > wrt_cmd(0xAF); > wrt_cmd(0xA5); > > while(1); > > This should initialize the LCD and show a screen with all the dots ON > (command 0xA5). > > The wrt_cmd() routine is the following: > > > LCD_DATA_BUS = data; > > //Setup control pins > LCD_CS1 = 0; > LCD_RW = 1; > LCD_RD = 1; > LCD_DC = 0; //DC low for > a command > > ACCESS_DELAY; > //Latch in the byte > LCD_RW = 0; > ACCESS_DELAY; //Pause > > LCD_RW = 1; > > LCD_CS1 = 1; > > My control pins C86 and PS in the LCD are set to LOW and HIGH respectively. > > The main problem I found is that the built in inverter is not working, > because I don't see the expected voltages on pins V1 to V5, all of them have > 3.25 v (that's the LCD voltage). > > I'm attaching the schematic, should it clarify more. > > Any help you can provide will be appreciated. > > Regards, > > Mauricio > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist