Go Down

Topic: Project IOlcd, lcd controled through a IOexpander(in this case a MCP23016) (Read 2550 times) previous topic - next topic

duality

Hi all,
thought I might share my project with the world, and with you all,
since this is the section that goes about Displays,

http://tkkrlab.nl/wiki/Lcd_through_IOexpander

Complete with example code and library :)
The library is not finished yet,
so report anything you'd like to see added,
and any tips are welcome!
Hope it's useful,

Greetings,
Duality

ps. also if wrong subforum to post on sorry :)
http://www.youtube.com/user/Shockszzbyyous
my website: freeduality.tk

liudr

Here's a version made by a forum member fm:

http://www.electrofunltd.com/p/pedidos.html

Look at the bottom of the page. Might be useful for you to compare your implementation with hers.

duality

Yes I will take a look at it :)
I've been in contact with here, but that was just regarding the code,
But i'll have a look that the hardware,
looks nice small and snug :P
this will do able with the ic's I use, because they also available in smd.

Greetings,
Duality
http://www.youtube.com/user/Shockszzbyyous
my website: freeduality.tk

bperrybap

Duality,
Have a look a fm's LiquidCrystal replacement library.
https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads
It should be a drop in for your implementation.

For a slight cost savings you can use a MPC23008 and 4bit mode
on the lcd.

Here is a hd44780 backpack that uses the MPC23008:
https://www.adafruit.com/products/292

It also supports controlling the backlight through the i/o expander.

--- bill

duality

http://www.youtube.com/user/Shockszzbyyous
my website: freeduality.tk

bperrybap


4 bit is no option for me :)


Why not?
For a hd44780 it is 4 less pins to hook up.
Using 4 bit mode allows the lcd to be controlled by a single 8 bit port
and still have 2 bits in the 8 bit port left over for things like backlight control.
(Just add a transistor)
It would allow the lcd to be controlled through 1 of the 8 bit ports on the 23016
(say GP0) and keep the full 8 bits of the other port (GP1) free for other uses.

4 bit mode would also allow using a smaller cheaper 8 bit i/o expander like the 23008 instead
of the dual port 23016.

--- bill

duality

What I meant was,
that 4bit was not an option, since I had some timeing iseus and data getting lost, which I don't have anymore since I use 8Bit
more over yes I could build in a 4 bit option though :),
I'll work that out later, bussy making the library arduino1.0 compatible :)
http://www.youtube.com/user/Shockszzbyyous
my website: freeduality.tk

floresta

Quote
I'll work that out later, bussy making the library arduino1.0 compatible

While you are at it why don't you change the initialization sequence to comply with the steps specified by Hitachi?

Don

floresta

Quote
...since I had some timeing iseus and data getting lost

Probably because you are not following the requirements of the data sheet.  You are using the same delay for all of the commands even though some of them require significantly more time than others.  Also, you are not accounting for the fact that some LCDs may run slower than the nominal speed upon which the datasheet times are based.  The 4-bit mode seems to be more sensitive to these discrepancies which could be why your 8-bit code appears to work.

Don

duality

yes, i had these issue's before i even made the circuit,
had 4 bit issue's when hooked up to the arduino directly :)

hey I thought i had made it like the datasheet lol, nope copied the initialization part from Liquid Crystal,
does that not work?

Beside's I had removed the delay and worked just fine, but didn't save the source,

Greetings,
Duality
http://www.youtube.com/user/Shockszzbyyous
my website: freeduality.tk

floresta

Quote
hey I thought i had made it like the datasheet lol, nope copied the initialization part from Liquid Crystal,
does that not work?

You didn't copy it from any version of LiquidCrystal that I recall.  Their current code isn't correct either, but it is closer to being correct than yours.  Why don't you take a few minutes and follow the LCD Initialization link at http://web.alfredstate.edu/weimandn ?

Quote
Beside's I had removed the delay and worked just fine, ...

AARRGGHH.  So it worked just fine on the particular display(s) that you tested it on and therefore you believe that it will work on all displays.  Go back and take a look at the section called "About the Delays" at the end of the link posted above.

Don

duality

No,
I tested it with the Hitachi HD44780,
And works,
don't worry the library is still in early stage's :)
There is waay room for improvement,
and I appreciate your tips and help,
And i'll try to make the library more efficient and better.

Greetings,
Duality
http://www.youtube.com/user/Shockszzbyyous
my website: freeduality.tk

floresta

Quote
I tested it with the Hitachi HD44780,
And works,

You tested it with [font=Verdana]one[/font] HD44780 and [font=Verdana]it[/font] works.  How about all the other HD44780s that are out there?

Don

duality

Why does it matter?
isn't it the same hardware?
Or is there something i am not seeing?

http://www.youtube.com/user/Shockszzbyyous
my website: freeduality.tk

bperrybap


Why does it matter?

yes
Quote
isn't it the same hardware?

No
Quote
Or is there something i am not seeing?

Yes,

It is kind of like saying all cars in the US have a steering wheel
on the left and a foot pedal on the right of the foot pedals to control speed
and a brake to the left of that pedal to slow down.
You interface to them the same, but
Do they all accelerate and brake the same?
No.

Not all "hd44780" based modules are the same speed at processing commands
as they are not all using the design or the same chips.

--- bill

Go Up