Quote Originally Posted by tiger_bel View Post
hoi,

this works with 628 and Sharp LM16A211 at 4Mhz
2 rows of black squares if disp is not initialised ( at power up)
init the display first at startup

rgds
tb

pause 2000

DEFINE LCD_DREG PORTD 'dataport select'
DEFINE LCD_DBIT 0 'first databit
DEFINE LCD_RSREG PORTA 'lcd register port
DEFINE LCD_RSBIT 3 'register select bit'
DEFINE LCD_EREG PORTA 'enable poort'
DEFINE LCD_EBIT 1 'enable bit'
DEFINE LCD_BITS 4 'lcd bus size'
DEFINE LCD_LINES 2 'lcd lines'
DEFINE LCD_COMMANDUS 2000
DEFINE LCD_DATAUS 50 'data delay in µs'

'init display
LCDOUT $FE,1 ' clear LCD
pause 100 ' pauze 0,1s
LCDOUT $FE,2 ' cursor home
LCDOUT $FE,$0C ' cursor off
pause 1000 ' pauze 0,1s


' message

LCDOUT $FE, $80, " hello "
LCDOUT $FE, $C0, " ready "
pause 1000 ' pauze 0,1s

go on

I have try that code, and I cant get it work.
I have try to switch to a new LCD display, and still same problem.
Now i have try with PIC16F676, almost the same problem there, but this time the first row is showing black squares on initializing and then clear screen 1 sec later...

Here is the code for pic16f676:

@ device INTRC_OSC_NOCLKOUT
DEFINE LCD_DREG PORTC 'dataport select'
DEFINE LCD_DBIT 0 'first databit
DEFINE LCD_RSREG PORTC 'lcd register port
DEFINE LCD_RSBIT 4 'register select bit'
DEFINE LCD_EREG PORTC 'enable poort'
DEFINE LCD_EBIT 5 'enable bit'
DEFINE LCD_BITS 4 'lcd bus size'
DEFINE LCD_LINES 2 'lcd lines'
DEFINE LCD_COMMANDUS 2000
DEFINE LCD_DATAUS 50 'data delay in µs'

CMCON = 7
VRCON = 0

Pause 1000
'init display
LCDOut $FE,1 ' clear LCD
Pause 100 ' pauze 0,1s
flags = 0
LCDOut $FE,2 ' cursor home
LCDOut $FE,$0C ' cursor off
Pause 1000 ' pauze 0,1s


' message

LCDOut $FE, $80, " hello "
LCDOut $FE, $C0, " ready "
Pause 1000 ' pauze 0,1s


loopme:
Pause 1000
High PORTA.0
Pause 1000
Low PORTA.0
GoTo loopme