hello,
Never posted here before. But I do read a lot.
Any way maybe this will help some one starting out with LCD's
I use Pic Basic Pro Version 2.50a
Micro Code Studio Version 3.0.0.5
I have A Microchip PIC 12F628A
and a Hantronix HDM20216L-1 20x2 LCD
I started off with the "Hello World" LCD Toturial.
plugged in a chip, set the right chip in PBP, programed it up, soldered a few test leads to my lcd. and this is what i got
Code: -------------------------------------------------------------------
Pause 500 ' Wait for LCD to startup
loop: Lcdout $fe, 1 ' Clear LCD screen
Lcdout "Hello" ' Display Hello
Pause 500 ' Wait .5 second
Lcdout $fe, 1 ' Clear LCD screen
Lcdout "World"
Pause 500 ' Wait .5 second
Goto loop ' Do it forever
-------------------------------------------------------------------
Screen 1: Hello
Screen2: HelloWo ld
(well this is wrong! Hello was suppose to disappear and last i checked "Wo ld" had an r in the middle)
ok lets modify the code and try something new
new code: -------------------------------------------------------------------
Pause 1000 ' Wait for LCD to startup
loop: Lcdout $fe, 1 ' Clear LCD screen
lcdout $fe, $80
pause 1000
Lcdout "abcdefghijklmnopqrst" ' Display Hello
lcdout $fe, $c0
Lcdout "uvwxyz0123456789ABCD"
pause 1000
Lcdout $fe, 1 ' Clear LCD screen
lcdout $fe, $80
pause 1000
Lcdout "EFGHIJKLMNOPQRSTUVWX" ' Display Hello
lcdout $fe, $c0
Lcdout "VZ~!@#$%^&*()_+-=,.?"
pause 1000
Goto loop ' Do it forever
END
-------------------------------------------------------------------
Screen 1:
abcdefghijklmno7qrst
uvwxyz0123456789ABCD
Screen 2:
EFGHIJKLMNO QRSTUVWX
YZ>!@#$%^&*()_2-= .?
ok still not even close since when is "p" = "7" and "~" = a right arrow, "+" = "2", and a comma = nothing.
new thought maybe i have a bad wire, maybe i have a non compatible LCD, maybe I'm a rock
well the answer is number three, after reading lots and finding nothing, i found a post about an LCD with a gridded out screen. several posts in the thread someone suggested that he had spelled CMCON = 7 wrong
then i thought i don't have a turn off analog statement in my code.
guess what,
that's it works like a champ
my only question is what if i need a analog input? say i want a battery meter on my project.
now what i have no analog ports, can anyone suggest something for me
Bookmarks