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

Exact match. Not showing close matches.
PICList Thread
'[pic]: LCD mystery'
2001\04\12@144755 by -8859-1?q?Robert=20Sochon?=

flavicon
face
part 1 889 bytes content-type:text/plain; charset=iso-8859-1 (unknown type 8bit not decoded)

I have some code for 4 bit data transfer from Myke
predko - its good code - ive got the delays right ( i
think) but every time i turn the circuit on the
display shows a different set of characters everry
time.... nothing logical either just a set of junk!

Any ideas?

its menat to say hello world and occassionally shows
the right number of characters.... but not always!  -
no bust jumpers either


Does anyone have a truly  bullet proff complete 4 bit
routine? that doesnt use the busy flag...!

THanks for all the help already - im slowly gettiong
there - uphil struggle :)

Cheers

robert

ps attached is asm file if anyone wants a look!

____________________________________________________________
Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie

part 2 2600 bytes content-type:application/x-unknown-content-type-asm_auto_file; name="lcd3.asm" (decode)

part 3 154 bytes
--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\04\12@154137 by Nicholas Irias

flavicon
face
If the character count is always correct, but the characters are jibberish,
you might want to double check the code you use to get the two 4-bit nibbles
onto the I/O pins.  Are you sending the nibbles in the correct order, and
are you sure that the two nibbles are actually the upper and lower 4-bits of
the byte you wish to display?

The first time I got an LCD working, I had lots of trouble that I traced to
improper bit-shifting.

{Original Message removed}

2001\04\12@160127 by O'Reilly John E NORC

flavicon
face
I saw something right after the label SendPSTRLoop:.   You have a CALL MSG
line there, but MSG is only defined as a variable.  When I ran your code in
MPLAB, the next instruction to execute is the third line after start, or
0x011 in ROM.  Then, when it gets to the delay routine, I get a stack
overlow.

John

{Original Message removed}

2001\04\12@224819 by myke predko

flavicon
face
Hi Robert,

A few comments after looking at your code:

1.  What is the speed the PICmicro is running at?  I'm asking this for the
time delays.  It's not obvious in your code as to how it works.

2.  How did you wire up the PICmicro to the LCD?  I have an idea based on
your code, but I wanted to understand from you how you did it.  What are you
using for a shift register?  From your code, it looks like the serial data
is latched on the falling edge of the clock.

3.  The big problem that I see in your code is that in your variable
declarations, you declare the memory location "MSG".  Your "Main" code is:

{Quote hidden}

Which looks okay...

But when I look at "SendPSTR", you are calling "MSG":

{Quote hidden}

which is a BIG problem - and probably the one that you are having.

I think in your code, the "call MSG" instruction should actually be "call
HelloWorld" and after "Main", you can delete the " movlw HelloWorld"/"movwf
MSG" instructions from the code.


Let me know if this gets you any closer,

myke

{Original Message removed}

2001\04\13@012751 by Jason Harper

picon face
Robert Sochon <spam_OUTgoatpicsTakeThisOuTspamYAHOO.CO.UK> wrote:
> I have some code for 4 bit data transfer from Myke
> predko - its good code - ive got the delays right ( i
> think) but every time i turn the circuit on the
> display shows a different set of characters everry
> time.... nothing logical either just a set of junk!

In addition to the problems others have mentioned:

1.  You're doing successive BSF/BCF operations to different bits in the
same port, for example in LNLoop.  This DOESN'T WORK RELIABLY, see past
PICLIST messages or your PIC's data sheet for details.  Put at least one
NOP between such operations.  You'll also need to add a NOP between the BSF
and BCF of the LCD's E pin if you're running much faster than 4MHz, to meet
its timing spec.

2. You aren't waiting any additional time after sending the 0x01 (clear
display) command - that's one of the few that takes more than the minimum
time.  This has no effect now, since your Dlay160 routine is simply falling
through into Dlay5ms, which is sufficient for this command.  However, once
you get the delays down to their proper amount, you would find that some of
your commands and text that follow the clear command get lost.
       Jason Harper

--
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\04\13@090727 by Olin Lathrop

face picon face
> 1.  You're doing successive BSF/BCF operations to different bits in the
> same port, for example in LNLoop.  This DOESN'T WORK RELIABLY, see past
> PICLIST messages or your PIC's data sheet for details.  Put at least one
> NOP between such operations.

I don't see anything wrong with successive BSF/BCF assuming you want the bit
to be 1 for one instruction time.  There are two issues with using these
instruction on I/O ports, although neither effects the case you mentioned.

1 - The bit instructions really do a read/modify/write on the whole byte.
This means the 7 bits that are not addressed by the BSF or BCF are written
to the output latches the way they were read in.  This can cause two
potential problems.  The first occurs if the bit is an output.  If the
external circuit held the PIC pin the opposite state it was being driven,
then it will now be driven by the PIC to that state also.  Second, if the
bit is an input then the output latch essentially gets set to an unknown
value.  This could cause unexpected results if the bit is switched back to
being an output and the new unknown state of the output latch is not taken
into account.

2 - Inputs are latched at the beginning of a cycle and output are latched at
the end of the cycle.  You therefore can't write a bit value one cycle, then
read a different bit that the external circuit was supposed to drive in
response on the next cycle.  In that case you need to insert one NOP for
each instruction time you want the external circuit to have before reading
its response.



********************************************************************
Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014, .....olinKILLspamspam@spam@embedinc.com, http://www.embedinc.com

--
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


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