how to use 2.4 tft lcd sheild for uno as breakout

I want to use 2.4 inch tft LCD sheild for uno as breakout because I need pin 2 and pin3 of arduino board which are intrupt pin and occupied by the LCD. I purchase the tft LCD from mcu friend.com and using adafruit tftlcd library.

So just change the pins. Pins 2 and 3, unless the screen needs to use interrupts (Highly doubtful), you can change them to whatever other two pins you have available.

Another thing to consider is if they are data bus pins that are hard coded in the library, but again doubtful since it is using the Adafruit library and the adafruit library has the option to use SPI or your own custom configuration.

Yes it is data bus pin. Where to change the pin configuration. I am new to arduino.

First before we go any further, does the display even work? Can you see clear text and shapes and not just a white screen?

Please provide a link to your exact display model and where you downloaded your library.

HazardsMind: First before we go any further, does the display even work? Can you see clear text and shapes and not just a white screen?

Please provide a link to your exact display model and where you downloaded your library.

here i have purchasesd:http://www.electroniccomponentsonline.co.in/how-to-use-2.4inch-tft-lcd-mcufriend library link:-https://github.com/Smoke-And-Wires/TFT-Shield-Example-Code https://github.com/adafruit/Adafruit-GFX-Library https://github.com/adafruit/Touch-Screen-Library

every thing is fine . the display is coming as i expected i.e text,circle,rectangle etc. touch screen also woks fine only things i want to use interrupt pin for my application which is occupied by the display.

What board are you using, Uno or Mega? Your first post says the display is for an Uno, but is that what you are using?

HazardsMind: What board are you using, Uno or Mega? Your first post says the display is for an Uno, but is that what you are using?

yes it is arduino uno r3

Then even if I change the code, you won't have any other pins you can use. Everything is being used by the display. You need to either get an Arduino Mega, or a different display that uses SPI.

HazardsMind: Then even if I change the code, you won't have any other pins you can use. Everything is being used by the display. You need to either get an Arduino Mega, or a different display that uses SPI.

the display occupied pin no 10 ,11,12,13 (uno board) for sd card . i dont want to use this. if 2 and 3 is shifted then i can use the disply for my application.

amubgr: I want to use 2.4 inch tft LCD sheild for uno as breakout because I need pin 2 and pin3 of arduino board which are intrupt pin and occupied by the LCD. I purchase the tft LCD from mcu friend.com and using adafruit tftlcd library.

You could just redefine, using #define, PORT D pins and reroute the data bit currently on pins 2 and 3 to the connected but vacant / unused SD pins. Or , since you are going "the interrupt way " you could just "reroute" the interrupt pins (2,3) to some other pins. It has been done before, but not by me - I like my "any pin is an interrupt " Due. There are example codes on how to do this. Just google it.

Ok I can make it so that what is in Pin 3 will go to Pin 11, and pin 2 will go to pin 10. You will need to bend the pins and make new ones. I would recommend you get a protoshield from either RadioShack (if one is still open) or online.

This way the display stays stock but the pins can be reconfigured.

As far as the code goes, you would need to change some lines in the UNO_24_Shield.h file.

From:

define write8inline(d) { \

PORTD = (PORTD & B00000011) | ((d) & B11111100); \ PORTB = (PORTB & B11111100) | ((d) & B00000011); \ WR_STROBE; }

define read8inline(result) { \

RD_ACTIVE; \ DELAY7; \ result = (PIND & B11111100) | (PINB & B00000011); \ RD_IDLE; }

define setWriteDirInline() { DDRD |= B11111100; DDRB |= B00000011; }

define setReadDirInline() { DDRD &= ~B11111100; DDRB &= ~B00000011; }

To: (Not tested)

#define write8inline(d){\
    PORTD = (PORTD & B00001111) | ((d) & B11110000); \
    PORTB = (PORTB & B11110000) | ((d) & B00001111); \
    WR_STROBE; }

#define read8inline(result) { \
    RD_ACTIVE; \
    DELAY7; \
    result = (PIND & B11110000) | (PINB & B00001111); \
    RD_IDLE; }

#define setWriteDirInline() { DDRD |= B11110000; DDRB |= B00001111; }
#define setReadDirInline() { DDRD &= ~B11110000; DDRB &= ~B00001111; }

HazardsMind: Ok I can make it so that what is in Pin 3 will go to Pin 11, and pin 2 will go to pin 10. You will need to bend the pins and make new ones. I would recommend you get a protoshield from either RadioShack (if one is still open) or online.

This way the display stays stock but the pins can be reconfigured.

As far as the code goes, you would need to change some lines in the UNO_24_Shield.h file.

From:

To: (Not tested)

#define write8inline(d){\
    PORTD = (PORTD & B00001111) | ((d) & B11110000); \
    PORTB = (PORTB & B11110000) | ((d) & B00001111); \
    WR_STROBE; }

define read8inline(result) { \

    RD_ACTIVE; \     DELAY7; \     result = (PIND & B11110000) | (PINB & B00001111); \     RD_IDLE; }

define setWriteDirInline() { DDRD |= B11110000; DDRB |= B00001111; }

define setReadDirInline() { DDRD &= ~B11110000; DDRB &= ~B00001111; }

i modified the code as you suggest and it works. thanks a lot sir.