Add ANSELH = 0 to disable PORTB analog.
Also,
Here is something else to look at, that frustrated me for a while.
Note on the specs that the Vo LCD voltage may be specified relative to the supply voltage (Vdd) and not ground.
Use a 20K pot wired as a voltage divider to feed the Vo and check that the output voltage is close to the spec. a 5k or 10k pot will work too.
On mine at least, there was a fairly narrow range, where the LCD was readable.
It turned out that mine was working all along, I just didn't know it.
Bob
Wozzy-2010
RW bit ? are you going to read from the LCD memory to the PIC ? IF not
just tie it to ground, I do the same for the contrast bit, pin 3. I NEVER use a contrast pot and have yet to need one.
You might try adding FLAGS = 1 into your code, at least until you are sure everything is working. Check the Data Sheet and see if that PIC has comparators on portB and turn them off if so. And Finally TRISB=0
so your PIC knows the LCD requires outputs.
"PIC working ok LED lights up"
That's because the HIGH command will manipulate the TRIS register, I think probably the TRISB = 0 or TRISB = %00000000 will make it work.
Oh BTW I see you are new here, WELCOME !
Last edited by Archangel; - 29th January 2010 at 05:15.
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Thanks all for the suggestions, I'll give them a go when I get home from work.
Cheers
Thanks all,
The solution was ANSELH
I had thought ANSEL covered this chip but I guess there is a high register that needs setting.
Back to the datasheet...........
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Bookmarks