Controlling HD44780 as a character device?

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Hello,

beeing a Linux guy for nearly two decades now, I wonder why all the
suggestions for controlling a HD44780 from a Raspberry Pi will use
direct GPIO (or I2C) access from userland?

Despite the fact, that these HD44780 displays are basically terminal devices
(like VT100) thus would need a character device driver to be able to
control them in the unix way.

It would then be possible to control them using a termcap/terminfo
entry and the ordinary ncurses library for access.

Could it be true, that nothing like this is available for such common
stuff than HD44780 compatible displays?

Sven

--  
.. this message has been created using an outdated OS (UNIX-like) with an  
outdated mail- or newsreader (text-only) :-P

We've slightly trimmed the long signature. Click to see the full one.
Re: Controlling HD44780 as a character device?
Quoted text here. Click to load it

Because there is no other easy way...

Quoted text here. Click to load it

Please feel free to write it and contribute it to the kernel...

Quoted text here. Click to load it

Yes, once a suitable driver has been written.

Quoted text here. Click to load it

The closest I found was the lcd4linux project, but even then I don't think
they provide a standard character device for controlling them in the "normal"
way...

I wrote:

  http://wiringpi.com/dev-lib/lcd-library/

Gordon

Re: Controlling HD44780 as a character device?

Quoted text here. Click to load it

There is http://lcd-linux.sourceforge.net/

But this is old code without GPIO support.

I also think, that this misses the target anyway.

A VT10x translation layer is IMO not something which should be done inside
a kernel driver.

What would be needed instead is a simple character driver and an appropriate
terminfo file.

I found this post:
https://forum.openwrt.org/viewtopic.php?id16%007

But unfortunately the URL pointing to the code is unavailable.

Regards

Sven

--  
"Whenever there is a conflict between human rights and property
rights, human rights must prevail." (Abraham Lincoln)

We've slightly trimmed the long signature. Click to see the full one.
Re: Controlling HD44780 as a character device?
Quoted text here. Click to load it

Is this it?

http://sourceforge.net/p/linux-adm5120/code/HEAD/tree/OpenWrt/hd44780/src/


--  
Ian

"Tamahome!!!" - "Miaka!!!"

Re: Controlling HD44780 as a character device?

Quoted text here. Click to load it

Jepp, looks fine.

Using a slightely modified Makefile and it will compile out of the box using
a recent kernel. Seems to be a start!

I will see what I can do as soon as I got my LCD Hardware.

I would at least want to add a modification which will allow for the gpio
ports in use to be specified at module load time.

Regards

Sven

--  
TCP/IP: telecommunication protocol for imbibing pilsners
                                 (Man-page uubp(1C) on Debian/GNU Linux)

We've slightly trimmed the long signature. Click to see the full one.
Re: Controlling HD44780 as a character device?
snipped-for-privacy@fuchsschwanzdomain.de says...
Quoted text here. Click to load it

As well as 4 or 8 bit mode?

Quoted text here. Click to load it



--  
Paul Carpenter          | snipped-for-privacy@pcserviceselectronics.co.uk
<http://www.pcserviceselectronics.co.uk/ PC Services
We've slightly trimmed the long signature. Click to see the full one.
Re: Controlling HD44780 as a character device?

Quoted text here. Click to load it

Sources look like 4-Bit Mode (7 GPIO lines):
http://sourceforge.net/p/linux-adm5120/code/HEAD/tree/OpenWrt/hd44780/src/hd44780.c

I would rather think about implementing I2C Mode first.

Regards

Sven

--  
"Those who do not understand Unix are condemned to reinvent it, poorly"
(Henry Spencer)

We've slightly trimmed the long signature. Click to see the full one.
Re: Controlling HD44780 as a character device?
Quoted text here. Click to load it

Only if you have an I2C device - and there are more variants of I2C
connections to HD44780 than there are of direct connections - e.g. which
I2C GPIO expansion chip, or microcontroller or .... etc.

So unless you have a specific device and I2C interface, I'd personally
go for the GPIO way first.

And you only need 6 lines - especially with 5v displays connected to the
Pi's 3.3v lines - the R/W line must be tied to the 0v line (so display is
permanently in read mode) unless you use level shifters or a 3.3v display.

But I have to say... Watching people build kernel modules for other
things for the Pi; is it worth it? If it's a personal project, then
of-course it is, but for general use - it can be somewhat challenging to
get some Pi users to compile a module for whatever kernel they're using,
then install it and use it... Maybe easier to just use one of the libraries
for C/C++, Python, etc.

Gordon

Re: Controlling HD44780 as a character device?
On Wed, 18 Sep 2013 18:38:16 +0000, Gordon Henderson wrote:

Quoted text here. Click to load it
Wouldn't the Raspbian project be happy to include a driver that supported  
the HD44780 and related displays as part of the distro? Especially if it  
came with a configuration utility like Sven mentioned? It would be really  
neat if it was similar to the setserial and stty utilities which, IIRC,  
work by setting parameters in the device file.


--  
martin@   | Martin Gregorie
gregorie. | Essex, UK
We've slightly trimmed the long signature. Click to see the full one.
Re: Controlling HD44780 as a character device?
Quoted text here. Click to load it

Ask them...

But this is really a Linux kernel thing, so if you presented it as a
pre-done kernel module and had it inserted into the mainline kernel,
then it stands more of a chance than a Pi specific thing - especially
as there are Linux systems other than the Pi that might benefit from it
e.g. Beaglebone people might find it interesting too, etc.

Gordon

Re: Controlling HD44780 as a character device?
On Thu, 19 Sep 2013 13:02:38 +0000, Gordon Henderson wrote:

Quoted text here. Click to load it
Good point: However, I don't (yet) need an HD447800 or equivalent. When I  
do, I'll want something like the display used in the device formerly  
known as the Squeezebox Touch (which looks like a 4.2 LED panel) or  
(slaver, slobber) a 4.2" or 5" eInk display - either mono or colour would  
do nicely.  

I was really hinting that Sven might like to work on writing a driver  
that appears as a device file in a similar fashion to the serial drivers  
and that, like them, can be configured by a utility program that sets  
parameters in the device file.  


--  
martin@   | Martin Gregorie
gregorie. | Essex, UK
We've slightly trimmed the long signature. Click to see the full one.
Re: Controlling HD44780 as a character device?

Quoted text here. Click to load it

Bit Banging GPIO's is just anything but elegant. All I want to
achieve is beeing able to write Software using standard libraries
like ncurses and generic terminal IO instead of highly non-portable
stuff.

Sven

--  
Why are there so many Unix-haters-handbooks and not even one
Microsoft-Windows-haters handbook?
We've slightly trimmed the long signature. Click to see the full one.
Re: Controlling HD44780 as a character device?
Quoted text here. Click to load it

In Linux you can write a program that runs in a user process and
does all the terminal simulation that you want, plus the translation
to bitbanging, and then you can connect it via a "pty" to another
program that thinks that it is talking to a tty.  So it can use
ncurses etc.

When you want to see an example of what is possible, look at the
"screen" program.  It provides a virtual terminal for all standard
programs (including ncurses programs) to write on, and that
virtual terminal can then be connected from another system.

You could adapt it (or write some similar program) to send output
to your LCD instead.  Once you have done that you can run any
program with output to your LCD.

Re: Controlling HD44780 as a character device?
Quoted text here. Click to load it

I was wondering pretty much the same thing.  What's wrong with a
user-mode app taking input from a named pipe, or if it really must
be a terminal a pty?  No need at all for kernel programming with
all the hassle that imposes.

--  
Andrew Smallshaw
snipped-for-privacy@sdf.lonestar.org

Re: Controlling HD44780 as a character device?
Quoted text here. Click to load it

Yet we have that on the linux console....  

Quoted text here. Click to load it

you probably want an IOCTL interface for programming the the user-defined  
characters too.

--  
?? 100% natural

Re: Controlling HD44780 as a character device?
Quoted text here. Click to load it

HD44780 has a parallell interface, none of the rpi GPIO is well suited.
Is there a USB interface available?
maybe start with AVRUSB or an FT-something

--  
?? 100% natural

Re: Controlling HD44780 as a character device?
Quoted text here. Click to load it

Why do you think that?

The Pi is perfectly suited for it. 6 wires plus power & ground and off
you go. It's not rocket science.

http://wiringpi.com/dev-lib/lcd-library/

It's the sort of thing the Pi's GPIO was designed to do.

Gordon

Re: Controlling HD44780 as a character device?
On 9/19/2013 7:04 AM, Gordon Henderson wrote:
Quoted text here. Click to load it

The rpi is a 3.3V device and the HD44780 is a 5V device.
Yes, this is rocket science for most desk top people.

As long as the wires between the rpi and the HD44780 is only 3-4 inches  
long there _may_ not be any problems.


Quoted text here. Click to load it


Re: Controlling HD44780 as a character device?
On 19/09/13 14:12, hamilton wrote:
Quoted text here. Click to load it

Mmm.
the spec sheet says it is CMOS with a  minimum vcc of 1.5V, and a max of  
7v, so it is not a '5V device' specifically

Input specs are less than 0.6V and greater than 2.2V to guarantee logic  
transitions. At Vcc 4.5-5.5V.

So it will run well within spec drven  by a 0-3,3v signal.


Quoted text here. Click to load it


--  
Ineptocracy

(in-ep-toc?-ra-cy) ? a system of government where the least capable to lead are elected by the least capable of producing, and where the members of society least likely to sustain themselves or succeed, are rewarded with goods and services paid for by the confiscated wealth of a diminishing number of producers.


Re: Controlling HD44780 as a character device?
El 19/09/2013 18:44, The Natural Philosopher escribió:
Quoted text here. Click to load it

The HD44780 will do, the LCD may not.


--  
Saludos
Miguel Giménez

Site Timeline