PDA

View Full Version : Problem with 16F886 and LCD on PortC



florin
- 18th November 2013, 11:36
Hi, I write a program to test LCD and I see on first line black squares.
What's wrong ?
The LCD is OK, i have test with 16F690 on PortC and work.
This is my code:
@ __config _CONFIG1,_WDT_OFF & _MCLRE_OFF & _LVP_OFF & _CP_OFF
@ __config _CONFIG2, _WRT_OFF


DEFINE OSC 4
ANSEL=0 'toate porturile sunt digitale
ANSELH=0

;******** legaturi display 2x16 caractere *******
DEFINE LCD_DREG PORTC ;PortC folosit pentru date
DEFINE LCD_DBIT 0 ;pinul 0 este primul pin de date conectat
DEFINE LCD_RSREG PORTC ;portC folosit pt. pinul RS
DEFINE LCD_RSBIT 5 ;Register select pin
DEFINE LCD_EREG PORTC ;foloseste PortC pentru pinul E
DEFINE LCD_EBIT 4 ;Enable pin
DEFINE LCD_BITS 4 ;bus pe 4 biti
DEFINE LCD_LINES 2 ;LCD cu doua randuri de caractere

Pause 500
Bucla:

Lcdout $FE,1 ;clear display

Lcdout $FE,2 ;return home

Lcdout "TEST TEST"
pause 3000
goto Bucla

end

Demon
- 18th November 2013, 11:46
Have you searched the forum for similar problem?

Look at this from similar chip:
http://melabs.com/samples/LABX1-16F887/lcdx.htm

Came from: http://www.picbasic.co.uk/forum/showthread.php?t=18151&highlight=16f887+lcd+digital

Robert

florin
- 18th November 2013, 13:31
I try these and... nothing. The program run (I put a LED who blink). Any advise, please ?

Heckler
- 18th November 2013, 15:37
Is it possible that the CONTRAST on the LCD is set too high?

florin
- 18th November 2013, 16:11
Solved. DB4 from LCD not conected :confused: Thanks.

Demon
- 18th November 2013, 23:55
What about analog, pwm or some pther feature enabled on selected ports?

Robert

florin
- 20th November 2013, 13:22
What about analog, pwm or some pther feature enabled on selected ports?

Robert

I use this
ANSEL=0 ;porturile A si B sunt digitale
ANSELH=0
ADCON0.0=0
SSPCON.5=0 ;dezactiveaza portC serial
RCSTA.7=0