Hi
Im new at microcontrollers and i have the same problem with pic16f877a.
Im try to make a counter.

DEFINE LCD_DREG PORTD
DEFINE LCD_DBIT 4
DEFINE LCD_BITS 4
DEFINE LCD_RSREG PORTD
DEFINE LCD_RSBIT 2
DEFINE LCD_EREG PORTD
DEFINE LCD_EBIT 3
DEFINE LCD_LINES 2


cnt var word
cnt =0
pause 1000

mainloop:
Lcdout $fe, 1
Lcdout $fe, 2
cnt = cnt +1
Lcdout "x=",DEC cnt
Pause 1000


Goto mainloop


LCD starts to count (sometimes doesnt start) and after few seconds gives me
-<????-<????-<????-<????
and other strange things.

same results if i use port B or port E. The pins connections are ok because i see sometimes the counter running.
Please give some advice, i cant sleep at night.