LCDproc development and user support list

Text archives Help


[Lcdproc] I2c HD44780 patch to read pin config from LCDd.conf


Chronological Thread 
  • From: github at wilberforce.co.nz (Wilberforce)
  • Subject: [Lcdproc] I2c HD44780 patch to read pin config from LCDd.conf
  • Date: Sun, 16 Aug 2015 11:14:29 +1200


>>>
-------
Hi, Rhys, I haven't done anything with i2c-interfaced LCDs (just serial, USB,
and direct/parallel-I/O) so please excuse what could be an obvious question,
but why a hex bitmap for specifying the lines? Is this creating a pinmap for
8-bits of a specific I/O expander chip? Is this a new thing or are you
extending an existing mechanism? If it's just a pinmap, why add complexity
here when it's rather normal for LCDproc to say "wire your LCD with *this*
specific pinout" rather than "wire it any way you want and tell the Config
file how you wired it"? I don't see a problem telling the user that they have
to put the data lines adjacent and in the upper (or lower) 4 bits, for
example. Yes, software can adapt to any hardware configuration, but I'm
questioning the tradeoff of flexibility vs complexity. When we were wiring
LCDs to parallel ports, there were a few specific documented pinouts (more
than their should have been, IIRC, because of people reinventing the wheel,
but that's another problem). We certainly weren't so flexible as to allow
random wiring that was matched up in software, which is what this looks like
to me. -ethan
-----
Hi Ethan,

The benefit of using the i2c interface is that it uses only 4 pins, 3.3v,
gnd, sda, sdl.

A number of different manufacturers produce piggyback i2c boards that put a
i2c port expander designed to go into the back of a 1602 Lcd module.

Here are 2 examples:

http://www.dfrobot.com/index.php?route=product/product&product_id=593#.Vc-tf4rvmJI
http://dx.com/p/lcd1602-adapter-board-w-iic-i2c-interface-black-works-with-official-arduino-boards-216865

The problem is there is no "standard way" to wire the boards. Some have the
d4-d7 on the upper nibble, other boards on the lower. Sometime the EN or RS
lines are on different pins.

The other issue is that the backlight logic level is wired opposite.

It does not make sense to take an off the module, and physically re-wire it
the "lcdproc i2c way".

At present, if someone wants to use one of these boards, they have to
download, modify and recompile the source. This is a huge barrier for some
people.
This patch allows the driver to be configurable, allowing the board to be
used by changing confit rather than recompiling.

>why a hex bitmap for specifying the lines? Is this creating a pinmap for
>8-bits of a specific I/O expander chip? Is this a new thing or are you
>extending an existing mechanism.
The existing i2c code defines these pins as #defines. I have extended the
config file to allow these to be defined at run time.
The ftdi driver allows a similar mechanism, and so do the gpio drivers.
Cheers
Rhys



Cheers Rhys


> On 15/08/2015, at 4:07 pm, "github at wilberforce.co.nz" <github at
> wilberforce.co.nz> wrote:
>
> Hi,
> Update to lcdproc i2c to allow the pin configurations to be specified via
> LCDd.conf.
>
> Please find attached 3 patch files.
>
> I have also put up on github:
> https://github.com/wilberforce/lcdproc
>
> here is an example config:
> ## Hitachi HD44780 driver ##
> [HD44780]
> ConnectionType=i2c
> Device=/dev/i2c-pi
> Port=0x27
> Backlight=yes
> Size=20x4
> DelayBus=false
> DelayMult=1
> Keypad=no
> Speed=0
> i2c_line_RS=0x01
> i2c_line_RW=0x02
> i2c_line_EN=0x04
> i2c_line_BL=0x80
> i2c_line_D4=0x10
> i2c_line_D5=0x20
> i2c_line_D6=0x40
> i2c_line_D7=0x80
> Backlight=yes
> BacklightInvert=yes
>
> Thanks
> Rhys
>
> <hd44780-i2c.c.patch>
> <hd44780-low.h.patch>
> <hd44780.docbook.patch>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.omnipotent.net/pipermail/lcdproc/attachments/20150816/fe4da41d/attachment.html>




Archive powered by MHonArc 2.6.18.

Top of page