One mega two TFT's

Is it posible to run two TFT screens from one mega ?

If it is how do i assign the pins for the second screen ?

Can i name the two screens instead of using this

// create an instance of the library
TFT TFTscreen = TFT(cs, dc, rst););

use

TFT TFTscreen = HLTTFT(cs, dc, rst);

TFT TFTscreen = MLTTFT(cs, dc, rst);

TIA Pesh

Simplest way is to use a pointer rather than direct variable you can then code.. Obviously you will have to select the correct pin assignments based on the display you are using

These code examples assume use of the UTFT Library..

    UTFT *Lcd1;
    UTFT *Lcd2;
    Lcd1 = new UTFT(ITDB32S, a,b,c,d);
    Lcd2 = new UTFT(ITDB32S, a,b,c,d);

Then to access the displays just use the pointer syntax to access the Method call

   Lcd1->clrScr();
   Lcd1->fillScr(VGA_BLACK);

So how do i asign the pins for the second TFT if the mega assumes that im using

To connect the lcd screen to a Mega board, use this pin configuration:

+5V: +5V MISO: 50 on Mega 2560 (Miso on ADK) SCK: 52 on Mega 2560 (Sck on ADK) MOSI: 51 on Mega 2560 (Mosi on ADK) LCD CS: pin 10 SD CS: pin 4 D/C: pin 9 RESET: pin 8 BL: +5V GND: GND

Pesh

TFT is using SPI for transfers? Then I would think you would re-assign the CS pin before calling for a transfer each time so that the correct screen is addressed.

Thank you

Pesh

Ok so im still not getting this can i still use the same pins as

+5V: +5V MISO: 50 on Mega 2560 (Miso on ADK) SCK: 52 on Mega 2560 (Sck on ADK) MOSI: 51 on Mega 2560 (Mosi on ADK) LCD CS: pin 10 SD CS: pin 4 D/C: pin 9 RESET: pin 8 BL: +5V GND: GND

For both screens but just use a second "LCD CS" pin ?

Pesh

Yes. There is an SD card on both TFTs? Are you using both on both, or just on one?

I wasnt planning to use either im onlt displaying simple text so shouldnt need to use a sd card at all.

Im guessing your gonna say use a differnt pin for each sd card too.

Pesh

I'm just guessing by the names given: LCD CS: pin 10 SD CS: pin 4

If you post a link to the TFT module that would help.

TTF is

http://arduino.cc/en/Guide/TFTtoBoards

Pesh

Yes, so two CSs, one to each board, with SCK, MOSI, MISO, D6, D10 in parallel to each card. http://arduino.cc/en/uploads/Main/GLCD_sch.pdf

Thats gonna save me a few pins i want 2 h bridges on 1 mega too, thank you very much.

so i just do a

 #define cs   10
#define dc   9 

 TFTscreen.text("",0,0)'

#define cs   12
#define dc   11

TFTscreen.text("",0,0)

Pesh

define can only go at the top of the sketch.

Before setup (), declare the two as byte cs = 10; byte dc = 9;

then cs = 10; dc = 9;

and cs =12; dc = 11;

as you switch back & forth.

Thank you very much

Im also strugling with a text overwrite issue the new text simply overwrites the old is there a way to clear the screen.

Im using the #include<TFT.h> library, and the only way to clear the screen in the examples is to over write the text with the text set to background colour. the UTFT has a clear comand but i cant get the UTFT working with this screen, though this could be because im new to arduino.

Pesh

Have not used myself, not sure if there are Clear commands, or if you just have to live with sending new data.

OK thank you any way

Pesh