xpcc icon indicating copy to clipboard operation
xpcc copied to clipboard

HD44780 address calculation error for some displays

Open Sh4rK opened this issue 7 years ago • 1 comments

Hi!

We are using a HD44780 compatible display in our project. It is a 4x16 display, marked "1604A". We found out that the current address computation is not correct for this display. The correct line addresses are: 0x00, 0x40, 0x10, 0x50. I made a quick patch to make this display work, but it breaks current functionality: https://github.com/Sh4rK/xpcc/commit/52998df0f776caf3d9e83c4a26e10f8b317c422a.

Unfortunately I don't have any other displays to test, and I have no experience with them, so I don't know how to write a generic solution that works with everything, or even if it's possible. Maybe the only way would be to take some additional parameter(s) that describe the address calculation.

Sh4rK avatar Jan 31 '18 23:01 Sh4rK

Hm, in that case I would suggest wrapping the address calculation into a (stateless) function and passing that into the constructor and default it with the current implementation. That would be backwards compatible and you can add yours. Alternatively as a template argument, but that’s a bit verbose.

I think I have some hd44780 displays lying around, I’ll give this a try. The calculation may only haven been tested on dual displays /o\

salkinium avatar Feb 01 '18 02:02 salkinium