Can HD44780 Module(GHI) address only two rows?

Hi,
I received my GHI parcel form USA today . It works fine on the standard 16x2 char Display, and even drives the top two rows of my MatrixOrbital 20x4 DIsplay.
It drives all 20 columns, but the bottom two rows dont seem to work…
Is this easily explained ?

I use the FEZ Spider for this…

Thanks

Bert

oops… i wrote that my parcel came today… but I neglected to say that it was the HD44780 module that i was having a question about. maybe you saw the title and gathered this allready…
Bert

Get the driver code from Codeplexfor that module and compare commands used with the datasheet of your 20x4 display. There might be a slight difference in commands or something like that.

That would be my first step to troubleshoot it.

We have a display like that here somewhere. Let me see if I can find it real quick and I’ll look into it.

From what I remember, you need to send a different initialization command to the display controller in order to use 4 rows. Don’t known if that is available in the driver you are using.

Simply, all these displays have RAM to represent the characters, the lines are just a memory address in that RAM.

And I believe that the line order in memory is usually 0,2,1,3.

Hi,
I had the same issue 2 days ago.
Change the SetCursor to this

        public virtual void SetCursor(byte row, byte col)
        {
          byte[] row_offsets =  new byte[4] { 0x00, 0x40, 0x14, 0x54 };          
          SendCmd((byte)(SET_CURSOR | row_offsets[row] | col));
        }

and it will work fine for both 2- and 4-line displays.

Thanks for sharing. We will test this and add to the official driver.

And welcome to the community.

Hi Robert, glad to see you here :wink:

Hi Eric,
This certainly feels like is a warm welcome - I think I’ll stick around :wink:

What a quick Solution… Thanks All
(especially Roberto)
I got it working (as you can see in my image)… but as quite a novice, it took some
figuring to get it going…
(And from what type of questions i read on fora, im not even that much of a starter)
so maybe someone else stumbles onto this thread and these steps i figured our will help.

  1. first i had to figure out WHERE to find the SetCursor function…
    (i gathered it had to be in the 44780 DLL, but you cant access the function in the dll ofcourse.
    so after some searching i found the source (cs) files…
    http://www.codeplex.com/site/users/view/steven_ghielec
  2. OK finding the cs file and changing (and testing) the changed function was not hard to do
  3. Then i had to get a DLL … (googling the Howto on that was quite simple) :
    ( i Built the project and copied the files from the BIN\Debug directory in the project, to the source directory for Gadgeteer DLL.s
    ( C:\Program Files (x86)\GHI Electronics\GHI .NET Gadgeteer SDK\Modules\Display_HD44780) in my case.
  4. tested it in my program…
    SUCCESS…

Once again Thanks… Up to the next project…

Be aware that right code for me is:



        public virtual void SetCursor(byte row, byte col)
        {
          byte[] row_offsets =  new byte[4] { 0x00, 0x40, 0x14, 0x54 };          
          SendCmd((byte)(SET_CURSOR | (row_offsets[row] + col)));
        }

It’s offset + column, not or, at least for my LCD 4x20
Hope this can help …

I suggest you make the row offset array a static class variable. it will stop a lot of garbage collection.

1 Like

You might also want to check that row < row_offsets.Length in the first line of the method and either throw an exception or default to the first row depending on your needs. Otherwise you risk getting a IndexOutOfRangeException when you try to index the array.