Optrex 4x20 LCD witch HD44780 controller

General discussion on mikroC.
Post Reply
Author
Message
murta
Posts: 41
Joined: 16 May 2005 23:39
Location: Sweden
Contact:

Optrex 4x20 LCD witch HD44780 controller

#1 Post by murta » 05 Jun 2005 13:21

Why can`t I get the LCD to print text on row 2 and 4 ?? I use a 8-bit interface and it works just fine to row 1 and 3. When I try to put 20 characters on row 2 or 4 they show up on the 5 left most positions on row 1?? Is ther a problem with the LCD8 code?

pizon
mikroElektronika team
Posts: 823
Joined: 11 Oct 2004 08:53

Re: Optrex 4x20 LCD witch HD44780 controller

#2 Post by pizon » 07 Jun 2005 09:25

murta wrote:Is ther a problem with the LCD8 code?
Not exactly. All 2-row LCDs have the same start-of-row character addresses, while 4-row LCDs often do this 'on their own', based on the manufacturer and model. Therefore you'll have to do some experimenting, to determine where is the start-of-row, for each row on your LCD.
pizon

murta
Posts: 41
Joined: 16 May 2005 23:39
Location: Sweden
Contact:

#3 Post by murta » 08 Jun 2005 00:10

ok... I have just read the datasheet for the display and it doesn´t say anything about start-of-row addresses, but then again I´m not that technical :lol: . What I can see is that there are more curcuits on the back of the display than on a similar display with 16x2 characters. Both have HD44780 controllers. Maybe thats why it doesn´t work. On my display the extra IC components says OKI 5259.

LGR
Posts: 3204
Joined: 23 Sep 2004 20:07

#4 Post by LGR » 08 Jun 2005 03:11

I think that what pizon was trying to tell you is that you are going to have to determine by trial-and error.
If you know what you're doing, you're not learning anything.

pizon
mikroElektronika team
Posts: 823
Joined: 11 Oct 2004 08:53

#5 Post by pizon » 08 Jun 2005 08:52

LGR wrote:I think that what pizon was trying to tell you is that you are going to have to determine by trial-and error.
Yap, that's how we did it for the 4x20 LCD that we have here (Xiamen) :roll:.
pizon

murta
Posts: 41
Joined: 16 May 2005 23:39
Location: Sweden
Contact:

#6 Post by murta » 09 Jun 2005 17:48

So in theory to access the 2:nd row 1:st column, I might have to write LCD8_out(2 , 30 , text) or something ? :roll:

LGR
Posts: 3204
Joined: 23 Sep 2004 20:07

#7 Post by LGR » 09 Jun 2005 18:12

murta wrote:So in theory to access the 2:nd row 1:st column, I might have to write LCD8_out(2 , 30 , text) or something ? :roll:
Sometimes it's easier to just go try something than asking a lot of questions and spending a lot of time thinking about it :roll: Construct an experiment, and then see what works.
If you know what you're doing, you're not learning anything.

murta
Posts: 41
Joined: 16 May 2005 23:39
Location: Sweden
Contact:

#8 Post by murta » 10 Jun 2005 01:24

I´m working on it :D ...

MattH
Posts: 173
Joined: 09 Jan 2005 03:55
Location: Allentown,PA

#9 Post by MattH » 10 Jun 2005 12:38

Some OPTREX LCD's filling the character memory in the order:
line 1, line 3 following line 2, line 4.

line 1 start address: 0
line 3 start address: 20
line 2 start address: 40
line 4 start address: 60
Don't code after midnight...

murta
Posts: 41
Joined: 16 May 2005 23:39
Location: Sweden
Contact:

#10 Post by murta » 10 Jun 2005 15:29

ok.. thx for the information. I tried to write to row 1 col 21 and that works just fine. The text prints out on row 3, so far so good. But when I try to write to row 1 col 41 it doesn´t display anything and not to r1 c61 either. I´m beginning to think that there might be someting wrong with my display and I will swap the display for another 4x20 and see if that works better.

gambrose
Posts: 369
Joined: 28 Sep 2004 17:34
Location: uk

#11 Post by gambrose » 10 Jun 2005 16:56

In stead of using LCD_Out functions and having to use workaround line numbers why not use LCD_Cmd function and set the cursor position your self

look at the help file at the constants section so see what i mean there are constants for LCD_LINE_ONE etc. you could just use your own constants.
Graham Ambrose

LGR
Posts: 3204
Joined: 23 Sep 2004 20:07

#12 Post by LGR » 08 Jul 2005 01:10

For what it's worth, I just acquired a lot of Optrex DMC-20481 4x20 LCDs, and plugged one in to the easyPIC (4-bit interface), and it works fine on all lines. Too easy.
If you know what you're doing, you're not learning anything.

Post Reply

Return to “mikroC General”