Go Down

Topic: ITDB28 Touch TFT and MCP23017 Port Expander (Read 2 times) previous topic - next topic

ReLiC

Aug 08, 2013, 06:55 am Last Edit: Aug 08, 2013, 06:58 am by ReLiC Reason: 1
Good Day peeps ;)

I have a ITD28 TFT Shield with SD and Touch that I would like to run off a Port Extender on the I2C Bus. Now the port extender I have gotten going and can turn LED's and so on and off with it but I need to get the screen to run off it.

Does anyone know if this is possible using either the UTFT library or the Adafruit libraries. Your help would GREATLY we appreciated if you can point me in the right directions.

This is the Port Expander
http://za.rs-online.com/web/p/i-o-expanders/0403806/

This is the LCD
http://imall.iteadstudio.com/development-platform/arduino/shields/im120417020.html

Trying to get this running on an Arduino Uno

I have the screen running off the Uno and the expander, its bringing the 2 together that I need assistance with.

TheCoolest

Does refresh speed matter at all? Consider that it usually takes around 250us (or ~100us for 400khz i2c) to write one byte to the i2c expander. Each pixel on this LCD is two bytes. And there are 76,800 pixels. A complete redraw will take almost 8 seconds or over 20 in 100khz mode.
My recommendation is to go with an SPI LCD.

ReLiC

Yeah I understand the refresh rate will be bad but I am refreshing small parts of it at a time and at the moment the lack of pins is the problem and runnin it on i2c bus would be preferable for me as I have a lot of these chips around.

I am using the UTFT library so if there is an easy way to get this done it would be awesome.

floresta

The MCP23S17 is essentially the same as the MCP23017 except that it has an SPI interface.

Don

TheCoolest

True, but the biggest problem with the MCP23S17 is its high price compared to the I2C variant. + the OP stated he has some of these chips kicking around.

floresta

You are the one who recommended using SPI.

Don

TheCoolest

Yes, that's right :)
I was just mentioning the 'problem' with that specific chip. I still think (and agree with you) that SPI is the way to go.
OP should make an effort rearranging the pins and hooking the LCD up to SPI. Another option is to use 595 SRs if there is no need to read from the display.

ReLiC

No need to read info from the display so all is good there

What I have at my disposal currently is the following

MCP23017
74HC595
PCF8574
HEF4094

The HEF4094 and 74hC595 are Shift Registers. The PCF chip is also an expander like the MCP but its 8 bit instead of 16 Bit.

I am not apposed to buying another few chips to get this going so even though I have them kicking around I can make a change to the layout. My main thing is that the display is taking up 11 pins and I dink need those :P



TheCoolest

The SD card slot uses SPI anyway. You can use the 595's (I never used the 4094, although I think they are very similar) to connect the LCD to your SPI pins.
For the LCD you'll need pin 11 (MOSI), pin 13 (SCK) and another pin for the latch. For the SD card you'll be using pins 11, 12 and 13, and another pin for the slave select pin on the SD card.

ReLiC

Ok being a total noob at this can I ask you for guidance ...

Is teh SPI bus the same as the I2C bus in that you can add more than one device on there?

Then with the libraries, the UTFT I have working with the TFT directly connected to the TFT, what would need to change using the 595 Shifter to get it working on the SPI bus ?

TheCoolest

You can connect multiple devices to the SPI bus. The difference is that each device requires a separate 'Slave Select' signal, this means each device use shared Data-In (MOSI), Data-Out (MISO) and clock (SCK) pins on the Arduino, but an extra pin on the Arduino is required for each device to 'select' it when you want to talk to it.
While I2C uses an address to select the device you need access to, in SPI you use the Slave Select signal to do this.

The 595 has 8 outputs, you can daisy chain two devices together for 16 outputs. You should read the datasheet on these to understand what goes where.
Basically there is a clock pin, data pin and a 'strobe' or 'store' pin on a 595. Pin13 from your Arduino goes to the clock, Pin11 to the data and your slave select pin goes to the strobe.

ReLiC

Ok Awesome, breadboarded it up and I can turn LED's on and off on the shirt register. Now except for doing a hell of alot of changes to the current UTFT library, is there an easy way to get about getting it done?

Go Up