LCDInfo.com http://forum.lcdinfo.com/ |
|
wg12864b graphic lcd http://forum.lcdinfo.com/viewtopic.php?f=9&t=790 |
Page 1 of 1 |
Author: | jijita [ Tue Aug 24, 2004 1:13 ] |
Post subject: | wg12864b graphic lcd |
i'm new in working with lcd and i've been searching for complete infos on how this lcd wg12864b works,but i'm still confused . how do i initialise this lcd ? i tried writing a code but it didn't work any knowledge would be helpful thank you |
Author: | jijita [ Tue Aug 24, 2004 1:53 ] |
Post subject: | ks0108 |
this lcd has a ks0108 controller please i need your help |
Author: | Tom [ Tue Aug 24, 2004 11:32 ] |
Post subject: | |
Hi, do you want to use LCDInfo to drive your LCD or do you want to make your own driver? In case you want to use LCDInfo, then there is a ready to use driver. It works perfect, since I use a 128 x 64 dot LCD with the same controller. In case you want to make your own driver then you can find a complete datasheet on the folloing link: http://www.eio.com/ks0108b.pdf Regards Tom |
Author: | jijita [ Tue Aug 24, 2004 13:09 ] |
Post subject: | |
i have no idea about lcdinfo all i know is that this lcd has a built in controller ks0108 i wrote a piece of code but it didn't work i don't know why i'm using 16f877 here's the code: list p=16f877 #include <p16f877.inc> LCD_DATA EQU PORTC ; LCD data lines interface LCD_DATA_TRIS EQU TRISC LCD_CTRL EQU PORTA ; LCD control lines interface LCD_TEMP EQU 0x020 ; LCD subroutines internal use R1 EQU 0x21 R2 EQU 0x22 DELAY EQU 0x023 ; Used in DELAYxxx routines X_DELAY EQU 0x024 ; Used in X_DELAYxxx routines ; PORTA control bits LCD_E EQU 2 ; LCD Enable control line LCD_RW EQU 1 ; LCD Read/Write control line LCD_RS EQU 0 ; LCD Register-Select control line CS1 EQU 3 CS2 EQU 4 Rst EQU 5 ORG 0X00 main BCF STATUS,RP1 ;turns to Bank 1 BSF STATUS,RP0 MOVLW 0x06 ; Configure all pins MOVWF ADCON1 ; as digital inputs BSF STATUS,RP0 MOVLW B'00000111' OPTION CLRF TRISA MOVLW H'00' MOVWF TRISC BCF STATUS,RP0 CLRF PORTA CLRF PORTC BSF LCD_CTRL, LCD_RS ; Set LCD in command BSF PORTA,5 NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP BCF PORTA,5 NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP BSF PORTA,5 ` NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP MOVLW 40H ;Set Y Column Address >From 0 CALL WRITE_COMMAND1 CALL WRITE_COMMAND2 MOVLW H'B8' ;Set Page From 0 CALL WRITE_COMMAND1 CALL WRITE_COMMAND2 MOVLW H'C0' ;Set Display Start Line CALL WRITE_COMMAND1 CALL WRITE_COMMAND2 MOVLW H'3F' ;Set Display ON CALL WRITE_COMMAND1 CALL WRITE_COMMAND2 SHOWC: CLRF R1 CLRF R2 SCLOOP1: MOVLW H'B8' ;Set Page Address FROM 00H ADDWF R1,W ;Command B8H~BFH CALL WRITE_COMMAND1 CALL WRITE_COMMAND2 MOVLW 0x40 ;Set Column Address FROM 40H CALL WRITE_COMMAND1 CALL WRITE_COMMAND2 SCLOOP2 CALL table CALL WRITE_DATA1 INCF R2,1 MOVLW D'15' SUBWF R2,W BTFSC STATUS,Z GOTO main GOTO SCLOOP2 table MOVF R2,W ADDWF PCL,1 RETLW H'8C' RETLW H'92' RETLW H'92' RETLW H'62' RETLW H'80' RETLW H'FE' RETLW H'92' RETLW H'92' RETLW H'92' RETLW H'80' RETLW H'8C' RETLW H'92' RETLW H'92' RETLW H'62' RETLW H'00' WRITE_COMMAND1 MOVWF LCD_TEMP ; Command to send is in W ;Write Command To CS1 BCF LCD_CTRL,CS1 BSF LCD_CTRL,CS2 BCF LCD_CTRL, LCD_RW ; Set LCD in read mode BCF LCD_CTRL, LCD_RS ; Set LCD in command mode MOVF LCD_TEMP, W MOVWF LCD_DATA BSF LCD_CTRL, LCD_E ; LCD E-line High NOP NOP NOP NOP BCF LCD_CTRL, LCD_E ; LCD E-line Low RETURN ;****************************************************************************** WRITE_DATA1 ;Write Data To CS1 MOVWF LCD_TEMP ; Command to send is in W ;Write Command To CS1 BCF LCD_CTRL,CS1 BSF LCD_CTRL,CS2 BCF LCD_CTRL, LCD_RW ; Set LCD in read mode BSF LCD_CTRL, LCD_RS ; Set LCD in command mode MOVF LCD_TEMP, W MOVWF LCD_DATA BSF LCD_CTRL, LCD_E ; LCD E-line High NOP BCF LCD_CTRL, LCD_E ; LCD E-line Low RETURN ;****************************************************************************** WRITE_COMMAND2 ;Write Command To CS2 MOVWF LCD_TEMP ; Command to send is in W ;Write Command To CS1 BSF LCD_CTRL,CS1 BCF LCD_CTRL,CS2 BCF LCD_CTRL, LCD_RW ; Set LCD in read mode BCF LCD_CTRL, LCD_RS ; Set LCD in command mode MOVF LCD_TEMP, W MOVWF LCD_DATA BSF LCD_CTRL, LCD_E ; LCD E-line High NOP BCF LCD_CTRL, LCD_E ; LCD E-line Low RETURN ;****************************************************************************** ;LCDINIT ; Busy-flag is not yet valid ; CLRF LCD_CTRL ; ALL PORT output should output Low. ; power-up delay ; MOVLW 0x050 ; CALL X_DELAY500 ; MOVLW 0x030 ; 8-bit-interface, 2-lines ; CALL LCDPUTCMD ;MOVLW 0x009 ; CALL X_DELAY500 ; MOVLW 0x030 ; 8-bit-interface, 2-lines ; CALL LCDPUTCMD ;CALL X_DELAY500 ; MOVLW 0x030 ; 8-bit-interface, 2-lines ; CALL LCDPUTCMD ;MOVLW 0x030 ; 8-bit-interface, 2-lines ; CALL LCDPUTCMD ;MOVLW 0x008 ; 8-bit-interface, 2-lines ; CALL LCDPUTCMD ;MOVLW 0x001 ; 8-bit-interface, 2-lines ; CALL LCDPUTCMD ;MOVLW 0x007 ; 8-bit-interface, 2-lines ; CALL LCDPUTCMD END |
Author: | Henri [ Mon Aug 30, 2004 15:34 ] |
Post subject: | |
jijita wrote: i have no idea about lcdinfo
I suppose you might have better chance to get meaninful answers if you post to the correct forum as this forum is for the program called LCDInfo. I'll move your topics to the development forum section. |
Page 1 of 1 | All times are UTC + 2 hours |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |