Searching \ for '[PIC]: Problems using a 1x8 chars LCD' 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: 'Problems using a 1x8 chars LCD'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: Problems using a 1x8 chars LCD'
2001\01\10@121826 by Andreas Eriksson

flavicon
face
Hi, i've just start programming for the pic and the first real "project" for me was to get a LCD working, after some reading I found that the HD44780 controlled ones was easy to use and common. The code i've made works fine now except for one thing, when printing some text on the LCD i ALWAYS get a weird character(seems to be char code: 10110101) and even when i do a display clear or cursor home i cant get to the first position of the LCD. Is my code wrong or have you experienced this on your own?

Heres the put command function(using portb as lcd_data):

putcmd_start
putcmd
movwf lcd_cmd ; the command is in W, just save it

bcf LCD_CTRL, LCD_RW ; setup for command recieve
bcf LCD_CTRL, LCD_RS
bsf LCD_CTRL, LCD_E

movf lcd_cmd, 0
movwf LCD_DATA
nop ; pulse must be wider than 450ns, is not necessary for fast clocks

bcf LCD_CTRL, LCD_E    
return
putcmd_end


Thanks!
Andreas Eriksson
SWEDEN

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


2001\01\10@122852 by riones Sistemas de Pesaje

flavicon
face
Andreas

1)For written ascii characters in LCD module you must be check the status
flag of the driver register begin that send other ascii caracter

2)check the initial configuration of LCD module

Regards

Francisco
{Original Message removed}

2001\01\10@131036 by Oliver Broad

flavicon
face
I'd send the data before raising E, it doesn't do any harm.

Also on prototype jigs cable length can be a big problem, it's dependant on
how many bits of the output change state at once.

Oliver.

{Original Message removed}

2001\01\10@131857 by Drew Vassallo

picon face
>text on the LCD i ALWAYS get a weird character(seems to be char code:
> >10110101) and even when i do a display clear or cursor home i cant get
> >to the first position of the LCD. Is my code wrong or have you
> >experienced this on your own?

Exactly WHERE is this character appearing?  In the middle of your display?
Before the first desired character is written?  At the end of the message?
I'll assume it's at the beginning of your message.

You have to ensure that the "E" bit is clear before you begin writing.  I
can't be sure that it is from the code you submitted.  If it isn't, then
your command line would not be sent until it's toggled again, which would be
the next character.  This would make your first character/command garbage.
Try:

bcf LCD_CTRL, LCD_E

{Quote hidden}

Looks like you're using Peter Ouwehand's routines.  Never used them myself,
but I assume they'd work.  Note that in his routines, he calls LCDBUSY
*before* he tries to write to the display.  This routine automatically
leaves the "E" bit clear.

If you still have problems, maybe you could check directly with him about
them?

--Andrew


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

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


2001\01\10@133745 by Andreas Eriksson

flavicon
face
Hi again, and thanks for your rapid reply


>>text on the LCD i ALWAYS get a weird character(seems to be char code:
>> >10110101) and even when i do a display clear or cursor home i cant get
>> >to the first position of the LCD. Is my code wrong or have you
>> >experienced this on your own?
>
>Exactly WHERE is this character appearing?  In the middle of your display?
>Before the first desired character is written?  At the end of the message?
>I'll assume it's at the beginning of your message.


Sorry, its in the beginning yes...

>
>You have to ensure that the "E" bit is clear before you begin writing.  I
>can't be sure that it is from the code you submitted.  If it isn't, then
>your command line would not be sent until it's toggled again, which would be
>the next character.  This would make your first character/command garbage.
>Try:
>


I can submit the whole code if thats better?
The LCD_E bit isnt set, its cleared from the very beginning of the program

{Quote hidden}

Who is Peter Ouwehand? :-)

{Quote hidden}

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


2001\01\10@134537 by David VanHorn

flavicon
face
>
> >>  movwf lcd_cmd ; the command is in W, just save it
> >>  bcf LCD_CTRL, LCD_RW ; setup for command recieve
> >>  bcf LCD_CTRL, LCD_RS
> >>  bsf LCD_CTRL, LCD_E

Dosen't this require NOPs between the instructions, to get around the
read-modify-write "feature"?

--
Where's dave? http://www.findu.com/cgi-bin/find.cgi?kc6ete-9

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


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