Pages: 1 [2] 3   Go Down
Author Topic: Connecting a graphical LCD via a I2C using a 16-bit port expander  (Read 11875 times)
0 Members and 1 Guest are viewing this topic.
SF Bay Area
Offline Offline
Edison Member
*
Karma: 10
Posts: 1235
Arduino Ninja
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Are you using software SPI or the hardware SPI transceiver for this?
Logged

Unique RGB LED Modules and Arduino shields: http://www.macetech.com/store

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 452
Posts: 18694
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

At the Arduino end? The hardware SPI. Why would you not use it? It clocks out bytes at about 3 microseconds each. You can connect multiple SPI devices as long as each one has its own SS line. The library I wrote lets you choose the SS line you have dedicated to the LCD (it might not be D10) so you can also connect Ethernet shields, etc.
Logged

india
Offline Offline
Newbie
*
Karma: 0
Posts: 42
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hey can use this library if i use 2 pcf8574p as port expander.
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 452
Posts: 18694
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Not unchanged. You are addressing two port expanders rather than one. The datasheet I found seems a bit light on information about the protocol, but it is probably different. I'm sure it can be done, but you will need to modify things here and there.
Logged

india
Offline Offline
Newbie
*
Karma: 0
Posts: 42
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

 i need to modify library or just hardware part
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 452
Posts: 18694
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm not sure what you mean by that. You are replacing one chip by two chips? Surely that involves a hardware change.

So you need to modify both.
Logged

india
Offline Offline
Newbie
*
Karma: 0
Posts: 42
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thank you sir
Logged

india
Offline Offline
Newbie
*
Karma: 0
Posts: 42
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

is there any other option for mcp23017 ic. it is not easily available in india1
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 452
Posts: 18694
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Mail? I get most of my stuff from overseas.
Logged

india
Offline Offline
Newbie
*
Karma: 0
Posts: 42
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hello sir,
           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.
Logged

United States (Texas)
Offline Offline
God Member
*****
Karma: 2
Posts: 525
Arduino socks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 452
Posts: 18694
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Dallas, TX USA
Offline Offline
Edison Member
*
Karma: 47
Posts: 2324
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

UK
Offline Offline
Sr. Member
****
Karma: 0
Posts: 273
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Nick,

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

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 452
Posts: 18694
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Pages: 1 [2] 3   Go Up
Jump to: