Pages: [1] 2   Go Down
Author Topic: Project IOlcd, lcd controled through a IOexpander(in this case a MCP23016)  (Read 2203 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
***
Karma: 0
Posts: 106
look at this might be intresting: http://www.youtube.com/user/Shockszzbyyous and my Website: freeduality.tk
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley
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 smiley
Logged


Central MN, USA
Offline Offline
Tesla Member
***
Karma: 72
Posts: 7171
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged


Offline Offline
Full Member
***
Karma: 0
Posts: 106
look at this might be intresting: http://www.youtube.com/user/Shockszzbyyous and my Website: freeduality.tk
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes I will take a look at it smiley
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 smiley-razz
this will do able with the ic's I use, because they also available in smd.

Greetings,
Duality
Logged


Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 63
Posts: 2649
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: December 25, 2011, 09:01:35 pm by bperrybap » Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 106
look at this might be intresting: http://www.youtube.com/user/Shockszzbyyous and my Website: freeduality.tk
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

4 bit is no option for me smiley
Logged


Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 63
Posts: 2649
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

4 bit is no option for me smiley

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
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 106
look at this might be intresting: http://www.youtube.com/user/Shockszzbyyous and my Website: freeduality.tk
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley,
I'll work that out later, bussy making the library arduino1.0 compatible smiley
Logged


Western New York, USA
Offline Offline
Faraday Member
**
Karma: 32
Posts: 4258
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 32
Posts: 4258
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 106
look at this might be intresting: http://www.youtube.com/user/Shockszzbyyous and my Website: freeduality.tk
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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
Logged


Western New York, USA
Offline Offline
Faraday Member
**
Karma: 32
Posts: 4258
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 106
look at this might be intresting: http://www.youtube.com/user/Shockszzbyyous and my Website: freeduality.tk
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

No,
I tested it with the Hitachi HD44780,
And works,
don't worry the library is still in early stage's smiley
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
Logged


Western New York, USA
Offline Offline
Faraday Member
**
Karma: 32
Posts: 4258
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I tested it with the Hitachi HD44780,
And works,
You tested it with one HD44780 and it works.  How about all the other HD44780s that are out there?

Don
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 106
look at this might be intresting: http://www.youtube.com/user/Shockszzbyyous and my Website: freeduality.tk
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged


Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 63
Posts: 2649
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Pages: [1] 2   Go Up
Jump to: