luciano.
thanks for the concern for everything that i have posted on this forum. I got many things to work since I started to write to this forum. xtal problem i fixed with INTRC. The first lcd problem I got to work with the contrast setting. The seond lcd is a hantronix and that is were I am having problems.
The hantronix screen that I have is the hdm-20416h. The contrast should be controlled with either a single or dual power source. I tried the single and that did not work. I am now working with a dual power source for the contrast and that works. It is not much that it needs dual power source but that it need to have more than 5volt to work. The second problem that I have with the hantronix screen is that the line address is not correct. Line 1 starts with $00 but to go any further into the line i can not do. Line 2 threw 4 is not to what the hantronix reccomend, but it is $C0, $94, $D4 . Those are the line addresses that I have figured out and what I have gotten to work so far. I am having a time trying to figure out what is happenning with line 1, but that is nothing more than the other problems that I had. Time will tell in getting it to work.
Thank you again for suggestion that I could use for figuring out timing issues.
The code that I am using is as follows:
' PicBasic program to demonstrate operation of an LCD in 4-bit mode
' PIC16F628
' LCD should be connected as follows:
' LCD PIC
' DB4 PortA.0
' DB5 PortA.1
' DB6 PortA.2
' DB7 PortA.3
' RS PortA.4 (add 4.7K pullup resistor to 5 volts)
' E PortB.3
' RW Ground
' Vdd 5 volts
' Vss Ground
' Vo 20K potentiometer (or ground)
' DB0-3 No connect
Pause 1000 ' Wait for LCD to startup
CMCON = 7
loop: Lcdout $fe, 1 ' Clear LCD screen
lcdout $FE, $00 + 0, "LINE 1"
lcdout $FE, $C0 + 0, "LINE 2"
lcdout $FE, $94 + 0, "LINE 3"
lcdout $FE, $D4 + 0, "LINE 4"
pause 2000
Lcdout $fe, 1 ' Clear LCD screen
lcdout $FE, $00 + 1, "LINE 1"
lcdout $FE, $C0 + 1, "LINE 2"
lcdout $FE, $94 + 1, "LINE 3"
lcdout $FE, $D4 + 1, "LINE 4"
pause 2000
Lcdout $fe, 1 ' Clear LCD screen
lcdout $FE, $00 + 2, "LINE 1"
lcdout $FE, $C0 + 2, "LINE 2"
lcdout $FE, $94 + 2, "LINE 3"
lcdout $FE, $D4 + 2, "LINE 4"
pause 2000
Lcdout $fe, 1 ' Clear LCD screen
lcdout $FE, $00 + 3, "LINE 1"
lcdout $FE, $C0 + 3, "LINE 2"
lcdout $FE, $94 + 3, "LINE 3"
lcdout $FE, $D4 + 3, "LINE 4"
pause 2000
Lcdout $fe, 1 ' Clear LCD screen
lcdout $FE, $00 + 4, "LINE 1"
lcdout $FE, $C0 + 4, "LINE 2"
lcdout $FE, $94 + 4, "LINE 3"
lcdout $FE, $D4 + 4, "LINE 4"
pause 2000
Lcdout $fe, 1 ' Clear LCD screen
'lcdout $FE, $00 + 5, "LINE 1"
lcdout $FE, $C0 + 5, "LINE 2"
lcdout $FE, $94 + 5, "LINE 3"
lcdout $FE, $D4 + 5, "LINE 4"
pause 2000
Lcdout $fe, 1 ' Clear LCD screen
'lcdout $FE, $00 + 6, "LINE 1"
lcdout $FE, $C0 + 6, "LINE 2"
lcdout $FE, $94 + 6, "LINE 3"
lcdout $FE, $D4 + 6, "LINE 4"
pause 2000
Lcdout $fe, 1 ' Clear LCD screen
'lcdout $FE, $00 + 7, "LINE 1"
lcdout $FE, $C0 + 7, "LINE 2"
lcdout $FE, $94 + 7, "LINE 3"
lcdout $FE, $D4 + 7, "LINE 4"
pause 2000
Lcdout $fe, 1 ' Clear LCD screen
'lcdout $FE, $00 + 8, "LINE 1"
lcdout $FE, $C0 + 8, "LINE 2"
lcdout $FE, $94 + 8, "LINE 3"
lcdout $FE, $D4 + 8, "LINE 4"
pause 2000
Lcdout $fe, 1 ' Clear LCD screen
'lcdout $FE, $00 + 9, "LINE 1"
lcdout $FE, $C0 + 9, "LINE 2"
lcdout $FE, $94 + 9, "LINE 3"
lcdout $FE, $D4 + 9, "LINE 4"
pause 2000
Lcdout $fe, 1 ' Clear LCD screen
'lcdout $FE, $00 + 10, "LINE 1"
lcdout $FE, $C0 + 10, "LINE 2"
lcdout $FE, $94 + 10, "LINE 3"
lcdout $FE, $D4 + 10, "LINE 4"
pause 2000
Lcdout $fe, 1 ' Clear LCD screen
'lcdout $FE, $00 + 11, "LINE 1"
lcdout $FE, $C0 + 11, "LINE 2"
lcdout $FE, $94 + 11, "LINE 3"
lcdout $FE, $D4 + 11, "LINE 4"
pause 2000
Lcdout $fe, 1 ' Clear LCD screen
'lcdout $FE, $00 + 12, "LINE 1"
lcdout $FE, $C0 + 12, "LINE 2"
lcdout $FE, $94 + 12, "LINE 3"
lcdout $FE, $D4 + 12, "LINE 4"
pause 2000
Lcdout $fe, 1 ' Clear LCD screen
'lcdout $FE, $00 + 13, "LINE 1"
lcdout $FE, $C0 + 13, "LINE 2"
lcdout $FE, $94 + 13, "LINE 3"
lcdout $FE, $D4 + 13, "LINE 4"
pause 2000
Lcdout $fe, 1 ' Clear LCD screen
'lcdout $FE, $00 + 14, "LINE 1"
lcdout $FE, $C0 + 14, "LINE 2"
lcdout $FE, $94 + 14, "LINE 3"
lcdout $FE, $D4 + 14, "LINE 4"
pause 2000
Lcdout $fe, 1 ' Clear LCD screen
'lcdout $FE, $00 + 15, "LINE "
lcdout $FE, $C0 + 15, "LINE "
lcdout $FE, $94 + 15, "LINE "
lcdout $FE, $D4 + 15, "LINE "
pause 2000
Lcdout $fe, 1 ' Clear LCD screen
'lcdout $FE, $00 + 16, "LINE"
lcdout $FE, $C0 + 16, "LINE"
lcdout $FE, $94 + 16, "LINE"
lcdout $FE, $D4 + 16, "LINE"
pause 2000
Lcdout $fe, 1 ' Clear LCD screen
'lcdout $FE, $00 + 17, "LIN"
lcdout $FE, $C0 + 17, "LIN"
lcdout $FE, $94 + 17, "LIN"
lcdout $FE, $D4 + 17, "LIN"
pause 2000
Lcdout $fe, 1 ' Clear LCD screen
'lcdout $FE, $00 + 18, "LI"
lcdout $FE, $C0 + 18, "LI"
lcdout $FE, $94 + 18, "LI"
lcdout $FE, $D4 + 18, "LI"
pause 2000
Lcdout $fe, 1 ' Clear LCD screen
'lcdout $FE, $00 + 19, "L"
lcdout $FE, $C0 + 19, "L"
lcdout $FE, $94 + 19, "L"
lcdout $FE, $D4 + 19, "L"
PAUSE 250
GOTO LOOP
Bookmarks