Go Down

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


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

It matters if you want your software to be reliable.
It is 'similar' hardware.  They attempt to make all of them the same but they are not all identical.
You are not accounting for the variations from one device to the next.


Edit:  Bill types faster than I do.




Hi all,
Here's a little update:

I've been busy writing stuff, and have recently started working on a 4Bit mode for my library!

Floresta, want to thank you for that link in your first post I believe.

I am currently working on a 4Bit mode, so that'll there soon, for now I am stuck on a blinking Cursor that just blinks.
I've realized that if you use a MCP23008 you still have 2 pins to spare when I am done.
Although I don't have have the MCP23008 right here now, I am fairly confident I can get one easily around here  :)
Which also means if your's using a 16Bit expander you save up to 10 pins!

I have notice that timing is more of an issue when working with 4Bit mode, and I am trying to follow the proper way to
initialize the lcd.

that's it,


This 4bit is not gonna happen! the mcp23016 is waay to slow, the mcp23017 however is quite a different story, it can be either controlled by spi or i2c
Just wanted to let you know :)



Huh? Way too slow for what?
The speed of the interface used to get to the hd44780 interface
will not affect being able to control or update the LCD.
A slower interface speed will only lower the speed of the LCD updates.

I suggest you have a look at fm's latest LiquidCrystal replacement library.

If you scroll down on the wiki you will see the interface timing for each
of the interfaces supported on both AVRs, and pic32 processors.
In the table labeled "Benchark II" which is numbers provided by the LCDiSpeed sketch
that I wrote, you can see that a Shift Register (74HC595) using 3 wires can update a full 16x2 display
close to 500 times/sec, (around 400 times/sec in 2 wire mode)
while a pcf8574 i2c interface in 4 bit mode can update a full 16x2 display about 30 times/sec.

While I2c with a pcf8574 in 4 bit mode is more than 10x slower than using a shift register in 4 bit mode,
it is still very usable.

The library has a framework that allows you to quickly and easily drop in support for a new interface.
All the upper level command initialization is handled by a hd44780 LCD class that sits on top of the
minimal library interface class.
You could use the existing ic2 interface class which is for a pcf8574 as a guide for your  mcp23008/mcp23016
to create a new interface class.

The interface classes are quite tiny as all they do is some initialization, push data/cmds to the interface
and handle a small bit of backlight control.
Everything else hd44780 related is handled by the generic LCD class.

--- bill


This 4bit is not gonna happen! the mcp23016 is waay to slow...

There is no interface on earth that is too slow for an LCD interface.  You can do it with switches and dispense with the microprocessor altogether.



Ok, didn't know that that is awesome :)
than it must be a fault at my side, but what?
At the moment i am trying to get 4bit with a shiftRegister, and i am not using a library for the matter,
Looking if i can get it to work, and see what i did wrong or need to do in my library :)

Thanks for the motivation guys!




updated the library to work with 4x20 displays, and now I've tested my library with multiple LCD controllers,
and so far all of them worked :)
going to try more displays though, In total I've tested 4 displays with different controllers,
two with the HJ602A controller,
one with the this: https://www.google.com/search?q=pc1602F+&ie=utf-8&oe=utf-8&client=ubuntu&channel=fs (PC1602F)
and one with this controller: https://www.google.com/search?q=st7063c-qg&ie=utf-8&oe=utf-8&client=ubuntu&channel=fs (ST7063C)

I haven't been working on a 4 bit mode for a while, But I am going to give it a try soon though,
still got to look at the initialization it works, but can be approved upon for increased reliability.



Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131