This is my first post to the list!
This is what I have done with a 16C56 and an Optrex 20x2 LCD module...
8bit interface. Based on datasheet from Phillips LCD modules
Parallax assembler
LCDRW equ RA.1 ;Read/Write out 18
LCDRS equ RA.2 ;Register Select out 1
LCDE equ RA.3 ;enable out 2
LCD equ 6 ; PortB bit7..0= pin 13 12 11 10 9 8 7 6
InitLCD
;8 bit interface 20x2 as page 10
; wait 15ms
movlw 72
movwf tmp
clrf wtmp
:L01
nop
decfsz wtmp
goto :L01
decfsz tmp
goto :L01
bcf LCDRW
bcf LCDRS
movlw 00111000b
movwf PortRB
nop
bsf LCDE
nop
nop
nop
bcf LCDE ;#1
; wait 4.1ms
movlw 20
movwf tmp
clrf wtmp
:L02
nop
decfsz wtmp
goto :L02
decfsz tmp
goto :L02
movlw 00111000b
movwf PortRB
nop
bsf LCDE
nop
nop
nop
bcf LCDE ;#2
; wait 100us or more =>208us
clrf wtmp
:L03
nop
decfsz wtmp
goto :L03
movlw 00111000b
movwf PortRB
nop
bsf LCDE
nop
nop
nop
bcf LCDE ;#3
call Wait40us
movlw 00111000b
movwf PortRB
nop
bsf LCDE
nop
nop
nop
bcf LCDE ;#4
call Wait40us
movlw 00001100b
movwf PortRB
nop
bsf LCDE
nop
nop
nop
bcf LCDE ;#5 Display On/Off
call Wait40us
movlw 00000001b
movwf PortRB
nop
bsf LCDE
nop
nop
nop
bcf LCDE ;#6 Display Clear
movlw 10
movwf tmp
clrf wtmp
:L04
nop
decfsz wtmp
goto :L04
decfsz tmp
goto :L04
movlw 00000110b
movwf PortRB
nop
bsf LCDE
nop
nop
nop
bcf LCDE ;#7 Entry mode set
InitEnd
Now you just send data to it and wait 40us for it to end the operation,
or read the busy flag.
Ivan Kocher
WIL REEDER wrote:
{Quote hidden}>
> Hi
>
> I have several curcuits working with a pic 16c84 driving 1x16 generic lcd
> displays. The larger displays have been a problem for me. I would
> appreciate someone stepping me through the init code for the optrex
> dmc40218. I understand that there is a code of 0x30 sent three times and
> all of the display on cursor on/off stuff but I am still not getting
> results. I may have things in the wrong order or may be missing something
> entirely. My circuit is 8 bit ( not 4 like most of the lit on the net).
> Thanks for your help!
>
> Wil Reeder
>
.....teachtechKILLspam
@spam@bc.sympatico.ca
> Vancouver, Canada