PDA

View Full Version : newbi trying LCD on 16F690



devidasbhonde
- 14th November 2009, 09:10
Hi All,

I am a new commer to PIC and Picbasic Pro.
(Previously I have worked with Atmel 89c52)
(And being first time,,, lot of struggling with pic :-(

LCD not displaying anything. Please help me.
(this LCD has worked well with 89c52, its china make....)

I am using 16F690 and using following connections for LCD.

I have connected:
RC0 to DB4 of LCD
RC1 to DB5
RC2 to DB6
RC3 to DB7
RB4 to RS of lcd
RB6 to E

My code is:

DEFINE LCD_DREG PORTC
DEFINE LCD_DBIT 0
DEFINE LCD_RSREG PORTB
DEFINE LCD_RSBIT 4
DEFINE LCD_EREG PORTB
DEFINE LCD_EBIT 6
DEFINE LCD_LINES 2
DEFINE LCD_COMMANDUS 2000
DEFINE LCD_DATAUS 100
DEFINE LCD_BITS 4

ADCON0 = 0 ' Set all digital
CM1CON0 = 0 ' Analog comparators off
CM2CON0 = 0
SSPCON = 0

Lcdout $fe, 1 ' Clear screen

Pause 1000 ' Wait for LCD to start up


mainloop:
Lcdout $fe, 1 ' Clear screen
Pause 1500 ' Wait .5 second
Lcdout "Hello" ' Display "Hello"
Pause 500 ' Wait .5 second
Lcdout $fe, $c0, "World"
Pause 1500 ' Wait .5 second
Goto mainloop ' Do it forever

End

Regards,

Devidas

devidasbhonde
- 14th November 2009, 09:54
The LCD has 16 pins, with BL.
Its marked JHD 162A and some chinese .... I am sorry.
No indication of internal controller.

Melanie
- 14th November 2009, 10:23
Welcome to the forum.

Check the DATASHEET... you may have forgotten something (like the ANSEL & ANSELH Registers)...

devidasbhonde
- 14th November 2009, 11:21
Thanks. I will look it up.

devidasbhonde
- 14th November 2009, 17:20
Thanks Melanie !!!
You are my Angel. I should have prayed you earlier.
I spent a full day before, and your one sentence solved it.
Now it is working perfect. Thanks again.