Go Down

Topic: Connecting a graphical LCD via a I2C using a 16-bit port expander (Read 14 times) previous topic - next topic

weirdo557

ooh, good job with the library! this may come in useful to me later on :) much appreciated!

Nick Gammon


           i have done the same thing using pcf8574. but data display on lcd  very slowly. what are the speed parameter of i2c ,mcp23017 you have used. does wire length of i2c effects speed.


At normal speed I believe I2C runs at around 10K bytes/second, and with a speedup (higher speed set) you can get to 3.5 times that.

I don't see why wire length would affect it.

If the LCD is slow it could be you are sending too much (like updating more than you need). Also the LCDs have a settling time (you have to poll a pin to see if they are ready) so it could be that speed, and not I2C speed, that is the limiting factor.

bperrybap


Also the LCDs have a settling time (you have to poll a pin to see if they are ready) so it could be that speed, and not I2C speed, that is the limiting factor.


ks0108s are really dumb so the commands or data accesses are usually very fast to execute.
Usually they are ready before you can generate the next command or data access.
I've occasionally seen them take and extra 3-4us to respond but that is not the norm.

I would think that ic2 should not have an issue overrunning the lcd as the byte transfer time at 400k bits/sec is 20us.
Even if you bump the i2c clock to 1Mhz, a byte transfer time is still 8us
and you have to transfer at least 2 bytes to control the 16 bits on the output port
plus you still have I2C START + ADDRESS + STOP  overhead.



--- bill

point5

Hi Nick,

Do you know if your great work ever made it into a Backpack PCB design?

Nick Gammon

No I think not. I contacted one place that made Arduino boards and never heard from them again.

It should be simple to do, I might see if someone else will do it.

Go Up