Re: Problem with LCD & PIC16C54C
- From: "ydoubleuz@xxxxxxxxx" <ydoubleuz@xxxxxxxxx>
- Date: 12 Apr 2007 19:41:52 -0700
Hi,
Yup the contrast voltage is -3V. The PIC is working becoz I tied a LED
to one of the o/p. However, the LCD still does not display. It could
be due to the wrong init. sequences or that data are not sent to the
LCD correctly.
;***************************** Initialize LCD
*******************************
CALL DELAY
CALL DELAY
CALL DELAY
BCF PORTA,LCD_RS
BCF PORTA,LCD_RW
CALL DELAY
CALL FUNCTIONSET
CALL FUNCTIONSET
CALL FUNCTIONSET
CALL SDELAY
MOVLW 0x3F ; Function set
MOVWF PORTB
CALL SENDTOLCD
CALL SDELAY
MOVLW 0x08 ; Display ON/OFF = display off, cursor off, blink off
MOVWF PORTB
CALL SENDTOLCD
CALL SDELAY
MOVLW 0x01 ; Clear Display
MOVWF PORTB
CALL SENDTOLCD
CALL DELAY
CALL DELAY
CALL DELAY
CALL DELAY
CALL DELAY
MOVLW 0x06 ; Entry Mode Set
MOVWF PORTB
CALL SENDTOLCD
CALL SDELAY
;************************************
FUNCTIONSET
CALL SDELAY
MOVLW 0x30 ; 2 line, display on
MOVWF PORTB
BSF PORTA,LCD_EN
CALL SDELAY
NOP
BCF PORTA,LCD_EN
CALL SDELAY
RETLW 0
SENDTOLCD
CALL SDELAY
BSF PORTA,LCD_EN
CALL SDELAY
NOP
BCF PORTA,LCD_EN
CALL SDELAY
RETLW 0
///////////////////////////////////////////////////
Any help is appreciated. btw .... could the problem be due to the 4Mhz
osc i am using becoz the data*** has a condition Fosc=270KHz
ywz
.
- Follow-Ups:
- Re: Problem with LCD & PIC16C54C
- From: ydoubleuz@xxxxxxxxx
- Re: Problem with LCD & PIC16C54C
- Prev by Date: Re: OT: Energy=Horsepower-Hours ???
- Next by Date: Re: Why blue resistors?
- Previous by thread: MiddleBrook Has Yahoo Forum
- Next by thread: Re: Problem with LCD & PIC16C54C
- Index(es):