Dj:
I could be barking up the wrong tree here, and confess to having little knowledge of the 4 x 20 LCD. But from looking at your two attached photos a possible cure might be that you need to connect LCD pin #5 to ground?
Good luck.
yup, pin 5 is deffo connected to ground, its on the back of the lcd,
one question i must ask is: should the crystal be making a square wave?
(im running a 4 MHZ with 2x33pf caps) the signal measured between the 2 crystal legs pin 15-16 is more like a saw tooth waveform but with about 5 ms of flat at 0v, im assuming the problem is within my code.
im just getting frustrated now.
That's roughly about the normal for a crystal output. The 'amplifiers' inside the PIC take care of squaring off the edges and generating the clock signal. But are you sure it's 5ms of flat around 0v? and not possibly 5ns?
If you've got that 'rounded off sawtooth' looking waveform, you're in good shape....get it....good shape....Ha! Ok, I'm done...
If you post a SCHEMATIC of how you've got your hardware connected, along with the PIC you're using, I'm sure someone on this forum could throw a few lines of code together to write to your LCD and perhaps also flash a confidence LED to prove your hardware is working and post you a HEX with which you could program your PIC. That at least would prove if it's your hardware or software that's causing you grief. Then you could buy PICBasic and become a fully paid-up member... gives you status... people give up their seat for you on the bus... women will want you to kiss their babies (or claim you're the father)... you can run for president... etc etc...
the schematic is in the pic below, the only difference in my circuit is that i am using a 4 MHZ crystal instead of 32khz, i have compensated for this in my code, correct me if i am wrong.
can some one please compile a code or send me a hex file to try.
I'm not that experienced enough to resolve this issue, especially as the code is assembly and not PicBASIC pro, but looking at the schematic it shows the values for the crystal capacitors being 68pf. If you look at the datasheet for then 16F84 ( http://ww1.microchip.com/downloads/e...Doc/30430c.pdf ) it states in table 8-1 that for a 4 MHz crystal the preferred values are 15pf - 33pf. Maybe having the higher values which are suitable for Khz timing xtals does not suit the PIC and its not actually running ?
the crystal seems to be timing as i have checked on an oscilloscope
how is pic basic pro different from what i am doing?
and is it easier to learn?
Easier with PicBasic Pro ... yes indeed...
There's still some mistake in your code so far... not sure it's working @32KHz anywaysCode:' ' LCD setup ' ========= DEFINE LCD_DREG PORTB ' LCD data port DEFINE LCD_DBIT 0 ' LCD data starting bit DEFINE LCD_RSREG PORTA ' LCD register select port DEFINE LCD_RSBIT 1 ' LCD register select bit DEFINE LCD_EREG PORTA ' LCD enable port DEFINE LCD_EBIT 2 ' LCD enable bit DEFINE LCD_BITS 4 ' LCD data bus size DEFINE LCD_LINES 2 ' Number lines on LCD DEFINE LCD_COMMANDUS 2000 ' Command delay time in us DEFINE LCD_DATAUS 50 ' Data delay time in us LCDOUT "HELLO WORLD"
V0 to to GND? not sure, should be connected to a POT wiper or PWM driven or voltage divider.
Last edited by mister_e; - 18th June 2007 at 23:18.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks