Searching \ for '[PIC]: LCD Problem Revisited' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/io/lcd/pic.htm?key=lcd
Search entire site for: 'LCD Problem Revisited'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: LCD Problem Revisited'
2001\02\12@214950 by Ian Hynes

flavicon
face
part 0 44 bytes
his is a multi-part message in MIME format.
part 1 885 bytes content-type:text/plain; charset=us-ascii (decoded 7bit)

PICers,

Sorry to be a pain but I'm totally stymied with this. It's a 16F84
interfaced via 3 wires to an HD44780 LCD. I'm still learning this
stuff so
it just  grabs keypad data, dumps it to 4 LEDs and shows the ASCII
value on the LCD. Heh .. well, supposedly. The interrupt routine and
LEDs work OK. (Thanks to guys who previously sent advice.) Thanks also
to guys who sent their own LCD programmes over.

Trouble is, I can't STAND being defeated by a mere machine. Seems to
me this *&$%! thing oughta work. The protoboard assembly is wired up
correctly, the programme appears to be doing all in accordance with
the LCD's requirements, the signals look OK on a CRO. But STILL it
doesn't work.

Attached is the MPLAB project & Ivex schematic (Only 14K so not too
much BW). ANY ideas would be enormously appreciated.

Thanks if can help - Ian

part 2 13699 bytes content-type:application/x-zip-compressed; (decode)

part 3 144 bytes
--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\02\12@220326 by David VanHorn

flavicon
face
At 01:45 PM 2/13/01 +1100, Ian Hynes wrote:
>PICers,
>
>Sorry to be a pain but I'm totally stymied with this. It's a 16F84
>interfaced via 3 wires to an HD44780 LCD. I'm still learning this
>stuff so

You know the 44780 needs three wires, plus four for data, right?



--
Dave's Engineering Page: http://www.dvanhorn.org
Where's dave? http://www.findu.com/cgi-bin/find.cgi?kc6ete-9

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\02\13@075604 by Robert Shady

picon face
You know, I've had the most luck with Mike's 2-wire
LCD interface (found in the PICList routine archive,
and also at http://www.rentron.com/Myke1.htm).  It
requires an extra chip (a simple flip-flop that can
be bought at radiohack for $1.29), but frees up a
bunch of pins.

-- Rob

--- David VanHorn <spam_OUTdvanhornTakeThisOuTspamCEDAR.NET> wrote:
{Quote hidden}

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35
a year!  http://personal.mail.yahoo.com/

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\02\13@082455 by Drew Vassallo

picon face
>You know, I've had the most luck with Mike's 2-wire
>LCD interface (found in the PICList routine archive,
>and also at http://www.rentron.com/Myke1.htm).  It
>requires an extra chip (a simple flip-flop that can
>be bought at radiohack for $1.29), but frees up a
>bunch of pins.

Me too, except there seems to be a slight error in his example code.  If you
exit the NybbleOut routine with the last DATA bit as a '1', it won't clear
the shift register on the next go-around, but instead load it with '1's.
You have to clear the DATA latch first before you run through that section
of the NybbleOut routine.

Of course, if it works with '1's, then why clear it at all and waste 31
instruction cycles to "clear" it?

--Andrew
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\02\13@091205 by Robert Shady

picon face
I'm not sure if I should really latch on to this
thread or not with my own problems, but they might
be related to what your seeing as well, so I'll
post what's happened to me so far...  Which is
REALLY bizarre..

*** WARNING -- THIS IS LONG! ***

I've taken Mike's 2wirelcd circuit and wired it
up, downloaded his 2wirelcd.asm code, compiled,
and ran -- It worked fine @ 4mhz as stated.

I need to be able to run it @ 20mhz, so I visited
the time delay code generator at:
http://www.piclist.com/cgi-bin/delay.exe
and generated a replacement 160usec delay and
5msec delay and put it in a file called delay20.inc
(thinking I can also make one called delay4.inc and
just change 1 line of the code to switch between
4mhz & 20mhz).  I switched everything to use the new
code and ran it @ 20mhz -- didn't work, tried it @
4mhz -- didn't work.

I revisited the delay code generator and generated
new 4mhz based delays for 160usec & 5msec and put
them in delay4.inc, compiled and ran @ 4mhz -- nothing.

Now here's the really funky part... I took the routines
out of delay4.inc and put them in the lcd.asm code
compiled and ran @ 4mhz -- worked perfectly.

So I took the routines out of delay20.inc and put them
in the lcd.asm code, compile & ran @ 20mhz -- nothing!

Any clue?  Why would the routines work when compiled
directly into the code, but not included?  Also, I
couldn't even get the circuit to work just by
interfacing directly with the PIC, I had to use Mike's
little flip-flop circuit for some reason... Timing
issues maybe?

Does anybody have 16F84 (actually 16F84A) code for
driving an LCD (preferrably with Mike's circuit, it's
nice only using 2 pins) running @ 20mhz?

-- Rob

{Quote hidden}

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35
a year!  http://personal.mail.yahoo.com/

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\02\13@094548 by James Paul

flavicon
face
Robert,

Did you set the oscillator for HS operation as opposed to XT when
you went to 20Mhz?  If not, the oscillator probably isn't starting
or running at 20Mhz.  Just a thought.

                                         Regards,

                                           Jim



On Tue, 13 February 2001, Robert Shady wrote:

{Quote hidden}

.....jimKILLspamspam.....jpes.com

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\02\13@102535 by Robert Shady

picon face
Yes, I did... I've already been bitten by that bug one
too many times.. But thanks!

-- Rob

--- James Paul <EraseMEjimspam_OUTspamTakeThisOuTJPES.COM> wrote:
{Quote hidden}

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35
a year!  http://personal.mail.yahoo.com/

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\02\13@111143 by Drew Vassallo

picon face
>Does anybody have 16F84 (actually 16F84A) code for
>driving an LCD (preferrably with Mike's circuit, it's
>nice only using 2 pins) running @ 20mhz?
>

From Myke's web page:

"The biggest issue to watch for is to make sure the "E" Strobe's timing is
within specification (ie greater than 450 nsecs), the shift register loads
can be interrupted without affecting the actual write. This circuit will not
work with Open-Drain only outputs (something that catches up many people)."

20MHz would violate this.  I would try adding two 'nop's in and around the E
strobe timing for your code.  This will at least bring it into spec.  Then
you can debug from there if it isn't working.

--Andrew

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\02\13@152044 by Robert Shady

picon face
BINGO!  I guess I really need to pay a little more
attention to those keywords...  Of course, being
new to PICS, that didn't mean anything to me the
first few times I read it (I had no idea how long
each instruction took).  4 nop's didn't work, but
a delay of 160us did work beautifully.. It's
overkill, but it works, I'm a happy camper...

Thank you all VERY much.  (BTW-I'm building webpages
with all of the questions/answers that I've needed
while learning, I'll post the address when I'm done
for all the newbies).

-- Rob

--- Drew Vassallo <KILLspamsnurpleKILLspamspamHOTMAIL.COM> wrote:
{Quote hidden}

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35
a year!  http://personal.mail.yahoo.com/

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\02\13@161828 by Drew Vassallo

picon face
>each instruction took).  4 nop's didn't work, but
>a delay of 160us did work beautifully.. It's
>overkill, but it works, I'm a happy camper...

Strange that the nops didn't work.  If the E strobe timing is indeed 450ns
min., it should have worked.  But 160us is absurdly high.  The beauty of
using assembly to begin with is being able to control timing and make the
code as efficient as possible.  I would try to keep adding nops until it
works, rather than jumping up to 160us.  By the way, why pick 160us anyways?

--Andrew
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\02\13@171621 by Robert Shady

picon face
I already had a 160us delay routine :)

-- Rob

--- Drew Vassallo <RemoveMEsnurpleTakeThisOuTspamHOTMAIL.COM> wrote:
{Quote hidden}

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35
a year!  http://personal.mail.yahoo.com/

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\02\13@172644 by Robert Shady

picon face
Okay.. I did some tinkering.. And FYI, the smallest
delay I was able to get it down to and still work
reliably was 7us (for whatever reason, perhaps because
I used a 74HCT174 instead of Mike's 74LS174)...
It worked at 6us, but not reliably (50-60% of the time).
7us works 100% of the time.

-- Rob

--- Drew Vassallo <spamBeGonesnurplespamBeGonespamHOTMAIL.COM> wrote:
{Quote hidden}

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35
a year!  http://personal.mail.yahoo.com/

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\02\13@181653 by Gennette, Bruce

flavicon
face
I found this too - on a 16F84 about 7us.
The E strobe timing is actually more like 500ns LO (from last HI), 500ns HI
plus 50ns for the lcd controller to react - a total of a little over 1us.
*BUT* capacitance in the average circuit board layout won't allow the
signals to rise and fall instantaneously - so in the real world we need ~6X
the theoretical time for reliable operation.

On my breadboard I routinely use 100us for E strobes in early development
and chop it down when the circuit is etched onto a board.

Bye.

       {Original Message removed}

2001\02\13@201144 by Drew Vassallo

picon face
>Okay.. I did some tinkering.. And FYI, the smallest
>delay I was able to get it down to and still work
>reliably was 7us (for whatever reason, perhaps because
>I used a 74HCT174 instead of Mike's 74LS174)...
>It worked at 6us, but not reliably (50-60% of the time).
>7us works 100% of the time.

Hah, it actually IS good to know... I forgot that I changed a program a few
months ago from 4MHz to 20MHz and it uses a 2-wire LCD interface.  I haven't
tried it yet.  And it wouldn't have worked, because, wouldn't you know it, I
*didn't* add the delays :)

I will do so post-haste.  Thanks for the info.

By the way, exactly where did you put the 7us delays in your code?

--Andrew
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\02\13@210145 by Ian Hynes

flavicon
face
David VanHorn wrote:
>
>
> You know the 44780 needs three wires, plus four for data, right?

Right.

XXX - Ian

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\02\13@221618 by Robert Shady

picon face
I put (for same measure) 7us delay before, between,
and after the E-Strobe...

7us delay
bsf PORTA,0
7us delay
bcf PORTA,0
7us delay

-- Rob

--- Drew Vassallo <TakeThisOuTsnurpleEraseMEspamspam_OUTHOTMAIL.COM> wrote:
{Quote hidden}

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35
a year!  http://personal.mail.yahoo.com/

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\02\13@230942 by Tony Nixon

flavicon
picon face
Robert Shady wrote:
>
> I put (for same measure) 7us delay before, between,
> and after the E-Strobe...
>
> 7us delay
> bsf PORTA,0
> 7us delay
> bcf PORTA,0
> 7us delay
>
> -- Rob

Possibly using

       movlw b'000xxxx1'  ;  don't know xxxx values
       movwf PORTA
       movlw b'000xxxx0'
       movwf PORTA

might have worked.

BSF type instructions one after the other may not work properly and are
not recommended.

Also, by using these instructions, the PIC may 'read' different bit
values to what the output latches are set to on RA4 - RA1, and in doing
so, may alter the value of these bits.

If these bits are also for controlling the LCD then it may cause
trouble.

--
Best regards

Tony

mICro's
http://www.picnpoke.com
RemoveMEsalesspamTakeThisOuTpicnpoke.com

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\02\14@154855 by Stein Sem-Jacobsen

picon face
When strobing the E pin on an LCD I just call this. Haven't had any trouble
with it so far.

x-tal 4.194304MHz
;--

transfer        bsf             E               ;Enable, transfer data.
               nop                             ;Wait till data is surely
               nop                             ;read into the LCD memory
               nop                             ; > 25s
               bcf             E               ;End datatransfer
               return


Regards
Stein Sem-Jacobsen

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservEraseMEspam.....mitvma.mit.edu with SET PICList DIGEST in the body


2001\02\14@165732 by Robert Shady

picon face
Right, but you'll also notice that the problem
hasn't been with the 4mhz crystals, it was with
the 20mhz crystal.  Try that @ 20mhz and you'll
get nowhere..

-- Rob

--- Stein Sem-Jacobsen <EraseMEssemjacospamONLINE.NO> wrote:
{Quote hidden}

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35
a year!  http://personal.mail.yahoo.com/

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email RemoveMElistservspam_OUTspamKILLspammitvma.mit.edu with SET PICList DIGEST in the body


2001\02\14@184133 by Ian Hynes

flavicon
face
PICers,

I fired up Myke Predko's 2 wire LCD programme on a protoboard assembly
this morning.

Result : works fine!

I used an 74HC174 and made a few minor mods to run it on a 16F84 (not
'C84) at 2.0MHz.
What I'll do is graft Myke's routine onto the KPD & LED routines and
let you know how that goes. Will probably post the working (hope?)
programme directly. Cool one, Myke, if you're reading this.`

Guess the ol'3 wire LCD interface just wasn't meant to be ....   :(

Regards - Ian

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email RemoveMElistservTakeThisOuTspamspammitvma.mit.edu with SET PICList DIGEST in the body


2001\02\15@085723 by Thomas McGahee

flavicon
face
I hate wasting code space with multiple NOP instructions.
You can get the equivalent delay of several NOP instructions
by doing a CALL to any RETURN instruction. You do have to
make sure the CALL doesn't cause any problems due to
pushing too many return addresses on the stack, of course,
but that is rarely a problem. I just add a label <RETN>
to an existing RETURN. Executing a CALL RETN will waste
4 cycles for the CALL and eventual RETURN, giving us
the desired delay time, and the program overhead is only
ONE instruction. A variation on this is to have some routine
end with something we can use to generate several different
delays, depending on which label we CALL:

...
...                  ;place the following at the end of an
...                  ; existing called subroutine.
DELAY10  GOTO DELAY8 ;GOTO results in 2 cycle delay
DELAY8   GOTO DELAY6
DELAY6   NOP         ;NOPs are 1 cycle delay
DELAY5   NOP
RETN     RETURN      ;CALL+RETURN is equal to 4 NOPs

Techniques such as these can be useful when you absolutely
have to squeeze a few more bytes into the program space.

Note also that already existing subroutines may end with
some inocuous code, and you may be able to do a CALL to
the near end of that code to generate some extra delay.
Sometimes when I need a delay that does not have to be
exact, I will do something like call an existing subroutine
that does something that does not disturb what I am doing,
but wastes time.

Fr. Tom McGahee


{Original Message removed}

More... (looser matching)
- Last day of these posts
- In 2001 , 2002 only
- Today
- New search...