Driver update for HD44780 module

I would like to suggest updating Gadgeteer driver for HD44780 module. As we know, next SDK will include all obsolete modules, so I guess it is a right time to make a revision/update.

My suggestions:

  • Change module’s image to actual image, now it is using Character Display module image and hence is confusing
  • Change module name so that it does not include underscore (just like all other module names)
  • Change method names so that they match Character Display module names:
    o [em]PrintString[/em] to [em]Print(string)[/em]
    o [em]Putc[/em] to [em]Print(char)[/em]
    o [em]SetCursor[/em] to [em]SetCursorPosition[/em]
    o [em]SetBacklight[/em] to [em]BacklightEnabled[/em]

@ iamin - The driver for the HD44780 in the coming SDK is actually identical to the CharacterDisplay one, except for the name. The 4.2 driver will not be updated, just like all 4.2 drivers.

The image will be updated to reflect the correct module shortly, but the code is already up on git.

I took its source code from gadgeteer.codeplex.com. You are not going to push updates for codeplex?

I have looked at the source code in bitbucket (I guess that’s what you was referring to): [em]Gadgeteer / Modules / GHIElectronics / HD44780 / HD44780_43 / HD44780_43.cs[/em]

Yes, you are right - code is identical to CharacterDisplay, but that is not good. That code limits display to be max of 2 rows and 16 symbols per row.

Could you please remove the following parts to make this driver more universal?

this.SetCursorPosition((this.currentRow + 1) % 2, 0);

if (column > 15 || column < 0) throw new System.ArgumentOutOfRangeException("column", "column must be between 0 and 15.");
if (row > 1 || row < 0) throw new System.ArgumentOutOfRangeException("row", "row must be between 0 and 1.");

@ iamin - We no longer update the CodePlex repository. Regretfully, as the HD44780 is discontinued, it is unlikely we will do any changes to the driver. Even though removing those three lines is itself simple, we need to test it and look into alternate ways of guarding the draw area.

You was not guarding the draw area in your previous version of driver: http://gadgeteer.codeplex.com/SourceControl/latest#Main/Modules/GHIElectronics/Display_HD44780/Software/Display_HD44780/Display_HD44780_43/Display_HD44780_43.cs

You could just copy pate the old code and rename a few methods.

In the description of HD44780 module (https://www.ghielectronics.com/catalog/product/358) you mention compatibility with 20x4 character displays (that’s the one I have right now), but your driver will not work with those displays.

1 Like

@ iamin - The CodePlex driver has been out of date for around a year now. While the driver should support 20x4 displays, the module is discontinued so we no longer actively work on the driver. You are always able to modify the driver yourself.

Yes, I am :slight_smile: but not everybody can or is willing to.

If someone is interested, I have fixed all my listed issues in this driver and I have uploaded it here: https://www.ghielectronics.com/community/codeshare/entry/990

2 Likes

I think you forgot to fix Orientation, it should be 90.

@ iamin - Thanks, fixed